lfnetwork.com mark read register faq members calendar

Thread: Behavior state problem/question
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 05-19-2003, 12:14 PM   #1
Vegar01
 
Join Date: Apr 2003
Posts: 10
Behavior state problem/question

I'm constructing a very simple map, with a very simple mission (it's a test-map). I'v have a square room with a square platform in the center, put two NPCs in it, made two navgoals, four waypoints. I'v got the NPCs to walk around the platform in the middle with some basic scripting, but now want them to react when every i hit/shot them. I'v tried SET_PAINSCRIPT, but I could'n seem to get it to work. The two NPCs are: "eLuke1" and "eReborn1.

My spawnscript for both NPCs: (there are some changes, with navgoals and NPC_targetname, but their almost alike)
Quote:
rem ( "lukewalk" );
set ( "SET_BEHAVIOR_STATE", "BS_CINEMATIC" );
set ( "SET_IGNOREENEMIES", "true" );
task ( "walk1" )
{
set ( "SET_WALKING", "true" );
set ( "SET_NAVGOAL", "nav2" );
}
dowait ( "walk1" );
task ( "walk2" )
{
set ( "SET_WALKING", "true" );
set ( "SET_NAVGOAL", "nav1" );
}
dowait ( "walk2" );
loop ( -1 )
{
dowait ( "walk1" );
dowait ( "walk2" );
}
set ( "SET_PAINSCRIPT", "duel/klikk" );
And this works fine, except the fact that PAINSCRIPT never gets launched, even if i shot them multiple times.

My PAINSCRIPT (duel/klikk):
Quote:
flush ( );

affect ( "kyle", FLUSH )
{
set ( "SET_WEAPON", "WP_ROCKET_LAUNCHER" );
}

affect ( "eLuke1", FLUSH )
{
set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" );
set ( "SET_IGNOREENEMIES", "false" );
set ( "SET_ENEMY_TEAM", "TEAM_PLAYER" );
set ( "SET_LOCKED_ENEMY", "true" );
set ( "SET_ENEMY", "kyle" );
set ( "SET_PAINSCRIPT", "NULL" );
}

affect ( "eReborn1", FLUSH )
{
set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" );
set ( "SET_IGNOREENEMIES", "false" );
set ( "SET_ENEMY_TEAM", "TEAM_PLAYER" );
set ( "SET_LOCKED_ENEMY", "true" );
set ( "SET_ENEMY", "kyle" );
set ( "SET_PAINSCRIPT", "NULL" );
}
Even though the scripts never runs with PAINSCRIPT I'v tried to run it trough SPAWNSCRIPT and DEATHSCRIPT, and then it works like it should (except that the NPC of some reason only walks, never runs). I made the spawn- and deathscripts in the entity-window in Radiant, but I don't know if that has anything to say.

Any one knows why my Painscript doesn't work? Please.

And one more thing:
If i get the painscript to work, do the Flush erase all of the code in my original script? Meaning that my NPC will stop walking around the circle? If not, how do I do that?
Vegar01 is offline   you may: quote & reply,
Old 05-19-2003, 05:12 PM   #2
Leslie Judge
Teacher
 
Leslie Judge's Avatar
 
Join Date: Aug 2002
Location: Budapest, Hungary
Posts: 1,382
What I'm sure about is that a command will never execute if it is AFTER a never ending loop. So put that SET_PAINSCRIPT command BEFORE the loop.

And I think the SET_WALKING commands are redundant, strip them from the tasks and put a single one before them. I can be wrong about this.

The following is from the ICARUS Manual: "Flushes are useful for clearing previous scripts that are running in loops. A flush will delete that loop."


L. J.
Leslie Judge 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 > JediKnight Series > Editing Central > JO Mapping > Behavior state problem/question

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:11 PM.

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