Skip to content

Commit

Permalink
Merge pull request #74 from uzername/master
Browse files Browse the repository at this point in the history
Some new information to developer's FAQ. That's my pull request.
  • Loading branch information
kevingranade committed Feb 18, 2013
2 parents 3adf2e4 + 0c670e8 commit d23ef6b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions DEVELOPER_FAQ.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@
7) Just like attacks, some monsters may have a special function called when
they die. This works the same as attacks, but the relevent files are
mondeath.h and mondeath.cpp.
1.3 Adding structures to the map
Most "regular" buildings are spawned in cities (large clusters of buildings which are located rather close to each other).
In file omdata.h in the enum oter_id structure define names (code identifiers) for your building.
If you want your building to be displayed at overmap in different orientations, you should add 4 identifiers for each orientation (south, east, west and north correspondingly).
In the same file in structure const oter_t oterlist[num_ter_types]
we should define how these buildings will be displayed, how much they obscure vision and which extras set they have. For example:
{"mil. surplus", '^', c_white, 5, build_extras, false, false},
{"mil. surplus", '>', c_white, 5, build_extras, false, false},
{"mil. surplus", 'v', c_white, 5, build_extras, false, false},
{"mil. surplus", '<', c_white, 5, build_extras, false, false}
Comments at the beginning of this structure are rather useful.
In the file mapgen.cpp find the subroutine called draw_map(...);
there you should find a huge variant operator ("switch")
where you should put your code defining the new building by adding new case-statement.
This should be mentioned that most buildings are built on the square SEEX*2 x SEEY*2 tiles.
If you want your building to be spawned not only in city limits
you should refer to structures in file omdata.h
(starting from the line #define OMSPEC_FREQ 7).
These structures are commented in source code. Add new identifier in enum omspec_id structure before
NUM_OMSPECS and then add a record in const overmap_special overmap_specials[NUM_OMSPECS] array. For example:
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0, &omspec_place::wilderness,0}
The comments given in source code to structure struct overmap_special explains the meaning of these constants in the example above.


FAQ
Expand Down

0 comments on commit d23ef6b

Please sign in to comment.