- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
Difference between revisions of "User:0x517A5D"
(→Voodoo) |
|||
Line 86: | Line 86: | ||
== Race Voodoo == | == Race Voodoo == | ||
+ | To find the variable holding the index of the dwarven race, | ||
+ | |||
+ | <pre> | ||
+ | // find dwarven race variable. shows use of some of the simpler meta tokens. | ||
+ | |||
+ | d = search(5+4, | ||
+ | // movsx reg1, word ptr dorf_race_id | ||
+ | 0x0F, 0xBF, ANYBYTE, HERE, ADDRESS, | ||
+ | // cmp [reg2+8Ch], reg1 | ||
+ | 0x39, ANYBYTE, DWORD_, 0x0000008C | ||
+ | ); | ||
− | + | if (!d) { handlefailure; } | |
− | + | ||
− | + | dwarven_race_index_loc = peekd(d); | |
− | + | ||
− | + | printf("dwarven_race_index at %08X", dwarven_race_index_loc);</pre> | |
− | + | ||
− | + | Note: the variable is either a short int or an unsigned short int. | |
== Unit Table Start Pointer Voodoo == | == Unit Table Start Pointer Voodoo == |
Revision as of 06:15, 18 November 2007
Build
Currently running
- a competent mason / proficient building designer / novice organizer / novice record keeper
- a proficient armorsmith / skilled metalsmith / novice furnace operator
- a proficient weaponsmith / skilled metalcrafter / novice furnace operator
- a proficient bowyer / proficient mechanic
- a skilled herbalist / novice bowyer / novice persuader / novice negotiator / novice judge of intent / novice appraiser / novice flatterer
- a proficient brewer / skilled grower / novice armorsmith
- a proficient cook / skilled grower / novice weaponsmith
And
- 2 copper picks
- 1 steel battle axe
- 1 iron anvil
- 28 plump helmet spawn
- 15 pig tail spawn
- 1 dimple cup spawn
- 1 cave wheat seed
- 1 sweet pod seed
- 1 rock nut
- 1 plump helmet
- 4 units of assorted alcohol, 1 of each type available
- 11 turtles
- 11 units of assorted 2p meats, 1 of each type available
- 11 units of assorted 4p meats, 1 of each type available
- 8 units of assorted 2p fish, 1 of each type available
- 2 units of assorted 4p meats, 1 of each type available
- 6 dogs
The drinks, plump helmet, meat, and fish are bought for the free barrels. Most seeds are bought for the free bags. Turtles are bought for the shells and bones.
I chose a 5x5 map which I had previously verified to have hidden magma, lots of limestone and marble, tons of magnetite, some coal, and lots of trees.
I wil play with using reveal this time. I enjoy it more that way.
Esmullogem, "Fullpaint". Could be worse. Stroike the oith!
Enable Magma Buildings
Helper utility for Rick's reveal.exe
enable_magma_buildings.zip
You need this utility in the case that you used the reveal utility, and there is a magma pool or pipe on your map that does not reach the surface. (If the hide utility is ever updated, you could also hide a few magma tiles and then dig them out. That worked in the old version.)
Because there is no actual flag that controls whether magma has been seen (the game searches a list, probably a list of notable events), I had to patch the game's code. This means you need to run the patch every time you start dwarfort.exe.
This utility has been made version-independent. It is expected to work with future releases of Dwarf Fortress.
Map Data Voodoo
To find the map_data, map_x_count, map_y_count, and map_z_count in an unknown version of dwarfort.exe,
// find certain map data variables. // this is the simplest type of search -- no meta tokens at all. d = search(6, 0xC6, 0x44, 0x24, 0x38, 0x3E, 0xBF); if (!d) { handlefailure; } // however this math complicates it. map_data_loc = peekd(d + 0x18); map_x_count_loc = peekd(d + 0x1E); map_y_count_loc = peekd(d + 0x24); map_z_count_loc = peekd(d + 0x2A); if (map_x_count_loc + 4 != map_y_count_loc || map_y_count_loc + 4 != map_z_count_loc) { handlefailure; } printf("map: %08X %08X %08X %08X", map_data_loc, map_x_count_loc, map_y_count_loc, map_z_count_loc);
Race Voodoo
To find the variable holding the index of the dwarven race,
// find dwarven race variable. shows use of some of the simpler meta tokens. d = search(5+4, // movsx reg1, word ptr dorf_race_id 0x0F, 0xBF, ANYBYTE, HERE, ADDRESS, // cmp [reg2+8Ch], reg1 0x39, ANYBYTE, DWORD_, 0x0000008C ); if (!d) { handlefailure; } dwarven_race_index_loc = peekd(d); printf("dwarven_race_index at %08X", dwarven_race_index_loc);
Note: the variable is either a short int or an unsigned short int.
Unit Table Start Pointer Voodoo
To find the variable holding a pointer to the start of the unit table,
- Search the program text for:
- 8B ANY C8 04 00 00 8D ANY ANY 8B ANY (ANY ANY ANY 01) 85
- There are two matches (in .33a)
- The DWORD 11 bytes into this pattern, marked with parentheses, points to the .start field of the unit table vector.
- 4 bytes above that is the .end field of the vector.
- Treat the .start field as a pointer to an array of pointers to creature structures.