Page 1 of 1
Delaying an action in a script
Posted: Wed Jan 24, 2018 6:04 am
by captainjack
It's easy to set a trigger (Eg capture Paris) and have an action (eg a unit appears).
Is there a simple way of delaying the action (eg a unit appears two or three turns later)?
I have a way of deferring an action until a unit has spent two or three turns in a specific location which I can adapt to create a delay but this is long winded and it's hard to believe there isn't a simpler way.
Re: Delaying an action in a script
Posted: Thu Jan 25, 2018 4:14 am
by huckc
It's a bit hacky and I haven't tested it but using 'counter' tags might work:
If Allied flags in Paris equals 1 then add tag "Paris1"
If Allied flags in Paris equals 1 AND Tag exists "Paris1" then add tag "Paris2"
If Allied flags in Paris equals 1 AND Tag exists "Paris2" then add tag "Paris3"
If tag exists "Paris3" then [reward]
e:
Skip Count, not the above
Re: Delaying an action in a script
Posted: Thu Jan 25, 2018 10:06 pm
by captainjack
Thanks for that.
It looks like a good solution.
Re: Delaying an action in a script
Posted: Thu Jan 25, 2018 10:17 pm
by huckc
I decided to test it as I was making a few too many assumptions about the way the game scans the scripts. It worked.
Had a unit trigger when the "Paris2" tag exists and it indeed showed up after two turns of taking zone 32.
Re: Delaying an action in a script
Posted: Thu Jan 25, 2018 10:41 pm
by huckc
Actually I just noticed the "Skip Count" box that seems to accomplish the same as the above but only one script line so much better:

Re: Delaying an action in a script
Posted: Fri Jan 26, 2018 4:49 am
by captainjack
Thanks.
I'd been stuck for a while and this will help motivate me to have another go.