Modifié par M. Rieder, 27 novembre 2011 - 03:10 .
Making NPCs wait before walking their waypoints. (RESOLVED)
Débuté par
M. Rieder
, nov. 27 2011 01:00
#1
Posté 27 novembre 2011 - 01:00
I want an NPC to stand still until I want them to start walking their waypoints. Initially I tried stopping their HB script until an integer is set, but on spawn, they still go to a waypoint even though their HB script wasn't turned on yet. Next I tried changing their tag, then changing it to the appropriate tag for the waypoints, but when I changed their tag, they just stood there. Any suggestions would be helpful.
#2
Posté 27 novembre 2011 - 02:11
The waypoints are looked up and stored at spawn, so switching tags or deleting waypoints won't help you. Additionally, I think different scripts, besides the heartbeat, call the WalkWaypoints function. I ended up creating a custom version of the core walkwaypoints script, with a conditional that checks a integer set on the NPC.
The custom walkwaypoints system, though, developed by OEI for the townwalkers in the OC, has a delay function.
The custom walkwaypoints system, though, developed by OEI for the townwalkers in the OC, has a delay function.
#3
Posté 27 novembre 2011 - 03:10
Got it. I had to use the following code to shut off the walkwaypoints system.
AssignCommand(oTarget,ClearAllActions(TRUE));
AssignCommand(oTarget,SetWalkCondition(NW_WALK_FLAG_PAUSED, TRUE));
Clear all actions is just to make sure the NPC stops.
AssignCommand(oTarget,ClearAllActions(TRUE));
AssignCommand(oTarget,SetWalkCondition(NW_WALK_FLAG_PAUSED, TRUE));
Clear all actions is just to make sure the NPC stops.





Retour en haut






