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

Need Help With Move Trigger

Status
Not open for further replies.
Level 10
Joined
Jul 31, 2008
Messages
477
I was making a trigger like this:
  • Events
  • Unit - A unit enters EastSpawn <gen>
  • Unit - A unit enters MoveEast1 <gen>
  • Unit - A unit enters MoveEast2 <gen>
  • Unit - A unit enters MoveEast3 <gen>
  • Unit - A unit enters MoveEast4 <gen>
  • Unit - A unit enters MoveEast5 <gen>
  • Conditions
  • Actions
  • Set Move = (Move + 1)
  • If (All Conditions are true) the do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Move Equal to 1
  • Then - Actions
  • Unit - Order (Entering unit( to Move To (Center of MoveEast1 <gen>)
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions
  • If - Conditions
  • Move Equal to 2
  • Then - Actions
  • Unit - Order (Entering unit) to Move To (Center of MoveEast2 <gen>)
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
And so on until Move is 5, but i relized that it wouldn't work if there are more then 1 unit that is supose to move...
Help plz ;)
 
Level 7
Joined
Jul 20, 2008
Messages
377
Use custom values for units. If you want multiple custom values, I suggest this tutorial:

Custom Values - The Unofficial Warcraft III Forums

Especially pay careful attention to Zergleb's last paragraph.

But the best practical use is to give each unit on the map a different custom value(First one created gets a 1, second one gets a 2 and so forth that every unit has a different number), and then to use that number to reference values in an array such as let say in a trigger I want to see how many lives a unit has remaining. you could just look in the array Lives[Custom Value(Whatever Unit)] (I'm implying that you store their lives in the array as opposed to storing them in the custom value) Therefore you could find the lives of the first made unit in Lives[1] and the second made unit in Lives[2] and so forth different for every unit.

This is a very useful, if not necessary, technique for a GUI mapmaker to know. This allows you to give each unit multiple custom values.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Yep, that's right, Yixx. Although, are you really going to be keeping track of 8192 units? :p
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
No xD
I was being sarcastic,,
It would lagg like hell right?
It would at least in my comp,,

WTF, cant give you +rep, maybe cause you has like 3 more reps then me? xD
 
Last edited:
Status
Not open for further replies.
Top