If I’m reading df.map.xml right, it should be under df.map.feature.irritation_level. Dividing that by 10K should give the chance of an attack.
Nope, that's not quite how you read the file. Each XML file is a collection of loosely-related types, and you are looking at the
definition of the "feature" struct. So if you can find an instance of
feature, it will have these fields.
This type is a little hard to search for since a lot of other types/fields also have "feature" in their name. I ended up searching for
='feature' and determined that there are no instances of the feature type itself, but there are a bunch of instances of subclasses of feature contained within subclasses of feature_init (these are all in df.map.xml still). The vector that 0x517A5D pointed out (
df.global.world.features.map_features) is a vector of feature_init objects. It very likely contains
subclasses of feature_init, but
all of those do contain an instance of a feature subclass named "feature", so you ought to be able to get to the irritation fields from there, as shown by 0x517A5D.
Is there a (soft or hard) size limit on the value string?
Is it preferable to have one entry with a very (very) long string, or many (many) entries with empty strings, using the ints[] instead?
I believe there is no longer a hard limit. There used to be a 65k limit when we stored data as histfig names, but now it should be getting stored in JSON instead. You can verify this by looking for a .dat file in your save folder named something starting with "dfhack" - it should actually contain JSON.
That said, you should limit yourself to a reasonable amount of data. Users will probably not be happy if you write 1GB of data in there.
Or should I look for another way? I could modify the map itself....
What exactly are you trying to store? I believe we still have a way to associate a custom bitmap with map blocks, if you're trying to save some data that relates to map tiles.