Jump to content

Home

"Waypoints Waypoints Waypoints"


TheProphet

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

[size=1]GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT);
GN_SetListeningPatterns();  
GN_WalkWayPoints();[/size]

These lines will force your .utc to start walking the waypoints that you've named especially for them. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 9 months later...

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_END); 
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...