lfnetwork.com mark read register faq members calendar

Thread: Waypoint script
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 06-19-2009, 05:20 PM   #1
Demongo
Afro Skeleton
 
Demongo's Avatar
 
Join Date: Apr 2009
Posts: 963
Current Game: Street Fighter IV
Unhappy Waypoint script

I read TK102's tutorial on how to make an NPC walk around a module. There is this script:
Code:
#include "k_inc_generic"
#include "k_inc_debug"
#include "k_inc_treas_k2"

void main(){
	// Force them to continue walking waypoints.
	GN_WalkWayPoints();
}
I can't compile it. Is something wrong with the script? This is what KTool says when I want to compile it:

Any ideas what can be the problem?



Bink's Sake

"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"

"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."
Demongo is offline   you may: quote & reply,
Old 06-19-2009, 05:35 PM   #2
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
k_inc_treas_k2 is an include file provided only in TSL. Since you are compiling the code for K1, you can't use it. In any case, that include file deals only with how the game distributes the random loot, so you can delete the line:
Code:
#include "k_inc_treas_k2"
- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 06-19-2009, 05:50 PM   #3
Demongo
Afro Skeleton
 
Demongo's Avatar
 
Join Date: Apr 2009
Posts: 963
Current Game: Street Fighter IV
But without that line the script isn't working. I included this script in the NPCs onEndDialog box. Is it right?



Bink's Sake

"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"

"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."
Demongo is offline   you may: quote & reply,
Old 06-19-2009, 06:55 PM   #4
logan23
Veteran
 
logan23's Avatar
 
Join Date: Aug 2007
Location: East Coast
Posts: 910
Current Game: Revenge of Revan
Veteran Modder Forum Veteran Contest winner - Modding Hot Topic Starter 
Hey,

Here is what you do to get the character to walk random.
Just remember the NPC will start walking in the direction you point them. So don't have them all facing same way or each other since it might lead to them bumping into each other.

Go to the utc's script area and locate k_def_spawn01

You will then open the script and go to the bottom and make one change-

//****** TURN ON WALKPOINTS ******
// The following line causes the object to follow waypoints
AssignCommand(OBJECT_SELF,ActionRandomWalk());

You place this line in and remove the old line, its in bold for you. Then compile and save the old k_def_spawn01 into another name....for example..... randwlk.nss

Should look like this:

Quote:
//:: k_def_spawn01
/*
v2.0
Default On Spawn In
*/
//:: Created By: Preston Watamaniuk
//:: Modified By: Anthony Davis
//:: Added treasure: Kevin Saunders
#include "k_inc_generic"
#include "k_inc_debug"
#include "k_inc_treas_k2"

void main()
{
//BEGIN WALK WAYPOINT BEHAVIORS (Comment In or Out to Activate )
//****** WAYPOINT PATH STYLE ******
// Object will follow waypoints in order, and then start over at beginning.
// Example: WP_01, WP_02, WP_03, then return to WP_01 and continue...
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_CIRCU LAR);
// Object will follow waypoints in order, and then follow the waypoints backwards.
// Example: WP_01, WP_02, WP_03, then WP_02, WP_01,
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_PATH) ;
// Object will follow waypoints in a RANDOM order
// Example: WP_02, WP_03, WP_01
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_RANDO M);
// Object will follow waypoints starting with NEAREST waypoint.
// THIS WILL EFFECT THE ORDER THE WAYPOINTS ARE FOLLOWED!
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_START_AT_N EAREST);

//****** WAYPOINT FREQUENCY ******
// Object will follow waypoints ONLY ONCE.
// Leave commented out to have waypoints repeated forever.
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_ONCE) ;

//****** WAYPOINT SPEED ******
// Object will RUN to waypoints.
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_RUN);

//****** WAYPOINT PAUSING ******
// Object will PAUSE at each waypoints based on each option.
// CObjects will ONLY turn to face in the waypoint direction if
// the are pausing at the waypoint.
// The pause times are:
// Causes the Object to pause for 1 - 3 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_PAUSE_SHOR T);
// Causes the Object to pause for 4 - 6 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_PAUSE_LONG );
// Causes the Object to pause for 1 - 10 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_PAUSE_RAND OM);

//****** WAYPOINT ANIMATIONS ******
// Object will play an animation that has been specified with
// SetLocalNumber(OBJECT_SELF, 29, <SOME ANIMATION NUMBER> )
// Local number 29 is reserved for animations.
// This may conflict with ambient animations (further down)
//GN_SetSpawnInCondition(SW_FLAG_USE_WAYPOINT_ANIMAT ION);
// If using an animation at a waypoint, uncomment and set the following lin:
//SetLocalNumber(OBJECT_SELF, 29, <SOME ANIMATION NUMBER> );


//****** WAYPOINT SERIES ******
// If this function is uncommented a number from 1 to 99 must be passed.
// This number represents a waypoint series that uses the string "01" through "99"
// instead of the creature's tag.
// eg. WP_22_01 through WP_22_05. 22 is the series number set with this function.
//GN_SetWalkWayPointsSeries( 1 );

//END WALK WAYPOINT BEHAVIORS

//****** AMBIENT ANIMATIONS ******
// This will play Ambient Animations until the NPC sees an enemy or is cleared.
// NOTE: that these animations will play automatically for Encounter Creatures.
//GN_SetSpawnInCondition(SW_FLAG_COMMONER_BEHAVIOR);
//GN_SetSpawnInCondition(SW_FLAG_FAST_BUFF);
//GN_SetSpawnInCondition(SW_FLAG_AMBIENT_ANIMATIONS) ;
//GN_SetSpawnInCondition(SW_FLAG_AMBIENT_ANIMATIONS_ MOBILE);

//****** COMPUTER DIALOG ******
//When a creature with this flag is talked to a computer dialogue will come up instead of the usual screens.
//GN_SetSpawnInCondition(SW_FLAG_ON_DIALOGUE_COMPUTE R);

//****** CUSTOM USER DEFINED EVENTS ******
// The following settings will allow the user to fire one of the blank
// user defined events in the NW_D2_DefaultD. Like the OnSpawnIn script,
// this script is meant to be customized by the end user to allow for unique
// behaviors. The user defined events user 1000 - 1010
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_HEARTBEAT) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_PERCEPTION ); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_ATTACKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_COMBAT_ROU ND_END); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DEATH); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_BLOCKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1009
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_FORCE_AFFE CTED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1010
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE_E ND); //OPTIONAL BEHAVIOR - Fire User Defined Event 1011

//****** BEGIN DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ******
GN_SetDayNightPresence(AMBIENT_PRESENCE_ALWAYS_PRE SENT);
// This function although poorly named sets up the listening patterns and other
// important data for the creature it should never be removed.
GN_SetListeningPatterns();
SetLocalNumber(OBJECT_SELF, 11, 6);// FAK - OEI default turret cooldown
//****** END DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ******

//****** TREASURE PLACEMENT
PlaceCritterTreasure(OBJECT_SELF, Random(4)-2);

//****** TURN ON WALKPOINTS ******
// The following line causes the object to follow waypoints
AssignCommand(OBJECT_SELF,ActionRandomWalk());

}
Logan

logan23 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 > Waypoint script

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 01:01 PM.

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