v50 Steam/Premium information for editors
- 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.
This notice may be cached—the current version can be found here.
Editing 40d:Memory hacking
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "40d"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | == New string format == | |
− | |||
− | == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| border="1" cellpadding="2" width="100%" | {| border="1" cellpadding="2" width="100%" | ||
| Offset || Size || Type || Description | | Offset || Size || Type || Description | ||
|- | |- | ||
− | | 0x00 | + | |0x00 || 16 || Character buffer || Holds the string data if capacity < 16 |
− | |||
− | |||
|- | |- | ||
− | | | + | |0x00 || 4 || Character pointer || Points to the string data if capacity >= 16 |
|- | |- | ||
− | | | + | |0x10 || 4 || Length || Current length of the string |
|- | |- | ||
− | | | + | |0x14 || 4 || Capacity || Current capacity of the string buffer (also indicates which mode the string is in) |
|} | |} | ||
− | Yes, the | + | Yes, the first two items overlap. This is correct. This is the MSVC Express string format - Toady appears to be using standard C++ structures pretty much everywhere. |
− | + | == Vector format == | |
{| border="1" cellpadding="2" width="100%" | {| border="1" cellpadding="2" width="100%" | ||
| Offset || Size || Type || Description | | Offset || Size || Type || Description | ||
|- | |- | ||
− | | 0x00 || 4 || | + | |0x00 || 4 || vtable || (not useful) |
− | |||
− | |||
|- | |- | ||
− | | | + | |0x04 || 4 || Array start |
|- | |- | ||
− | | | + | |0x08 || 4 || Array end || (End - Start)/4 = # of elements |
|} | |} | ||
− | == | + | == Attention! == |
+ | We need to be very clear about what version(s) these addresses apply to. Please list version numbers along with addresses. | ||
+ | |||
+ | == Addresses for 27.169.33a == | ||
− | + | {| border="1" cellpadding="2" width="100%" | |
+ | ! width="25%" | Name | ||
+ | ! width="50%" | Notes | ||
+ | ! width="25%" | Address | ||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="3" | '''Useful Variables''' |
+ | |||
|- | |- | ||
− | | | + | | Art defacement malus |
+ | | normally -1000 (18 FC FF FF) | ||
+ | | 0079DC2F | ||
+ | |||
|- | |- | ||
− | | | + | | Current Year |
+ | | | ||
+ | | 00C34378 | ||
+ | |||
|- | |- | ||
− | | | + | | Dwarf Race ID |
+ | | As in the race identifier in the [[#Creature Structure]] | ||
+ | | 01237AD0 (probably) | ||
+ | |||
|- | |- | ||
− | | | + | | Creature Vector |
+ | | | ||
+ | | 01416A48 (probably) | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | == Creature Structure == | ||
+ | |||
+ | In version {fill this in please} | ||
+ | |||
+ | Structure Offsets: | ||
+ | {| border="1" cellpadding="2" width="100%" | ||
+ | | Offset || Size || Type || Description | ||
|- | |- | ||
− | | | + | |0x00 || 4 || Vptr || Virtual function table pointer |
|- | |- | ||
− | | | + | |0x04 || 24 || First name || See above string format |
|- | |- | ||
− | | | + | |0x32 || 4 || Surname word 1 || No part of speech, like in the old structure |
|- | |- | ||
− | | | + | |0x36 || 4 || Surname word 2 || |
|- | |- | ||
− | | | + | |0x70 || 24 || Custom profession name || See above string format |
|- | |- | ||
− | | | + | |0x88 || 2 || Type ID #1 || rowspan="2"|These two are wild guesses - I believe they are dwarf types. They appear to be duplicated (I'm told Toady stores the original dwarf type for legends) and I don't know which is the "old" and which is the "new". I've entered the values I've found in the Type ID table below. #2 is the current type. |
|- | |- | ||
− | | | + | |0x8a || 2 || Type ID #2 |
|- | |- | ||
− | | | + | |0x8C || 4 || Creature Race || A6 is the dwarf default (this may be different if the user has a mod installed) |
|- | |- | ||
− | | < | + | |0xe4 || 4 || Flags || (1 << 1) if creature is dead (redundant?) |
|- | |- | ||
− | | < | + | |0xe8 || 4 || Flags || (1 << 7) if creature is dead (redundant?) |
+ | (1 << 17) if creature is ready for slaughter | ||
|- | |- | ||
− | | | + | |0x458 || 102 || Labor preferences || 102 1 byte values, corresponding to the profession list. Mostly bools, with notable exceptions of shieldtype,armortype, and weaponnum. I have No idea what the last one means. |
|- | |- | ||
− | | | + | |0x504 || 4 || Happiness level || 0 = miserable, >149 = ecstatic |
|- | |- | ||
− | | | + | |} |
− | + | ||
− | + | == Type ID list == | |
− | + | ||
− | + | Hideously incomplete and may be completely wrong. | |
− | + | ||
− | + | {| border="1" cellpadding="2" width="100%" | |
− | + | | ID || Meaning | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | |0x00 || Miner |
|- | |- | ||
− | | | + | |0x04 || Woodcutter |
|- | |- | ||
− | | | + | |0x2f || Planter |
|- | |- | ||
− | | | + | |0x29 || Cook |
|- | |- | ||
− | | | + | |0x31 || Brewer |
|- | |- | ||
− | | | + | |0x37 || Mechanic |
|- | |- | ||
− | | | + | |0x3e || Architect |
|- | |- | ||
− | | | + | |0x6c || Creature |
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
+ | |||
+ | |||
== Profession list == | == Profession list == | ||
+ | |||
+ | Obviously could do with some formatting. | ||
+ | |||
PROFESSION_MINE, | PROFESSION_MINE, | ||
PROFESSION_HAUL_STONE, | PROFESSION_HAUL_STONE, | ||
Line 388: | Line 232: | ||
PROFESSION_UNUSED_30, | PROFESSION_UNUSED_30, | ||
PROFESSIONNUM, | PROFESSIONNUM, | ||
− |