There is a trigger that detects when the timer ends, when the timer does end, it turns on that trigger. Any ideas as to why it spawns twice? By the way, here are the mechanics, it's meant to spawn twenty (20) units, on non-boss waves, but on boss waves it spawns two, but it works for all the other waves.
Since this trigger is called "Boss Waves", I'm going to assume you have another one that handles your regular enemy waves. In which case, this is a simple logic problem, fortunately.
You start by comparing your spawn count to how many players are in the players' team multiplied by 20 (why?). Let's just call that amount of players "x". So essentially if spawn count <= 20x you do your spawning thing. I'm guessing spawn count starts at 0 so it goes through your condition.
Then, you add to your spawn count that exact same value you were comapring it with, so it becomes 20x as well. And then monsters are spawned. Everything is well and your trigger runs again 1.5 sec later. The first condition is run again and this time you check if your spawn count (now worth 20x) is <= 20x. Which it is! And thus a 2nd set of monsters is spawned. Your spawn count variable is incremented to 40x and won't go through your comparison next time the trigger runs.
Now I don't know the mechanics of your map but if the only thing this trigger is meant to do is spawn 1 boss monster for each player, then you can do away with the periodic check and spawn count. Instead, just shrink your trigger to the basics and use a "run trigger (check conditions)" action instead of turning it on/off.
A simple trigger like this should be all you need.
And so I see. Thanks for the detailed explanation, I can't believe I didn't see how since my integer is equal to "20" already, it will run again due to the fact that the comparison I used is "<="
I see the "run trigger" function, yes I wonder why I never thought of using that, might as well just run it every wave. Thanks very much!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
There is a trigger that detects when the timer ends, when the timer does end, it turns on that trigger. Any ideas as to why it spawns twice? By the way, here are the mechanics, it's meant to spawn twenty (20) units, on non-boss waves, but on boss waves it spawns two, but it works for all the other waves.
Since this trigger is called "Boss Waves", I'm going to assume you have another one that handles your regular enemy waves. In which case, this is a simple logic problem, fortunately.
You start by comparing your spawn count to how many players are in the players' team multiplied by 20 (why?). Let's just call that amount of players "x". So essentially if spawn count <= 20x you do your spawning thing. I'm guessing spawn count starts at 0 so it goes through your condition.
Then, you add to your spawn count that exact same value you were comapring it with, so it becomes 20x as well. And then monsters are spawned. Everything is well and your trigger runs again 1.5 sec later. The first condition is run again and this time you check if your spawn count (now worth 20x) is <= 20x. Which it is! And thus a 2nd set of monsters is spawned. Your spawn count variable is incremented to 40x and won't go through your comparison next time the trigger runs.
Now I don't know the mechanics of your map but if the only thing this trigger is meant to do is spawn 1 boss monster for each player, then you can do away with the periodic check and spawn count. Instead, just shrink your trigger to the basics and use a "run trigger (check conditions)" action instead of turning it on/off.
A simple trigger like this should be all you need.
If any of my assessments were wrong, you may want something different however.
And so I see. Thanks for the detailed explanation, I can't believe I didn't see how since my integer is equal to "20" already, it will run again due to the fact that the comparison I used is "<="
I see the "run trigger" function, yes I wonder why I never thought of using that, might as well just run it every wave. Thanks very much!