Has anyone experimented much with diplomacy? Can you make enemy civs hostile/friendly with DFHack?
EDIT: Follow up question, has anyone done much work with changing a units allegiance? I have written a small script that changes a few basic things, but the changed units don't quite behave the way they should. I am wondering if there are flags and such I'm not properly switching. What all goes into determining if two units are hostile/neutral/friendly to eachother?
There's a global "enemy" table that keeps track of sides in a fight but I have no idea how it works.
Hmm is this table available for research purposes?
Diplomacy not so much: probably just mess around with entity (i.e. current site entity vs other one) add appropriate hist-entity links etc...
As for allegiance: it's controlled by few factors: it's civ_id and there is also it's history (e.g. crimes etc...) that get recalculated ever so often into a cache table (which i guess Roses mentioned) I think it was called df.global.world.enemy_cache, but could be wrong... The research in that table entry values is here:
gist Totally not finished and could be wrong. But the idea is that you might need to change them when you change civ_id so they would not attack wrong unit while it gets recalculated. Or you could change it to force unit to attack (and then the crimes and etc. system takes care of holding them as enemy).