• 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.

Why will my trigger only make 1 unit?!

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2005
Messages
298
Ok heres the trigger for my ability:

Code:
Wake of Death 
Events 
Unit - A unit Starts the effect of an ability 
Conditions 
(Ability being cast) Equal to Wake of Death 
Actions 
Set ATempRegion = ((Position of (Casting unit)) offset by 125.00 towards ((Facing of (Casting unit)) + 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion) 
Set ATempRegion = ((Position of (Casting unit)) offset by 250.00 towards ((Facing of (Casting unit)) + 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion) 
Set ATempRegion = ((Position of (Casting unit)) offset by 375.00 towards ((Facing of (Casting unit)) + 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion) 
Set ATempRegion = ((Position of (Casting unit)) offset by 125.00 towards ((Facing of (Casting unit)) - 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion) 
Set ATempRegion = ((Position of (Casting unit)) offset by 250.00 towards ((Facing of (Casting unit)) - 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion) 
Set ATempRegion = ((Position of (Casting unit)) offset by 375.00 towards ((Facing of (Casting unit)) - 90.00) degrees) 
Unit - Create 1 Dummy unit for (Owner of (Casting unit)) at ATempRegion facing (Facing of (Casting unit)) degrees 
Unit - Add a 1.00 second Generic expiration timer to (Last created unit) 
Unit - Add Wake of Death to (Last created unit) 
Unit - Set level of Wake of Death for (Last created unit) to (Level of Wake of Death for (Casting unit)) 
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Last created unit)) offset by 100.00 towards (Facing of (Casting unit)) degrees) 
Custom script: call RemoveLocation (udg_ATempRegion)

for some reason it only creates the first unit. WHY?! :cry:
 
Level 10
Joined
Jul 14, 2004
Messages
463
I think the problem is that you remove the location "ATempRegion" and afterwards use it and set it again. But since the location is removed, the following functions like "set ..." and also the "create unit..." won't work.
If ATempRegion is a local variable, just remove it at the end, if not, you don't have to remove it at all since you just set it to a new value every time and that doesn't cause any leak. :wink:
 
Status
Not open for further replies.
Top