lfnetwork.com mark read register faq members calendar

Thread: Making NPCs walk waypoints
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 01-02-2005, 03:51 PM   #1
Doc Valentine
Ha-Ha Kotor Modding
 
Doc Valentine's Avatar
 
Join Date: Sep 2003
Location: In the eye of the beholder.
Posts: 1,133
Veteran Modder Helpful! 
Question "Waypoints Waypoints Waypoints"

Hey guys, I want to have civilians walking around on designated paths but still be able to talk, and when done talking continue on their paths, does anyone know how to make them have a path to walk on and move on?

Original thread


I don't need you no more in this world. I'll meet you in the next one, and don't be late.

Last edited by tk102; 01-23-2005 at 07:37 PM.
Doc Valentine is offline   you may: quote & reply,
Old 01-02-2005, 07:29 PM   #2
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,766
Current Game: Dragon Age: Origins
Forum Veteran Helpful! Notable contributor 
The k_inc_walkways.nss file contains the generic functions used to make people walk the waypoints. The naming of the waypoints is important in order to use these functions:

wp_NPCtag_## where ## is a two digit number starting with 01. The NPCtag portion should match the .utc tag exactly.

(There is a 2nd naming convention that uses wp_xx_## where xx is a two digit number, but this requires extra work with Local Numbers for each creature.)

Now, for generic walkpaths, you only really need one .utw file and then you can use the .git file to spawn it multiple times using different tagnames (using the naming convention described above). Almost every .git file has an example of this in its WaypointList field.



Your .utc's spawn-in script should be modeled after k_def_spawn01.nss inasmuch that you preserve the following lines:
Code:
GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT);
GN_SetListeningPatterns();  
GN_WalkWayPoints();
These lines will force your .utc to start walking the waypoints that you've named especially for them.

#glovemaster 19/01/09:
A problem I found was that when you talked to them they stopped walking their waypoints, I had to add the following script to fire onEndDialog to fix it.
Code:
#include "k_inc_generic"
#include "k_inc_debug"
#include "k_inc_treas_k2"

void main(){
	// Force them to continue walking waypoints.
	GN_WalkWayPoints();
}


Stormtrooper789 says: For random walking you may be able to do without any waypoints. Use the following script:
Code:
void main()
{
	AssignCommand(OBJECT_SELF,ActionRandomWalk())
}

Attach this to the .utc OnHeartbeat script event.



Last edited by glovemaster; 01-19-2009 at 01:21 PM.
tk102 is offline   you may: quote & reply,
Old 03-25-2009, 06:10 PM   #3
Sithspecter
Big things are coming...
 
Sithspecter's Avatar
 
Status: Moderator
Join Date: Jan 2008
Location: Ebon Hawk
Posts: 1,787
Current Game: Mechwarrior II: Mercenaries
Contest winner - Modding Forum Veteran Veteran Modder LFN Staff Member 
A tutorial that's a little easier to understand.

Okay, let's get started.
First, you need to make your creature file.

Do everything that you normally do to make a creature file, but I would make the tag very simple. In my case, I used "walkdrd" without the quotes. Also, change the Template ResRef to whatever you decide to make the tag.

Under the scripts tab, remove everything, and type the following scripts into their corresponding fields:
OnEndDialogu- k_act_walkways2
OnSpawn- k_def_spawn01
OnRested- k_act_walkways2

(These scripts command the NPC to walk the waypoints you will create next)

Save your .utc with the same name that you used in the tag and Template ResRef.

Now, get the waypoint editor open and enter the following in the Template ResRef, Tag, and Name files:
wp_walkdrd_01 (if you're using a different tag, use wp_tag_01)

Next, put your character in the .git file as normal, and then go to the waypoints section. Click 'Add struct', and then use the following for the fields:

Save the waypoint as what you used in the last step.
Okay, now make however many more that you need, just changing the number on the end (ex: wp_walkdrd_01, wp_walkdrd_02, .etc).

Add the .utc to the .git file as normal, and then go down to the waypoint list and click 'Add Struct.'
Find and existing .git with a waypoint beginning with wp_, and then copy and change the following fields:
Tag: wp_walkdrd_01 (or whatever you saved your waypoint as)
TemplateResRef: wp_walkdrd_10 (or whatever you saved your waypoint as)
XPosition: use whereami cheat to find location
YPosition: use whereami cheat to find location
ZPosition: use whereami cheat to find location

Add more waypoints for a longer path. Once your creature completes the last waypoint, he will return to the first and start over.

Hope that helps, and remember to include your .utc's and .utw's in the ERF!

SS



Sithspecter is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Tutorials: General Tutorials + Tools > Making NPCs walk waypoints

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:23 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.