Jump to content

Home

People who know scripting, help me!


la$her

Recommended Posts

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" );

-----------------------------------------------

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...