PDA

View Full Version : People who know scripting, help me!


la$her
07-07-2002, 12:59 AM
I'm trying to make an Ugnaught speak in fear, then run away from me. Just for fun. He's running to a ref_tag called escapepoint. Problem is, when the script runs, it only carries out the sound command and then just stops. This happens with or without the wait commands.Why isn't the rest taking place?

------------------------------------------------
//Generated by BehavEd

rem ( "make NPC run away from Player" );

affect ( "coward", /*@AFFECT_TYPE*/ FLUSH )
{
}

set ( /*@SET_TYPES*/ "SET_RUNNING", "true" );
sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/chars/Rodian1/misc/cover3.mp3" );
wait ( 1000.000 );
print ( "Don't hurt me!" );
wait ( 1000.000 );
set ( /*@SET_TYPES*/ "SET_NAVGOAL", "escapepoint" );
-----------------------------------------------

Eagle_e7
07-07-2002, 01:14 AM
Im not sure wether ref_tag works for nav points so to be on the safe side try changeing that ref_tag into a waypoint_navgoal_4 entity, and then try this script.

===========================

//Generated by BehavEd

rem ( "make NPC run away from Player" );

affect ( "coward", /*@AFFECT_TYPE*/ FLUSH )
{

sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/chars/Rodian1/misc/cover3.mp3" );
wait ( 1000.000 );
print ( "Don't hurt me!" );
wait ( 1000.000 );
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_WALK" );
set ( /*@SET_TYPES*/ "SET_NAVGOAL", "escapepoint" );
set ( "SET_RUNNING", "true" );
set ( "SET_WALKING", "false" );
}

===========================

That should work:)

la$her
07-07-2002, 01:18 AM
Thanks, I'm off to try that now. We'll assume that it worked unless I'm back here whinging in an hour or so :D

la$her
07-07-2002, 03:09 AM
Worked mostly, except that the printed words still don't appear. I can't make the print command work, which seems quite bizarre to me as it's so simple..... or so it seems.....

Eagle_e7
07-07-2002, 07:47 PM
I've never tried the print command from a script before but if its giving you grief you could always use the "target_print" entity.

After you've created your'e message in your'e entity you should still be able to activate it via your'e script. Create a "trigger_once" entity and give it the targetname "mytrig" then target it to your'e "target_print" entiy and use this command in place of your'e previous print command...

use ( "mytrig" );

This will activate your'e "target_print" entity, and hopefully print your'e message. I dont know wether or not it will make any difference to the script method but if your'e desperate it's something to try:)

Mind you if your'e trying to print during a cutscene i dont think thats possible.

patchx
07-07-2002, 07:55 PM
yeah i couldn't get the print command to work either and had to make use of the target print entity its easy you dont even have to change your script just give th target print entity the same targetname as the scriptrunnner that runs your script

-patch