Server Totals
Mikona - (1)
M'Chek - (1)
Visimontium - (0)
Ferrell - (0)
Elysia - (0)
Le'Or - (0)
Deglos - (0)
Underdark - (0)
Wilderness - (0)
Total players: 2
Gallery

Links Menu

NPC go to waypoint from a convo reply

Moderators: Nighthawk4, Dungeon Masters

NPC go to waypoint from a convo reply

PostAuthor: 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

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

PostAuthor: 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).

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

PostAuthor: beezel_bug » Tue Aug 23, 2005 11:56 am

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

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


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Zandel