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" );
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.
Thanks in advance,
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.
The reborn needs to have the parm2, not the script_runner. If you affect the reborn, then the parm2 is retrieved from his properties.
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.
|All times are GMT -4. The time now is 12:50 AM.|
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.