- Joined
- Jun 29, 2009
- Messages
- 142
I've been doing some NPC (non-player computer) pathing for my city in my map. One feature I've added is so when you click a person within a certain range he turns to look at you. If you deselect him or walk away it looks back to its original facing direction.
This is all good and works perfectly, but there is one flaw. I have a guy that walks around the city. When I click him he look at me, but when i walk away he doesn't continue on his walk. I did see that there was a variable called "order(ordercode)" and I'm assuming that it saves the current order of the unit. Now the only problem is to give that unit the saved order code...
This is all good and works perfectly, but there is one flaw. I have a guy that walks around the city. When I click him he look at me, but when i walk away he doesn't continue on his walk. I did see that there was a variable called "order(ordercode)" and I'm assuming that it saves the current order of the unit. Now the only problem is to give that unit the saved order code...
How do I save the current order a unit was given and then later give that order to the unit again?
Ex:
-
Events
-
Unit - Unit is clicked
-
Conditions
-
(Owner of (Triggering unit)) Equal to (==) Neutral Passive
-
Actions
-
Set CurrentOrder = (Current order of (MyHero))
-
Wait 2.0 seconds
-
Unit - Order NPC to (CurrentOrder)
Last edited: