Trigger repeating every turn
Moderators: Order of Battle Moderators, The Artistocrats
-
- Administrative Corporal - SdKfz 251/1
- Posts: 133
- Joined: Sat Dec 31, 2016 8:41 pm
Trigger repeating every turn
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!
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!
-
- Order of Battle Moderator
- Posts: 6188
- Joined: Sun Jan 10, 2016 5:39 pm
- Location: United States
Re: Trigger repeating every turn
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):
- Bru
-
- Administrative Corporal - SdKfz 251/1
- Posts: 133
- Joined: Sat Dec 31, 2016 8:41 pm
Re: Trigger repeating every turn
@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.
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.
Re: Trigger repeating every turn
1. Which does "amount 2" mean ?
2. All spawned units come at random then ?
2. All spawned units come at random then ?
-
- Order of Battle Moderator
- Posts: 6188
- Joined: Sun Jan 10, 2016 5:39 pm
- Location: United States
Re: Trigger repeating every turn
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
-
- Administrative Corporal - SdKfz 251/1
- Posts: 133
- Joined: Sat Dec 31, 2016 8:41 pm
Re: Trigger repeating every turn
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
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
-
- Field Marshal - Elefant
- Posts: 5869
- Joined: Mon Aug 15, 2011 12:48 pm
- Location: the land of freedom
Re: Trigger repeating every turn
I think it’s because you’ve put -1 everywhere, once a trigger has been activated, it repeats itself to infinity (?)
-
- Order of Battle Moderator
- Posts: 6188
- Joined: Sun Jan 10, 2016 5:39 pm
- Location: United States
Re: Trigger repeating every turn
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.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 (?)
- Bru
Re: Trigger repeating every turn
"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.
"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.
-
- Order of Battle Moderator
- Posts: 6188
- Joined: Sun Jan 10, 2016 5:39 pm
- Location: United States
Re: Trigger repeating every turn
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
Re: Trigger repeating every turn
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:
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:
Re: Trigger repeating every turn
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.
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.
-
- Order of Battle Moderator
- Posts: 6188
- Joined: Sun Jan 10, 2016 5:39 pm
- Location: United States
Re: Trigger repeating every turn
Yes, I think we are in agreement on that. koopanique, this is what we are talking about:
On each and every spawn trigger, include an Effect that turns the same switch off again until it is reactivated.
- Bru