Hi, is there a way for a script to know if a particular unit has a particular syndrome? I know that Dwarf Therapist can list current syndromes, so the info must be in there somewhere.
When I tried to figure out the structure of an active syndrome, I came up with the following (edited to make the values line up):
[lua]# for k,v in pairs(miner_unit.syndromes.active[0]) do print(k,v) end
type 1
year 125
year_time 18832
ticks 3
wounds <vector<int32_t>: 0x35ff2840>
wound_id -1
symptoms <vector<unit_syndrome.T_symptoms*>: 0x35ff2854>
reinfection_count 1
flags <unit_syndrome.T_flags: 0x35ff2868>
unk4 <vector<int32_t>: 0x35ff286c>
The 'type' was 1 for two different syndromes, so that's not an identifier. Running the same loop on 'wounds' and 'unk4' yields nothing, and 'symptoms' doesn't give me anything useful. My guess is that I'm doing this almost exactly wrong.
In the give-me-a-fish category, how do I find out if a specific syndrome is affecting a unit?
In the teach-me-to-fish category, is there a complete object model documented somewhere?
DFHack is awesome, it's just a tad overwhelming at times.
Edit: Had the 'type' be 1 on one syndrome and 20 on another, so that seems to be an identifier. The question then becomes, where do I look up that identifier to get the name of the syndrome? I can't depend on the numeric id's staying static since who knows what other mods might be loaded in the future.