Add events for when forces set friends/cease-fires
Posted: Wed Aug 21, 2019 4:51 am
Hi, I'm just getting into modding, and the API seems to be lacking events for when a force sets a new friend/cease-fire. Something like on_force_cease_fire_changed, on_force_friend_changed, maybe?
In my mod, I am trying to create and manage 'sub-forces' that have mutual friend and cease-fire with the player force (I create them just as regular forces but with a name like 'player.subforce'). I'd like to be able to keep the friend/cease-fire lists of the sub-forces 'in sync' with the main force lists. For example, if a different mod creates a new force 'foobar' and configures it to have a cease-fire with 'player', I'd like to be able to listen for the cease-fire event so I can set up a cease-fire between 'foobar' and my sub-forces as well. Otherwise, entities in the 'foobar' force might attack entities in my sub-forces, which is not the desired behavior
In my mod, I am trying to create and manage 'sub-forces' that have mutual friend and cease-fire with the player force (I create them just as regular forces but with a name like 'player.subforce'). I'd like to be able to keep the friend/cease-fire lists of the sub-forces 'in sync' with the main force lists. For example, if a different mod creates a new force 'foobar' and configures it to have a cease-fire with 'player', I'd like to be able to listen for the cease-fire event so I can set up a cease-fire between 'foobar' and my sub-forces as well. Otherwise, entities in the 'foobar' force might attack entities in my sub-forces, which is not the desired behavior