NPC go to waypoint from a convo reply

Moderator: Event DM

Post Reply
beezel_bug
Apprentice Scholar
Posts: 689
Joined: Fri Aug 27, 2004 9:12 pm
Location: UK, Hertfordshire

NPC go to waypoint from a convo reply

Post by beezel_bug » Tue Aug 23, 2005 11:03 am

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.

thanks
Czarcasm
Team Member; Retired with Honors
Posts: 1724
Joined: Tue Nov 09, 2004 2:55 pm
Timezone: GMT-6
Location: St. Louis, MO

Post by Czarcasm » Tue Aug 23, 2005 11:40 am

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).
beezel_bug
Apprentice Scholar
Posts: 689
Joined: Fri Aug 27, 2004 9:12 pm
Location: UK, Hertfordshire

Post by beezel_bug » Tue Aug 23, 2005 11:56 am

thanks I'll try that out when I get home from work
Post Reply