Wander Issue

Status
Not open for further replies.
Level 9
Joined
Oct 2, 2008
Messages
406
When I give my unit wander skill,it wanders around but when I attack it it attacks me for 5 sec and than wanders somewhere around.Unitl I get to it and that unit turns around it starts wandering around again.How do I make my unit wander but not while fighting?
 
Level 15
Joined
Aug 14, 2007
Messages
936
Good solution Pharaoh_
It might be troublesome

Just detect when the unit starts attacking antoher unit, then remove the wander ability
Then do a boolean named wanderattack and set it to false once the unit attacks
Then add a variable real called timer to track the wander ability to allow it to have wander once it doesn't go into combat for a limited time
whenever the unit starts attacking again, reset the timer
Add a new trigger and use periodic timer event to run every 1 second
tick the timer to reduce value and once the timer reaches 0 add the wander back
 
Status
Not open for further replies.
Top