Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

"Waypoints Waypoints Waypoints"

Page: 1 of 1
 Doc Valentine
01-02-2005, 3:51 PM
#1
Hey guys, I am working on Coruscant, a planet in my mod A new Foe, and 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? I looked in guide to the newbie and the tutorials section couldnt find anytihng.
 Xavier2
01-02-2005, 6:02 PM
#2
Originally posted by Gsccc
Hey guys, I am working on Coruscant, a planet in my mod A new Foe, and 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? I looked in guide to the newbie and the tutorials section couldnt find anytihng.
Look for the discussion about paths here:
http://www.lucasforums.com/showthread.php?s=&threadid=134533&highlight=waypoints)

In any case i would advise you to use civilians utc and paths that already exists in your module...just to save you a lot of work.;)

Good luck.
 tk102
01-02-2005, 7:29 PM
#3
To add to the discussion that Xavier2 pointed you towards, the k_inc_walkways.nss file contains the generic functions used to make people walk the waypoints.

As beancounter mentioned, 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: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. :)
 StormTrooper789
01-03-2005, 8:09 AM
#4
Theres a really easy way. You can make the NPCs walk around randomly, so you don't have to mess with that waypoint goo! :D

Script:

void main()
{
AssignCommand(OBJECT_SELF,ActionRandomWalk())
}


After you do that, compile it. Lets say you named it randwalk.ncs(thats after compile).

Edit the character's utc file and in the entry ScriptSpawn add our script(randwalk).

NOTE: If the character only walks once or it doesn't work try the entry ScriptHeartbeat.
 Pavlos
10-22-2005, 11:57 AM
#5
The random walk script will not compile. There is an error in it. It is missing a semi colon after the close brackets


void main()
{
AssignCommand(OBJECT_SELF,ActionRandomWalk());
}
 Darth333
10-22-2005, 12:22 PM
#6
Btw, just to let you know, this script does not totally replace waypoints. If you interrupt the npc while walking, he will just stop walking and stand still.

Edit: you could probably try using the user defined event too to refire your script if the npc is interrupted:

In the spawn script, it would give something like this:

#include "k_inc_generic"
void main()
{
GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT);
GN_SetListeningPatterns();
GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE_E ND);
AssignCommand(OBJECT_SELF,ActionRandomWalk());
}


and for the user defined event:

#include "k_inc_generic"
void main()
{
int nUser = GetUserDefinedEventNumber();
if(nUser == 1011) // ON DiaLOGUE END
{
AssignCommand(OBJECT_SELF,ActionRandomWalk());
}

}
Never tried it but I think it should work.
Page: 1 of 1