- Joined
- Jan 24, 2014
- Messages
- 6
Hey everyone,
I'm trying to create a situation like this. For example I have a Builder unit and I order him to build a Tower. After the Tower is finished a Footman is spawned (created by triggers of course) near the Tower. What I want is that both the Unit (Footman) and the Building (Tower) would be memorized so I could issue an order to the Footman later via trigger, for all testing purposes by ESC button or chat message, to return to the Tower he was created near. But I want this to be dynamic in a way that If I create another Tower and another Footman is spawned, later when I issue an order they both go back, no matter where they are on the map, to their respective Towers. I tried doing this by playing with arrays. For example first Footman would be Unit[IntA] and the Tower Building[IntA]. The default value for integer IntA would be 1 (So they both would be Unit[1] and Building[1]). After they both would be created I would increase IntA by one. So if I build another Tower, another Footman is spawned and they, at least in theory, should be Unit[2] and Building[2] because IntA integer is increased etc.
If there would be any suggestions on how to make it would be helpful. Both regular Triggers and Jass are OK.
I'm trying to create a situation like this. For example I have a Builder unit and I order him to build a Tower. After the Tower is finished a Footman is spawned (created by triggers of course) near the Tower. What I want is that both the Unit (Footman) and the Building (Tower) would be memorized so I could issue an order to the Footman later via trigger, for all testing purposes by ESC button or chat message, to return to the Tower he was created near. But I want this to be dynamic in a way that If I create another Tower and another Footman is spawned, later when I issue an order they both go back, no matter where they are on the map, to their respective Towers. I tried doing this by playing with arrays. For example first Footman would be Unit[IntA] and the Tower Building[IntA]. The default value for integer IntA would be 1 (So they both would be Unit[1] and Building[1]). After they both would be created I would increase IntA by one. So if I build another Tower, another Footman is spawned and they, at least in theory, should be Unit[2] and Building[2] because IntA integer is increased etc.
-
Testing Create
-
Events
-
Unit - A unit Finishes construction
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to (==) Scout Tower
-
-
Actions
-
Set Building[IntA] = (Triggering unit)
-
Unit - Create 1 Footman for (Owner of Building[IntA]) at (Position of Building[IntA]) facing Default building facing (270.0) degrees
-
Set Unit[IntA] = (Last created unit)
-
Set IntA = (IntA + 1)
-
-
-
Testing Order Back
-
Events
-
Player - Player 1 (Red) skips a cinematic sequence
-
-
Conditions
-
Actions
-
Do Multiple ActionsFor each (Integer IntA) from 1 to 10, do (Actions)
-
Loop - Actions
-
Unit - Order Unit[IntA] to Right-Click Building[IntA]
-
-
-
-
If there would be any suggestions on how to make it would be helpful. Both regular Triggers and Jass are OK.