Jump to content

Home

SET_NAVGOAL question


JavaGuy

Recommended Posts

I have a script that sets an Reborn NPC's nav goal during a cinematic when the NPC is first triggered. No problem...he walks right to it, then activates his sabre, very dramatic.

 

But then I want the Reborn to jump (or at least run over to) a certain nav goal when the player walks through a certain trigger. So the trigger is inactive at first, then activated when the Reborn spawns, and targets a scriptrunner that runs this script:

 

affect ( get( STRING, "SET_PARM1"), /*@AFFECT_TYPE*/ FLUSH )

{

task ( "goto" )

{

set ( "SET_BEHAVIORSTATE", "BS_CINEMATIC" );

set ( "SET_NAVGOAL", get( STRING, "SET_PARM2") );

}

 

do ( "goto" );

}

 

Now...nothing happens!

 

Before you ask...

 

Yes, I'm sure the script gets run. The Reborn does indeed enter cinematic state and stop fighting when I walk through the trigger. He just doesn't go the the nav goal.

 

Yes, parm2 on the script runner is set to the targetname (not the script_targetname) of the nav goal.

 

Any suggestions?

 

Thanks in advance,

Sam

Link to comment
Share on other sites

I don't know about this parm stuff, I find it just complicates things. It's best to use names and descriptions that mean something. Just give your NPC an NPC_targetname and use his name in the affect statement. Change the "do" to a "dowait"

 

If you want your NPC to jump to a navgoal you have to change his behavior state to BS_JUMP.

Link to comment
Share on other sites

I'm using PARMs because I'm going to have a bunch of these and don't want to write a bunch of scripts that are all identical except for a few target names.

 

I think lassev has hit upon the answer--It's the NPCs PARM it gets because the Affect essentially creates a new script and pushes it off on the NPC. I'll test it as soon as I get home. Good catch, and thanks!

 

What I'll probably do is grab the value from the scriptrunner and put it in a global variable.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...