Page 1 of 1

NPC go to waypoint from a convo reply

PostPosted: Tue Aug 23, 2005 11:03 am
Author: beezel_bug
Hope someone can help me.

I have an NPC who has a few waypoints he walks around. I have added a conversation tree with several PC replies such as "go to room A" and "got to room b", etc.

These rooms each have a waypoint of the NPC in them.

Now how do I connect these together to make the NPC go to a particular waypoint from the PC reply.


PostPosted: Tue Aug 23, 2005 11:40 am
Author: Czarcasm
Depending on how the waypoints are setup, you can use ActionForceMoveToObject(object oObjectToMoveTo, int iRun, float fRange, float fTimeOut)

Use your waypoint as the object, set iRun to TRUE (if you want him to run) or FALSE (if you want him to walk), fRange is the distance (in meters) from the object your NPC will stop walking, and fTimeOut is the amount of time to try to reach the object before jumping to the point.

All you need to use is ActionForceMoveToObject(oWayPoint), this will make your NPC attempt to walk to the waypoint for 30 seconds before teleporting to it.

If you don't want him to teleport, but just fail to move to the point and stop, use ActionMoveToObject(oWayPoint).

PostPosted: Tue Aug 23, 2005 11:56 am
Author: beezel_bug
thanks I'll try that out when I get home from work