TD spawns...

Vamtiin

New Member
Reaction score
1
I am working on a TD, a bit ordinary one.

The triggers just ignore what I do... Can someone look at this and tell me what is wrong? The second and third wave comes 10 seconds after the first - thats really wrong.

The basic idéa is as following:
When the unit "Magnus Söderman" enters region "Next Wave" Player 4 (Creep player) gets +1 gold (He has 0 from the beginning) and then trigger the waves to come. Magnus Söderman is trained from a building nearby the region he is supposed to go to.

Magnus Söderman:
Code:
 Event - Time every 0.10 seconds of the game
Actions - Order random unit from (units of type Magnus Söderman)) To move to (Center of Next Wave <gen>)

Magnus Söderman 2:
Code:
 Event - Unit - A unit enters Hets Mot Folkgrupp Huset <gen>
Conditions - (Unit-type of (Triggering unit)) Equal to Magnus Söderman
Actions -Trigger - Turn on this trigger
Unit - Change ownership of (Random unit from (Units of type Magnus Söderman)) to Neutral Passive and Change color
Unit - Order triggering unit to Move to (Center of Next Wave <gen>

Magnus Söderman Explode
Code:
Event - Unit enter Next Wave
Condition (Unit-type of (Triggering unit)) Equal to Magnus Söderman)
Actions - Trigger - Turn on this Trigger
Wait 0.5 seconds
Unit - Explode (Entering unit)
Player - add 1 to player 4 (purple) Current gold

Wave 1
Code:
 Events - Player - Player 4 (Purple)´s Current Gold becomes Equal to 1.00
Unit - A unit enters Next Wave <gen>
Condition (Unit-type of (Triggering unit)) Equal to Magnus Söderman)
Actions - Trigger - Turn on This trigger
Quest - Display to all players the Warning message ****
Unit - Create 12 Mutated Chickens for Player 4 (Purple) at (Center of spawn 1 <gen>) Facing Default building facing degrees
Unit - Create 12 Mutated Chickens for Player 4 (Purple) at (Center of spawn 2 <gen>) Facing Default building facing degrees
Trigger - Turn off (This Trigger)

Wave 2
Code:
Events - Player - Player 4 (Purple)´s Current Gold becomes Equal to 2.00
Unit - A unit enters Next Wave <gen>
Condition (Unit-type of (Triggering unit)) Equal to Magnus Söderman)
Actions - Trigger - Turn on This trigger
Player - Add 40 gold to player 1 (Red) Current Gold
Player - Add 40 gold to player 2 (Blue) Current Gold
Player - Add 40 gold to player 3 (Teal) Current Gold
Wait 10.00 Seconds
Quest - Display to all players the Warning message ****
Unit - Create 12 Tarantula for Player 4 (Purple) at (Center of spawn 1 <gen>) Facing Default building facing degrees
Unit - Create 12 Tarantula for Player 4 (Purple) at (Center of spawn 2 <gen>) Facing Default building facing degrees
Trigger - Turn off (This Trigger)

Wave 3
Code:
Events - Player - Player 4 (Purple)´s Current Gold becomes Equal to 3.00
Unit - A unit enters Next Wave <gen>
Condition (Unit-type of (Triggering unit)) Equal to Magnus Söderman)
Actions - Trigger - Turn on This trigger
Player - Add 40 gold to player 1 (Red) Current Gold
Player - Add 40 gold to player 2 (Blue) Current Gold
Player - Add 40 gold to player 3 (Teal) Current Gold
Wait 10.00 Seconds
Quest - Display to all players the Warning message ****
Unit - Create 13 Angry Blizzard Employee for Player 4 (Purple) at (Center of spawn 1 <gen>) Facing Default building facing degrees
Unit - Create 13 Angry Blizzard Employee for Player 4 (Purple) at (Center of spawn 2 <gen>) Facing Default building facing degrees
Trigger - Turn off (This Trigger)
 

saw792

