- Joined
- May 20, 2008
- Messages
- 433
I've tried this many times, and nothing works. I'm trying to get a unit that enters the map randomly go and attack a random unit in a group, like in kodo tag, where a Kodo will randomly select a player to attack when it spanws. Here is what I have:
UnitTypes is a variable containing multiple kinds of units (so if the unit happens to be one of them, the trigger will continue)
Triggering_Unit is a variable that replaces the normal Triggering Unit (for various reasons)
UnitForce1 is a unit group containing all the player units on the map.
For some reason, the unit will go to the location the unit it picks was at when it was picked, but when it gets there and the unit it was targeting isn't, it will go back to were it spawned and does nothing.
In short, the unit goes to the picked units location at the time of the trigger, but then goes back and does nothing. Help?
-
Unit Attack
-
Events
- Unit - A unit enters Map <gen>
-
Conditions
-
Or-Any (Conditions) are true
-
Conditions
- (Unit-type of (Entering unit)) Equal to UnitTypes[1]
- (Unit-type of (Entering unit)) Equal to UnitTypes[2]
- (Unit-type of (Entering unit)) Equal to UnitTypes[3]
- (Unit-type of (Entering unit)) Equal to UnitTypes[4]
- (Unit-type of (Entering unit)) Equal to UnitTypes[5]
- (Unit-type of (Entering unit)) Equal to UnitTypes[6]
- (Unit-type of (Entering unit)) Equal to UnitTypes[7]
-
Conditions
-
Or-Any (Conditions) are true
-
Actions
- Set Triggering_Unit = (Entering unit)
- Unit - Order Triggering_Unit to Attack (Random unit from UnitForce1)
-
Events
UnitTypes is a variable containing multiple kinds of units (so if the unit happens to be one of them, the trigger will continue)
Triggering_Unit is a variable that replaces the normal Triggering Unit (for various reasons)
UnitForce1 is a unit group containing all the player units on the map.
For some reason, the unit will go to the location the unit it picks was at when it was picked, but when it gets there and the unit it was targeting isn't, it will go back to were it spawned and does nothing.
In short, the unit goes to the picked units location at the time of the trigger, but then goes back and does nothing. Help?