Trigger to Start a new wave for tower defense

Entaiden

New Member
Reaction score
0
I'm trying to make a tower defense, and have everything working, but when i type -start a 2nd time, -start command keeps triggering the first wave of units to come out over and over.

How do i make it so i type -start it will now spawn the 2nd wave?
 

BRUTAL

I'm working
Reaction score
118
Why are you triggering the waves with a player chat event? Or is that just how you want it to be?
Post your triggers so I can try telling you what's wrong.
 

Entaiden

New Member
Reaction score
0
I wanted it to be like legion TD where you can type -start to begin the next wave, but i've changed it to when Enemy runs out of food.

New problem though, I have 3 waves of units to send out, and upon killing wave 1, it will send out wave 2+3 at the same time instead of wave 2, dead, wave 3.

j7QnTwI.png


This works fine, however

WxSW898.png
 

Entaiden

New Member
Reaction score
0
"Round 2" is the same as "Round 3" except with a different unit, problem is they both spawn under the same event, and i don't know the proper condition (first time doing this)
 

Entaiden

New Member
Reaction score
0
Any ideas? just want the Next wave trigger to apply to a certain wave and not every wave, cant balance the game without proper waves
 

BRUTAL

I'm working
Reaction score
118
Hey, I'm back.
As for your issue with wave 2 and 3 beginning at the same time, it is due to not having proper conditions to separate the two waves.
Here's a template for detecting the end of a wave, and how to start the next wave.

8zpb93.jpg

You should be using an integer variable to keep track of the rounds, and then use that variable accordingly.
 

Entaiden

New Member
Reaction score
0
Actually, problem, i copied your setup and after the intial 30 second setup wait, Footman spawn, then it instantly says wave cleared. It seems to be ignoring the "Event: Player Brown food equal to zero" Part.

sl4hQsr.png


pptfAIV.png


fYR50Pj.png


There was a part in the first picture which told it to run "New Round" but its taken out in the picture, right now after footman nothing happens when they die
 

BRUTAL

I'm working
Reaction score
118
Yea my fault, I should have made it include wave 1, I hopeful that there wouldn't be an conflicts.
The spawn trigger needs to be changed so it includes the first wave, and then you'll just have to run it from the initialization trigger instead of directly spawning the units in that trigger.
I'll post the fix in minute.
rc0g0p.jpg

Also I noticed in the spawn wave trigger, you were making it run the trigger that detects the end of the wave. That part wasn't necessary, and would cause issues if you left it in.
Edit: Oh wait, that was the problem you were describing. :p The wave-ended detection trigger will execute once brown's food becomes 0, so by running this trigger within the spawn wave trigger, you were making it execute early, in a sense.

This is up to you, but you can simplify the game message part by using variables like in my example. This way you don't need to make messages that are displayed only when Round is equal to a specific wave.
Also, if you store each wave's unit type in a variable and set the values in the initialization trigger, it would be easier to display the type of unit each round, as per my example.
 

BRUTAL

I'm working
Reaction score
118
I'm assuming you know how to use the Variables part of the trigger editor.
Well just open the variables window, and then create a new variable.
From the variable type drop box, scroll all the way and you will see Unit Type.
Also you'll have to give the variable an array, so check off the box which has "array" to the right.
After you've named it and finished creating the variable, you just set the variable (add a new action, then press the 's' key to access it quickly, then from there select the variable, and then you'll have to set the index since it has an array and then repeat this for each wave/unit type).
 

Entaiden

New Member
Reaction score
0
Copied everything and its still having the same problem of Not doing anything after wave 1

Q95sdOn.png


P41ZPPZ.png


Vo56Bop.png


Sorry for the blue lines, snipping tool fail
 

BRUTAL

I'm working
Reaction score
118
Look the event you have in Wave Ends.
Max food refers to how much food you have available to provide for units.
Food refers to how much of the max food is currently used.
Max food usually is initially 0, and will only increase when you build something like a farm, or moon well.
It won't trigger because brown will never have max food equal 1 (or anything other than 0).
It needs to be like this.
Trigger:
  • Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
 

Entaiden

New Member
Reaction score
0
Sorry, those pictures were after i messed around with that setting, i changed to Food used becomes equal to zero, still no effect after first wave :/
 

BRUTAL

I'm working
Reaction score
118
I'm thinking you have some kind of pre-placed unit for brown (player 12).
Is there anything that you can think of that would cause brown to have food from units other than what you spawn?
Perhaps try temporarily changing the spawned units to Neutral Hostile, and then change the event to detect when Neutral Hostile's food becomes 0, and see if that changes anything.
I'll look over the triggers again to make sure it's nothing on my end.

Edit: Yea, i just tested my triggers in game and everything is working as intended.
The latest triggers you posted (excluding that one event problem from earlier) are all as they should be, so I believe brown has food from something, and and causes the detection system to break.
 

Entaiden

New Member
Reaction score
0
Derp, i changed Footmans food output to zero in the object editor, it all works. thanks ^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top