Is known to say things. That is all.
Reaction score
280
Enable all your triggers and remove the 'Trigger - Turn on This Trigger' action. It won't run the actions if the trigger is off, so it won't register the event and then turn it on. You need to have them initially on.
 
D

DsD)Core(

Guest
The fact that your second and third wave come right after the first, indicate a little flaw in the way your gold is added. I think your magnus guy triggers the +1 gold multiple times and therefore instantly triggers all waves to come at the same time.

Try working with a timer, to prevent a bug of too much gold added.

I don't have warcraft 3 right here, so I will try to make it look as closely as possible:

Event - Unit enter Next Wave
Condition (Unit-type of (Triggering unit)) Equal to Magnus Söderman)
WaveDelay (boolean) Equal to False
Wait 0.5 seconds
Unit - Explode (Entering unit)
Player - add 1 to player 4 (purple) Current gold
Set WaveDelay to True
Wait 11 seconds
Set WaveDelay to False

This, assuming a wave is absolutely supposed to take more than 10 seconds, will probably prevent an instant addition of more than 1 gold, and might just fix your problem. There's probably a more efficient way to rework your trigger and prevent the problem in the first place, but I'm pretty sure this would work.

GL

EDIT: and saw792 is right, just remove the turn off and turn on triggers. They're not doing anything in your situation. You can even make a seperate boolean for every single wave that it will only trigger if it is false and the wave sets it to true, preventing the same wave to come twice. But if your variables for wave triggering are correct, that shouldn't even happen.

EDIT2: and also, it might not be relevant but I highly suggest working with an integer variable instead of gold to trigger your waves. This gives you a guarantee that any bounty or whatever cannot cause any bugs, and gives you more control of what your triggers are doing. But it's not necessary.
 

Vamtiin

New Member
Reaction score
1
Hmm... It dosent work anyway :confused:
The second and third wave still comes 10 seconds after the first wave...
 

Vamtiin

New Member
Reaction score
1
*Post at the same time*

@ DsD)Core(
What do you mean with WaveDelay (boolean) Equal to False?

Btw, I am very (very !) bad at using variables and such things... Does such things mean much in a TD ?
 
D

DsD)Core(

Guest
Ah, well I can tell variables are quite important in nearly any kind of map.

Basically, you'll add the condition like I said, and then (I can't check my world editor here, I'm saying this out of my head) you do a boolean comparison.

You add a variable, let's call it WaveDelay since that would kinda suit it's function, and make it a boolean. You set the comparison to False, and then the +gold will only trigger if it is false.

Then in the action you set the variable, the WaveDelay to true. You wait a few seconds, then set it to false again. This way, you will exclude a bug that might trigger your +gold like 10 times in one second since you use a 0.1 second repeating event.

It will wait a few seconds before the next gold can be added at all, and that's when your unit will be already exploded for sure (I do suggest removing the unit aswell, I'm not too sure about the solidness of exploding).

And that should fix your problem. Because I'm rather sure your +1 gold event is triggered multiple times.

EDIT: If you're bad at using variables, I guess that's not much of a problem - they do tend to look scary if you haven't used them before. Once you used them a few times and know how to use them properly, they're a blessing. They do make things easier in any map. Trust me, making a TD would be nearly impossible without any variables ;)
 

Vamtiin

New Member
Reaction score
1
Hmm... Well, its me and a friend of mine that is working on this map so we looked at in over LAN - and the creep player recives only 1 g... But I´ll look into it.
 
D

