Trigger repeating every turn

Moderators: The Artistocrats, Order of Battle Moderators

Post Reply
koopanique
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 87
Joined: Sat Dec 31, 2016 8:41 pm

Trigger repeating every turn

Post by koopanique » Sun Jun 16, 2019 9:50 pm

Hi,

I'm working on a scenario USA vs Germany, where both sides are granted 2 random units everyday. I think this would make for interesting situation where the player has to make do with what they have at hand.

To achieve the spawning of the 2 random units per turn, I have a trigger folder for each side, and inside, a multitude of triggers that deploy every unit I want to be possibly deployed. For both USA and Germany, there's a trigger outside of the trigger folders, which condition is "Check if Turn < 99", and which effect is set to "Random Trigger", with parameter set to "folder: <name of USA or GE trigger folder>", so I assume it triggers a random trigger inside the trigger folder, and does so every turn as long as turn count is below 99.

The issue is that when I launch the scenario, the game immediately spawns all units for each side on the first turn, then does not spawn anything on the later turns. What I'd like is for the game to trigger only 2 triggers from the trigger folder, once per turn.

Do you have any idea how I could achieve this using the editor?

Thanks!

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Sun Jun 16, 2019 10:47 pm

I'll take a look at it if you post some screenshots. Meanwhile, I'm wondering if this arrangement might do the trick; greatly simplified for demonstration - only 5 spawn sets per side - but they will repeat so you don't really need 99 separate spawn triggers; just enough to include every unit that you wish to include):

Screenshot 9.jpg
Screenshot 9.jpg (222.63 KiB) Viewed 458 times
Screenshot 10.jpg
Screenshot 10.jpg (227.84 KiB) Viewed 458 times
- Bru

koopanique
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 87
Joined: Sat Dec 31, 2016 8:41 pm

Re: Trigger repeating every turn

Post by koopanique » Mon Jun 17, 2019 7:31 pm

@bru888 Thanks a lot for the detailed response!

I think that would indeed do the trick. I can't wait to test it. I think I misunderstood the "amount" parameters. I thought it would choose 2 triggers at random in the folder, but it actually choses 2 between all the triggers or folders listed.

JB72
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Wed May 22, 2019 12:22 am

Re: Trigger repeating every turn

Post by JB72 » Mon Jun 17, 2019 8:02 pm

1. Which does "amount 2" mean ?

2. All spawned units come at random then ?

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Tue Jun 18, 2019 12:08 am

JB72 wrote:
Mon Jun 17, 2019 8:02 pm
1. Which does "amount 2" mean ?

2. All spawned units come at random then ?
If, IF it works as intended (which I think it does; I'm just being facetious), the "2" means it will pick two of the triggers in the list to fire and spawn the units indicated in those triggers. Usually a random trigger is used for only one choice from a list, hence amount "1," but I am reasonably sure that increasing this amount means correspondingly more triggers in the list will be selected to fire each time.

As far as "All spawned units come at random then ?", I'm not sure what you mean. Not all spawned units will immediately come; just two per side each turn in this set up and yes, randomly each time. I believe that is what koopanique intended.
- Bru

koopanique
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 87
Joined: Sat Dec 31, 2016 8:41 pm

Re: Trigger repeating every turn

Post by koopanique » Fri Jun 28, 2019 9:35 am

Hi,
After testing your method bru888, alas it still doesn't work as I would like, although there's some interesting change.
With the triggers set the way you suggested, when I move a spawned unit, another unit is created immediately (as if it waited for my unit to move before it spawned), even before I confirm the move order. And I can immediately move this new unit Meaning I can deploy an endless stream of units! Not applicable for any serious scenario, but interesting glitch :mrgreen:

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Fri Jun 28, 2019 1:13 pm

This is an interesting problem and a learning opportunity.
- Bru

terminator
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2994
Joined: Mon Aug 15, 2011 12:48 pm

Re: Trigger repeating every turn

Post by terminator » Fri Jun 28, 2019 1:36 pm

I think it’s because you’ve put -1 everywhere, once a trigger has been activated, it repeats itself to infinity (?)

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Fri Jun 28, 2019 1:57 pm

terminator wrote:
Fri Jun 28, 2019 1:36 pm
I think it’s because you’ve put -1 everywhere, once a trigger has been activated, it repeats itself to infinity (?)
Yes, that's it! koopanique, try this: With each of those spawn triggers marked "-1" include an effect that turns that same trigger off again. You do want them to repeat whenever each is chosen by the random trigger, but you don't want them to keep on repeating by themselves.
- Bru

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1612
Joined: Mon Feb 18, 2013 1:22 pm

Re: Trigger repeating every turn

Post by Horst » Fri Jun 28, 2019 1:57 pm

"Triggers" checked box on upper-left should rather only read "1" to activate only once for spawn triggers. If you only want to spawn something in a specific turn then most likely only once, right? Otherwise, you better clone these triggers and change the "Check Turn" of each of them.
"Trigger Event" should preferable read "Turn Start".
"Conditions" should include "Check Turn" including pressing an alliance button, otherwise it triggers on all alliances this turn.
"Random Trigger" effect should normally only include "amount = 1" for one spawn. If you want to spawn several units at once, you better include this in each spawn-trigger. No idea how complicated you want it.

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Fri Jun 28, 2019 2:00 pm

That will work if he plans out all 99 turns but I was trying to save him some work. koopanique, first try my suggestion with your existing arrangement as I mentioned above. If that still doesn't work, then lay it out using Horst's recommendations.
- Bru

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1612
Joined: Mon Feb 18, 2013 1:22 pm

Re: Trigger repeating every turn

Post by Horst » Fri Jun 28, 2019 2:29 pm

Oh wait, there is easily another oversight with the spawn triggers. I tend to use such infinite triggers with my random weather system:
You have to include "Set Trigger State" in the effects that unchecks the spawn-trigger again. Otherwise, each activated spawn-trigger will fire on the next turn again even without "Random Trigger" effect.

Here is an example of an infinite random trigger that randomizes weather in a scenario each turn:
Weather Dice 1.jpg
Weather Dice 1.jpg (343.78 KiB) Viewed 317 times
Weather Dice 2.jpg
Weather Dice 2.jpg (333.33 KiB) Viewed 317 times

Horst
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1612
Joined: Mon Feb 18, 2013 1:22 pm

Re: Trigger repeating every turn

Post by Horst » Fri Jun 28, 2019 2:40 pm

Sorry, I don't dare to edit my post above due forum attachment bug.

The problem with these infinite triggers is that they won't be normally unchecked anymore if you once enable them with the "Random Trigger" effect. That's why you have to disable them afterwards each time you let them fire.

bru888
Order of Battle Moderator
Order of Battle Moderator
Posts: 3384
Joined: Sun Jan 10, 2016 5:39 pm

Re: Trigger repeating every turn

Post by bru888 » Fri Jun 28, 2019 3:21 pm

Horst wrote:
Fri Jun 28, 2019 2:40 pm
The problem with these infinite triggers is that they won't be normally unchecked anymore if you once enable them with the "Random Trigger" effect. That's why you have to disable them afterwards each time you let them fire.
Yes, I think we are in agreement on that. koopanique, this is what we are talking about:

Screenshot 0.jpg
Screenshot 0.jpg (204.64 KiB) Viewed 310 times

On each and every spawn trigger, include an Effect that turns the same switch off again until it is reactivated.
- Bru

Post Reply

Return to “Order of Battle : World War II - Scenario Design”