Complicated Trigger Issue


I have two different levels of Unrest that I need to track for a “Province” piece. I have a property defining the Owners unrest as well as a property defining the Occupiers unrest (if Occupied).

What I’d like is a single hotkey (like Shift+X) that will change it’s behavior depending on a third parameter (is the province occupied or not?).

So for example: Province Owner is Red and province is not currently occupied. In this situation, I’d like Shift+X to change the Province_Owner_Unrest property.

Then, later on the province gets occupied by Blue Player. Now I’d like the Shift+X key command to change the Province_Occupier_Unrest property instead.

Is there any easy way to do this? Or is it going to require a complicated trigger tree with a temporary property that tells if the province is in unrest or not?

I think I figured it out. I created a Dynamic Property (is_occupied) which is just a boolean (0 or 1) with a single command (is_occupied_check) that uses a Ternary expression to set the dynamic property based on the current Occupation status. Then I have a START trigger which is where the Shift+X command is, and this trigger simply runs the is_occupied_check and THEN runs two other triggers. They both check the dynamic property. One triggers if it is true, the other if it is false.

This avoids the issue of having 1 trigger check to see if the actual occupation property is “yes”, so it toggles, followed by another trigger which checks the actual occupation property for “No” (which it now will be, because the previous trigger already toggled) and thus, the second trigger always toggles back to Yes. Farming out the occupation status to a separate and special ‘check’ property allows me to run through the two triggers without accidentally undoing what the first trigger did (because eh check property is only updated at the start of the trigger).