• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] TD Help

Status
Not open for further replies.
Level 4
Joined
Aug 9, 2004
Messages
70
Event - A Unit Dies

Condition - Boolean Comparison - Unit Group - Units Of Unit Group Are Dead - All units of - Units Owned By Player 11 (DarkGreen) are dead.

JASS:
(All units of (Units owned by Player 11 (Dark Green)) are dead) Equal to (==) True
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
Sorry, but its not deleting my other timer... But it creates a new one, help me? And btw, when i spawn 5 and 5 creatures they spawn so buggy.. Can someone also post how to get the creatures to spawn in a group and make them walk right with them, thanks..
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
So, for destroying the timer, simply use
  • Countdown Timer - Destroy *your timer-variable*
at the beginning of your spawntrigger

and for the spawn itself, do:
  • For each Integer A from 1 to x do:
    • Set temppoint = *your spawnpoint*
    • Create 1 *your unit* for Player y at temppoint facing default building degrees degrees
    • Set waypoint = *your desired point where the unit shall move to*
    • Unit - Order (last created unit) to move (or attack/move) to waypoint
    • Custom script: call RemoveLocation(udg_temppoint)
    • Custom script: call RemoveLocation(udg_waypoint)
whether x is the number of units you want to appear i.e. from 1 to 10 would spawn 10 units
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Aww come on - it's not that hard.
Let me explain a bit:
  • For each Integer A from 1 to x do:
is called an integer loop.
An integer generally is a variable to store i.e. the number of units in a unit group.
This integer loop repeats an action the number of times you set for x, means that if you set x to 10, it repeats ten times.
  • Set temppoint = *your spawnpoint*
Set a point-variable to this name (variables-editor) and use i.e.
  • Set temppoint = (Center of Region 001 <gen>)
to define the point to the center of Region 001
  • Unit - Create 1 *your unit* for Player y at temppoint facing default building degrees degrees
Means you create a unit at your newly set point (the center of Region 001) for a certain player.
Note, use player 1-12 for that as 'neutral passive' and 'neutral hostile' are bugged sometimes.
  • Set waypoint = *your desired point where the unit shall move to*
THis is basically the same as with temppoint, but this time you set i.e.
  • Set waypoint = (Center of Region 002 <gen>)
to define the point to the center of Region 002 - means the unit is ordered to move to the point you set (so in your case, the center of region 002) using
  • Unit - Order (last created unit) to move (or attack/move) to waypoint
.
Last but not least, we have to remove the so-called leaks to prevent you memory from filling up. This is done by using 'custom scripts'. There are plenty of those but now we only use it to remove the location you set for a)the spawning point and b)the waypoint.
  • Custom script: call RemoveLocation(udg_temppoint)
removes the location temppoint and
  • Custom script: call RemoveLocation(udg_waypoint)
removes, yeah, the waypoint

FInally i'd advise, you read this one, as it helps you to prevent further leaks in later triggers: http://www.hiveworkshop.com/forums/f279/basic-memory-leaks-5889/
 
Status
Not open for further replies.
Top