I've been modding on and off for quite a while now but i've never sat down to properly figure out what the limitations are with flags that can bear parameters. With that in mind, ive got some questions and a simple example:
This sequence of events should play out like this:
bonus questions:
so lets say we have Alpha centauri, one of Humanity's [id:69] worlds. we set a planet flag on it : set_planet_flag = mod_rightful_owner_is_@owner (planet scope event)
Now lets say the evil blorg [id:420] come along, they annex alpha centauri and run a trigger to test an event on their annexation.
If I say "trigger = { owner = { NOT = { has_planet_flag = mod_rightful_owner_is_@root } } }"
and if I then, under the blorg also run a script and do "set_planet_flag = mod_rightful_owner_is_@owner"
This sequence of events should play out like this:
- planet colonised by humanity
- on_colonisation event runs and : set planet_flag mod_rightful_owner_is_69
- planet annexed by blorg
- on conquest event runs and test if planet_flag mod_rightful_owner_is_420 =/= planet_flag mod_rightful_owner_is_69
- trigger succeeds
- set planet_flag mod_rightful_owner_is_420
- (whilst replacing mod_rightful_owner_is_69)
bonus questions:
- @ flags can only be used to test in a boolean fashion right? (either flagname@countryid is the same as some other id or not) there is no way to pull the country in to scope, by referencing the @value from a flag, or compare how different the two @values are (if using say myflag@arbitrary_numbers - yes variables would be better in this instance)
- the is_same_value trigger only works with pure scopes (prev event_target:whatever etc) and cant be used to compare the @countryid of flags?
- slight tangent but as it's technically an @ flag, why not: can you compare the "current" date to @date flags?
- is there any way to test if " current_game_date@date(now) = my_saved_game_date@date(from the past)"? to track how long ago something occurred (i know it can be parsed in to locs in absolute terms, but I'm hunting for a MTTH or day-value here, something like excel's DAYS would be good) I'd rather not resort to building my own script clock out of variables if I can use this.
-
Last edited: