Jump to content

Home

NPCs won't obey scripts...


boinga1

Recommended Posts

i'm working on a SP map. I want the level to start off in a cutscene, showing two characters walking to waypoints then doing some other stuff. The script is runnning, i know, because the cutscene triggers. however, the NPCs don't move. they are supposed to drop weapons as well, which they do not. i have given them NPC_targetnames of luke1 and mara1. the waypoints are luke1_jumppoint and mara1_jumppoint. can anyone help (also, the NPCs are triggered when the level starts, because they wouldn't show up otherwise. They spawn with the cinematic state on.)

Link to comment
Share on other sites

Well, one of the first suspects should be the script, so it would help, if you posted the relevant part here. With waypoints, I assume you mean waypoint_navgoals. Also one rare thing, but maybe easily overlooked is to check your NPCs are above ground and not partially inside any structures like chairs etc. Yet one thing, concerning the script, is to make sure it does not stop at some other error point before the DO command that would execute the task to move the character.

 

Although I'm not 100% sure about this, but I have had bad experiences with spawning NPCs with the same script that is running the cinematic (later) controlling (animating) them. If this is your case, try spawning the NPCs earlier and only then run the script to control them. Like take the targetnames away from luke and mara so that they would spawn at level start, so that you don't have to spawn them with the script connected to info_playerstart. Or if this is unsuitable, just spawn them with the info_playerstart script and put the actual cinematics into the spawnscript of luke or mara.

Link to comment
Share on other sites

OK, well i'm doing a new map and I actually got the npc to walk to the proper waypoint. Now, when I try to set objectives or weapons or force on "kyle", it does nothing! plz someone

HELP ME!!!

I'm desperate. I doing everything I'm supposed to, even reset my prefs in behaved, and the ******* thing still won't work!

Link to comment
Share on other sites

Cool down, man! To affect kyle, just put in the end of your opening cinematic (which works now, right?):

 

affect("kyle")

setforcejump 3...

setweapon mightygun

 

If it does not work, that means your script never advances that far, and there is some error earlier in your code.

Link to comment
Share on other sites

//Generated by BehavEd

 

rem ( "comment" );

camera ( /*@CAMERA_COMMANDS*/ ENABLE );

camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );

camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );

 

affect ( "jacen_cinematic", /*@AFFECT_TYPE*/ FLUSH )

{

set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" );

set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" );

}

 

wait ( 2000.000 );

 

affect ( "jacen_cinematic", /*@AFFECT_TYPE*/ FLUSH )

{

 

task ( "jacen_start" )

{

set ( /*@SET_TYPES*/ "SET_NAVGOAL", "jacen_start" );

}

 

do ( "jacen_start" );

}

 

wait ( 8000.000 );

remove ( "jacen_cinematic" );

camera ( /*@CAMERA_COMMANDS*/ DISABLE );

 

affect ( "kyle", /*@AFFECT_TYPE*/ FLUSH )

{

set ( /*@SET_TYPES*/ "SET_OBJECTIVE_SHOW", /*@OBJECTIVES*/ "KEJIM_POST_OBJ1" );

}

 

 

heres the script-I removed the force controls and weapons earlier.I'm OK, just sorta ticked at the daggummed thing.

Link to comment
Share on other sites

I might still give you one hint that may later on spare you some troubles and make your scripts run smoothier. When you build cinematics controlling multiple NPCs, build them in one continuum, in other words, link the affect commands one after another, and don't end one affect to go back to the script root to start another one. The result should be such, that when you open your script in BehavEd you only see the first affect. Analogically, put the affect("kyle") at the very end of this cascade of affects. And don't terminate any affect, if you are not going to change the entity (NPC) you are controlling.

 

After a while, you may see that sometimes it is easiest to put one short affect in the middle of some longer affect, but those are more rare as circumstances.

 

This is how Raven did it, and after some (quite much, really) experimentation I can tell you, this is the only way in the long run.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...