DsD)Core(

Guest
In that case, you might want to work with an integer variable instead of gold. If your magnus guy enters the region, set integer = (integer + 1).

Wave 1
Events
Every 1 seconds of game time
Conditions
Integer comparison WaveInteger = 1
Boolean comparison Wave1Done = False
Actions
Set Variable Wave1Done = True
Your triggers for wave 1

Wave 2
Events
Every 1 seconds of game time
Conditions
Integer comparison WaveInteger = 2
Boolean comparison Wave2Done = False
Actions
Set Variable Wave2Done = True
Your triggers for wave 2

And so forth
 

Vamtiin

New Member
Reaction score
1
Hmm... Okay, I tried some different stuff but it all ended up in no wave at all :p

Magnus Söderman Explode
Code:
Event - Unit enters Next Wave
Condition - Boolean[1] Equal to false
Entering unit equal to Magnus Söderman
Actions - Wait 0.5 seconds
Unit - Explode Triggering unit
Player - Add 1 gold to player 4
Set Boolean[1] = True
Wait 12 seconds
Set Boolean[1] = False

Test - Wave 1
Code:
Events - Time every 1 seconds
Conditions - Integer[1] equal to 1
Boolean[1] Equal to false
Actions - Set boolean[1] = True
Quest message *****
Unit create 12 Mutated chickens at center of spawn 1
Unit create 12 mutated chickens at center of spawn 2
Trigger - Turn off This Trigger
 
D

DsD)Core(

Guest
You used the integer as a condition to trigger the wave, but still used gold in the magnus event ;p
So you end up setting the gold to 1 which isn't used for anything, and you have an integer that must be 1 but isn't set by anything.
Remove the gold event and add the integer event to mr magnus.

JASS:
Event - Unit enters Next Wave
Condition - Boolean[1] Equal to false
Entering unit equal to Magnus Söderman
Actions - Wait 0.5 seconds
Unit - Explode Triggering unit
Set Integer[1] = (Integer[1] + 1)
Set Boolean[1] = True
Wait 12 seconds
Set Boolean[1] = False


And problem solved I think.
 

Vamtiin

New Member
Reaction score
1
Either I am very stupid and dont get everything right or I just do something wrong all the time :banghead:

Heres the code to Magnus Söderman Explode:

Unit enters Next Wave

Boolean[1] Equal to false
Unittype of entering unit equals to Magnus

Wait 0.5 seconds
Explode Triggering Unit
Set Boolean[1] = True
Set Integer[1] = (1+1)
Set Boolean[1] = False

Wave 1

Every 1 seconds

Integer[1] Equal 1
Boolean[1] Equal to False

Set Boolean[1] = True
Quest message
Create 12 units at spawn 1
Create 12 units at spawn 2
Turn off trigger

One (easier) way would be if I would send the map and you/someone would edit the stuff I cant and then Ill throw an eye at it :p
 
D

DsD)Core(

Guest
To start off, use different booleans for the magnus event and the wave event. Don't forget to use a different boolean for EVERY wave.

Also, you set the integer to (1+1) which is 2. That won't trigger the first wave, but actually just the second.
You use set integer to (arithmatic) and then set the left one to your integer and the right one to +1, resulting in integer = (integer +1) and that will constantly add one to your integer to loop the waves.

The fix would look like:

Unit enters Next Wave

Boolean[1] Equal to false
Unittype of entering unit equals to Magnus

Wait 0.5 seconds
Explode Triggering Unit
Set Boolean[1] = True
Set Integer[1] = (Integer[1] + 1)
(optionally wait a bit, if your waves are still triggering multiple times)
Set Boolean[1] = False

Wave 1

Every 1 seconds

Integer[1] Equal 1
Boolean[2] Equal to False

Set Boolean[2] = True
Quest message
Create 12 units at spawn 1
Create 12 units at spawn 2
Turn off trigger

By the way, you don't need both the turn off trigger and the boolean check for waves. You can leave out the turn off trigger, since nothing sets the boolean of a specific wave to false anymore and therefore the wave will never ever trigger twice anyway. You can also leave out the boolean check for the wave and only use the turn off, but I'm not sure if that works, eventho it should. Try my fix first, then try to remove unneccesary stuff as explained right here.

EDIT: Feel free to send your map to me if you're completely lost, and I can make a working wave loop for you if you like. But I won't be at home until later today, so you'll have to wait a few hours. I PM'd you my e-mail adress.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top