Why does all my waves spawn at the same time?

Babybro

New Member
Reaction score
0
Why does this not work? All my three waves spawns at the same time... What's wrong?

(Updated)
Trigger:
  • Create Units
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • (Player 12 (Brown) Food cap) Less than 1
    • Actions
      • Wait 15.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Level Equal to 1
        • Then - Actions
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
          • Game - Display to (All players) the text: You are now on leve...
          • Set Level = (Level + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Level Equal to 2
            • Then - Actions
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
              • Game - Display to (All players) the text: You are now on leve...
              • Set Level = (Level + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Level Equal to 3
                • Then - Actions
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
                  • Game - Display to (All players) the text: You are now on leve...
                  • Set Level = (Level + 1)
                • Else - Actions
 

Shura

New Member
Reaction score
45
Trigger:
  • Then - Actions
    • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
    • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
    • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees

Is this the three waves? There's no waits or anything that would cause these to spawn it different times.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Why the %#@@ would you have a periodic event 0.1, and then still WAIT 15 SECONDS ?!

That's just silly XD

Why not just use a periodi event of 15 seconds ? :eek:

And also, instead of all those if's, just do this:
Trigger:
  • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
    • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
    • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
    • Game - Display to (All players) the text: You are now on leve...
    • Set Level = (Level + 1)


And, btw that triggers leaks...
Here's a tutorial on how to remove them:
http://www.thehelper.net/forums/showthread.php?t=27219
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Trigger:
  • (Player 11 (Dark Green) Food cap) Less than 1

Could have something to do with the fact that you are spawning units for Brown, but checking Dark Green's food used.

Also, you should turn off the trigger at the start, and turn it back on after you've spawned at least one unit. That way, your trigger doesn't fire 3 times before even one unit is created.
 

Babybro

New Member
Reaction score
0
I meant that level 1, 2 and 3 spawn at the same time, 3 sorts of units at the same time... Not that it spawns on 3 places, it spawns 3 sorts on all 3 places, all 3 levels.

Thanks Darthfett, it was one thing, but still not working, same problem.
 

Rushhour

New Member
Reaction score
46
I also think that the problem is the low period you check it. If it only takes 0.1 second to create the first unit you will have your problem. Also check if the units really need food.
And at last, try out the event "player X food becomes equal to zero" that should do the same thing as you spawn all units at the same time.
Edit: And again I'm not sure about the food stuff, is "food cap" correct in the English version for food used by units?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Why not just listen to my suggestion 4 posts up ?! :eek:

That should fix you problem, as there's no way it'll create 135 units instead of 45 ;)
 

Darkness47

New Member
Reaction score
3
As is Komaqtion saying it, the problem is simple: the first 3 launches of the trigger are at: Elapsed game time: 0.10 seconds, 0.20 seconds and 0.30 seconds.

at 15.10 elapsed game time seconds:
The first launch does the first if's actions, including:

Trigger:
  • Set Level = (Level + 1)


So now, Level = 2, we are still at 15.10 sec.

at 15.20 elapsed game time seconds:
The second launch does the second if's actions as Level = 2 now, including:

Trigger:
  • Set Level = (Level + 1)


So now, Level = 3

at 15.30 elapsed game time seconds:
the third launch does the third if's actions as Level = 3 now.

Conclusion: over 0.20 seconds, the 3 waves spawn.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Thanks Darthfett, it was one thing, but still not working, same problem.

Did you take my suggestion to turn off and then on the trigger? It should look like this:

Trigger:
  • Create Units
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • (Player 12 (Brown) Food cap) Less than 1
    • Actions
      • Trigger - Turn off (This trigger)
      • Wait 15.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Level Equal to 1
        • Then - Actions
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
          • Unit - Create 15 UnitType[1] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
          • Trigger - Turn on (This trigger)
          • Game - Display to (All players) the text: You are now on leve...
          • Set Level = (Level + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Level Equal to 2
            • Then - Actions
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
              • Unit - Create 15 UnitType[2] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
              • Trigger - Turn on (This trigger)
              • Game - Display to (All players) the text: You are now on leve...
              • Set Level = (Level + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Level Equal to 3
                • Then - Actions
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
                  • Unit - Create 15 UnitType[3] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
                  • Trigger - Turn on (This trigger)
                  • Game - Display to (All players) the text: You are now on leve...
                  • Set Level = (Level + 1)
                • Else - Actions


Why not just listen to my suggestion 4 posts up ?!

I'm assuming you are talking about this suggestion:

Why not just use a periodi event of 15 seconds

But that will cause problems in that if the last unit dies .2 seconds before the periodic event fires, it will start the next round that quickly. This will make his game very non-static, and be very inconsistent if the players have .2 seconds to build one round, and 15 seconds to build in the next.

I also think that the problem is the low period you check it. If it only takes 0.1 second to create the first unit you will have your problem.

The CreateUnits___ function will create units instantly.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just one question here:
Why is the condition like this ?
Code:
(Player 12 (Brown) Food [COLOR="Red"]cap[/COLOR]) Less than 1

Shouldn't it be "Food used" ? :eek:
Since the food cap will only change if you build, like farms and such...

Here's a version which might suit your needs correctly...
Trigger:
  • Start to Spawn
    • Events
      • Player - Player 12 (Brown)'s Food used becomes Less than or equal to 1.00
    • Conditions
    • Actions
      • Countdown Timer - Start Spawn_Timer as a One-shot timer that will expire in 15.00 seconds
      • Trigger - Turn on Spawn Spawns <gen>
      • Trigger - Turn off (This trigger)


Trigger:
  • Spawn Spawns
    • Events
      • Time - Spawn_Timer expires
    • Conditions
    • Actions
      • Set Level = (Level + 1)
      • Set TempPoint = (Center of Left spawn <gen>)
      • Unit - Create 1 UnitType[Level] for Player 12 (Brown) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempPoint = (Center of Middle spawn <gen>)
      • Unit - Create 1 UnitType[Level] for Player 12 (Brown) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempPoint = (Center of Right spawn <gen>)
      • Unit - Create 1 UnitType[Level] for Player 12 (Brown) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on Start to Spawn <gen>
      • Trigger - Turn off (This trigger)
 

Babybro

New Member
Reaction score
0
Did you not want me to change the time, or could you explain better? I think i didn't understood you...

And haven't player 12 browns food changed to higher than 1 at 15:10? So the units won't spawn?

I have also tried to turn off and turn on trigger with another one...
 

Shura

New Member
Reaction score
45
What's wrong with doing what Komaqtion suggested?
Trigger:
  • trigger
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
      • (Player 12 (Brown) Food cap) Less than 1
    • Actions
      • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Left spawn <gen>) facing Default building facing degrees
      • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Middle spawn <gen>) facing Default building facing degrees
      • Unit - Create 15 UnitType[Level] for Player 12 (Brown) at (Center of Right spawn <gen>) facing Default building facing degrees
      • Game - Display to (All players) the text: You are now on leve...
      • Set Level = (Level + 1)
 

Babybro

New Member
Reaction score
0
If the units dies when the periodic event is on 14:90 will the units spawn at once, and i want some time between that...
 

Shura

New Member
Reaction score
45
Well you can adjust that, but using Level as the array number for your unit-type array is still more efficient than what you were doing.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I just posted a perfectly good trigger(s) a couple of posts ago !!!

Why doesn't anyone see my posts anymore ?! :(
 

Darkness47

New Member
Reaction score
3
Did you not want me to change the time, or could you explain better? I think i didn't understood you...

And haven't player 12 browns food changed to higher than 1 at 15:10? So the units won't spawn?

I have also tried to turn off and turn on trigger with another one...

It has changed at 15:10, but the condition was right at 0.20 when the second launch has fired, u should try to put that condition into a if that you would check in first:

Trigger:
  • Create Units
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) Food cap) Less than 1
        • Then - Actions
          • If - Conditions
            • Level Equal to 1
          • Then - Actions
            • ....
 

Babybro

New Member
Reaction score
0
Well you can adjust that, but using Level as the array number for your unit-type array is still more efficient than what you were doing.

What do you mean? Could you explain better?

And i don't ignore your post, but i want to do it on this way... I can maybe try your and look at it, but i don't know what the custom scripts does and you will need to tell me then.

Btw are you sure that it is "food cap" ? Because if i change the periodic time does the time between the waves take longer time, it seems like food cap is always 1 or lower... So what should it be?
 

Babybro

New Member
Reaction score
0
It has changed at 15:10, but the condition was right at 0.20 when the second launch has fired, u should try to put that condition into a if that you would check in first:

Trigger:
  • Create Units
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) Food cap) Less than 1
        • Then - Actions
          • If - Conditions
            • Level Equal to 1
          • Then - Actions
            • ....

Tried this, but still now working...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top