436
DF General Discussion / Re: Future of the Fortress
« on: August 09, 2023, 11:03:35 am »
Iirc there was discussion of working on Linux and Mac versions in the Blindirl interview with Tarn and Putnam recently, on Youtube
April 23, 2024: Dwarf Fortress 50.13 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
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.
Also, @Myk, df.map.xml also says:Quote from: df.map.xml<int16_t name='irritation_attacks' comment='maxes at 10?'/>
Does that mean that there can be no more than 10 attacks by agitated creatures at one time?
gui/gm-editor tells me the structure is
df.global.world.features.map_features[].feature.irritation_level
and
df.global.world.features.map_features[].feature.irritation_attacksIs it possible to get a function to read and display wilderness/cavern agitation levels, to say monitor how close you are to attracting agitated wildlife or cavern ambushes?
This horrible one-liner prints (some of) the data for each map feature. But I don't think it covers the surface.I don't know at the moment where that data is.Run from the DFHack prompt.Code: [Select]:lua for i,mf in ipairs(df.global.world.features.map_features) do l=-1;pcall(function()l=mf.layer;end);print(string.format("feature %d %s %s-%s underground_region #%d irritation_level %d irritation_attacks %d",i,mf._type,df.layer_type[mf.start_depth],df.layer_type[mf.end_depth],l,mf.feature.irritation_level,mf.feature.irritation_attacks));end;
Sample output:Code: [Select]feature 0 <type: feature_init_subterranean_from_layerst> Cavern1-Cavern1 underground_region #11 irritation_level 4008 irritation_attacks 0
feature 1 <type: feature_init_subterranean_from_layerst> Cavern2-Cavern2 underground_region #31 irritation_level 7924 irritation_attacks 0
feature 2 <type: feature_init_subterranean_from_layerst> Cavern3-Cavern3 underground_region #56 irritation_level 11408 irritation_attacks 0
feature 3 <type: feature_init_magma_core_from_layerst> MagmaSea-MagmaSea underground_region #81 irritation_level 3180 irritation_attacks 0
feature 4 <type: feature_init_underworld_from_layerst> Underworld-Underworld underground_region #106 irritation_level 0 irritation_attacks 0
feature 5 <type: feature_init_outdoor_riverst> Surface-Surface underground_region #-1 irritation_level 288 irritation_attacks 0
feature 6 <type: feature_init_subterranean_from_layerst> Cavern1-Cavern1 underground_region #6 irritation_level 1760 irritation_attacks 0
feature 7 <type: feature_init_deep_special_tubest> MagmaSea-Underworld underground_region #-1 irritation_level 20040 irritation_attacks 0
feature 8 <type: feature_init_deep_special_tubest> MagmaSea-Underworld underground_region #-1 irritation_level 0 irritation_attacks 0
Hmm. Outdoor irritation is kept separate from that, in a variable in plotinfo.Code: [Select]:lua print(string.format("outdoor_irritation:%d",df.global.plotinfo.outdoor_irritation))
Sample output:Code: [Select]outdoor_irritation:35000