PDA

View Full Version : Script should work...right?


froman2686
02-23-2003, 12:50 PM
Hi, I'm having some trouble scripting out a scene for my SP map. I want to spawn NPC desann and kyle, start the camera facing kyle, switch to desann, zoom out of desann as he walks to kyle, then switch to wide view that shows both of them. The camera itself works perfectly. However, I cannot get Desann to move. I set NPC_targetname to desanncin and kylecin, which seems to work because they are both properly removed at the end of the script.

I also made two navgoals, nav5 and nav6, for desann to walk between. This also confuses me because I have a stormtrooper on patrol using the same exact method and that works perfect.

Here's the script itself:

//(BHVD)
rem ( "comment" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );

affect ( "kylecin", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" );
}

camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 8000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 4000.000 );

affect ( "desanncin", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" );
//$"walkOnly"@5
set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" );
set ( /*!*/ "SET_WALKING", /*!*/ "true" );
set ( /*!*/ "SET_RUNNING", /*!*/ "false" );
set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "true" );
set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "false" );
set ( /*@SET_TYPES*/ "SET_FACE_MOVE_DIR", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav5" );
set ( /*@SET_TYPES*/ "SET_PLAYER_TEAM", /*@TEAM_NAMES*/ "TEAM_PLAYER" );
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_CINEMATIC" );
}

camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam4", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam4", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 15000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 8000.000 );

affect ( "desanncin", /*@AFFECT_TYPE*/ FLUSH )
{
//$"walkOnly"@5
set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" );
set ( /*!*/ "SET_WALKING", /*!*/ "true" );
set ( /*!*/ "SET_RUNNING", /*!*/ "false" );
set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "true" );
set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "false" );
set ( /*@SET_TYPES*/ "SET_NAVGOAL", "nav6" );
set ( /*@SET_TYPES*/ "SET_FACE_MOVE_DIR", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_CINEMATIC" );
}

wait ( 3000.000 );
remove ( "desanncin" );
remove ( "kylecin" );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

Any ideas?

Leslie Judge
02-24-2003, 01:43 AM
Hmm... I think those behaviour settings are not necessary. When you place the NPCs in radiant, you can set the cinematic spawnflag, so they will have no AI.

You set all the walking and other parameters, but after them you set the behaviour state to cinematic, and maybe it causes the same effect as making the NPC forget everything you set before.

I think you should try without them.

Dea
02-24-2003, 07:27 AM
setting walk states, and navgoals isn't enough, you need to tell him to actually do it :p

froman2686
02-24-2003, 08:46 AM
Setting the behavior state to BS_CINEMATIC has the following help text- "Makes ent faces it's angles and move to a goal if it has one." And I used identical scripting techniques to make a stormtrooper patrol between two navgoals. I'm going to rewrite the script from scratch and see if something different happens.

Kengo
02-24-2003, 09:11 AM
I think Dea is right, you need a DOWAIT command to actually make it happen. I don't think setting cinematic is a problem...having said that, might be worth trying it without that command if you still can;t get things working.

Putting a dowait in isn't easy (it has to be put in a certain way) - you might wana check the scripting tutorials here:

http://mapping.jediknightii.net/

As you got a patrol working...didn't you have to usea dowait for that as well?

froman2686
02-24-2003, 09:37 AM
That's a good point, i did have to use a dowait command. Let me try that out. Thanks for the pointers.

froman2686
02-24-2003, 03:28 PM
Ok I added dowaits and still got no results. I changed the script, so that the camera script was run solely by a target_scriptrunner. Then, I added the desann movement scripts to a seperate file and ran them as a spawnscript, same for kyle. It works fine. Shame I couldn't do it the other way, but this way at least I'll be able to easily manage each piece of the scene. Thanks for all the help.