I have a Hero ( main Unit ) that can use a Townportal exacly like in Diablo 2!.
problem im having is that the Hero can also Hire mercs, but when i go into the Towportal ( for 1 unit ) the Mercs dont dollow me.
So what im trying to do is:
Even:
Unit- Any unit uses ability
Condition:
(Owner of triggering unit) == 1
Action:
Move All player 1 units to Center of region A
.
So bassicly when ever the hero use the TP ( load cargo) ability I want all other units owned by player 1 to be instantly moved to Region A
i`ve attached region A to the Hero.
I think the problem im havving is that I dont know how to select ALL the player 1 (2,3,4..etc..) so i can then move them.
im assuming i need a trigger that bassicly adds Last created unit (when u buy the merc at shop) to a player group.
then move player group to Region A when ussing the TP ability.
but im not sure how to do that ,cause what ive done so far dooesnt wrok :(
hey guys,
I have a Hero ( main Unit ) that can use a Townportal exacly like in Diablo 2!.
problem im having is that the Hero can also Hire mercs, but when i go into the Towportal ( for 1 unit ) the Mercs dont dollow me.
So what im trying to do is:
Even:
Unit- Any unit uses ability
Condition:
(Owner of triggering unit) == 1
Action:
Move All player 1 units to Center of region A
.
So bassicly when ever the hero use the TP ( load cargo) ability I want all other units owned by player 1 to be instantly moved to Region A
i`ve attached region A to the Hero. I think the problem im havving is that I dont know how to select ALL the player 1 (2,3,4..etc..) so i can then move them.
im assuming i need a trigger that bassicly adds Last created unit (when u buy the merc at shop) to a player group. then move player group to Region A when ussing the TP ability.
but im not sure how to do that ,cause what ive done so far dooesnt wrok :(
any advice?
Try using a unit group variable with it's initial value "Units In Region Matching Condition" and then use a unit loop to pick all the units.
i dont want to sound picky , but could you show me an example?
triggers for me is like trying to learn Chines. :( im not very good at it..
this is what i have:
Trigger 1:
Unit Group mercs 1
Events
Unit - Any Unit Enters (Entire map)
Local Variables
Conditions
(Owner of (Triggering unit)) == 1
Actions
Unit Group - Add (Triggering unit) to Player group[5]
trigger 2
Unit - Any Unit Loads cargo
Local Variables
Conditions
Actions
Unit Group - Pick each unit in Player group[5] and do (Actions)
Actions
Unit - Move (Triggering unit) instantly to (Center of Player 1 merc) (No Blend)
Varrible:
Player group = (Empty unit group) <Unit Group[5]>
It's pretty simple. You actually don't need a variable like I said in my previous post, since you can also put that in the "Pick Each Unit" loop.
Also, if you put this between your code/triggers it will look like what I've posted, more readable.
thanks :)
got it to work perfectly :)