PDA

View Full Version : Scripting Prolems


Monder
06-26-2002, 05:36 AM
OK. I've been trying to learn basic scripting. I created this simple script

//Generated by BehavEd

rem ( "comment" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 120.000, 2000 );
camera ( /*@CAMERA_COMMANDS*/ SHAKE, 16.000, 1000 );

I then compiled it. I created a new map with a target_scriptrunner in it and put in the script file name. I set up a trigger_always to tigger the target_scriptrunner.

When I run the map the script does no execute and I thought hat trigger_always was triggered when the map started. There are no complaints in the console about not being able to find the script file(and there was till I put it in the right place) or anything that looks like an error.

Can anyone tell me what I'm doing wrong?

Xcom
06-26-2002, 05:44 AM
Try targeting your info_player_start at target_scriptrunner instead of trigger_always.

ps: this script is bit wrong but that's another story. :D

>edit<

Btw, what did you fill into target_scriprunner's entity fields?

Monder
06-26-2002, 05:51 AM
In scriptrunner I have the following key/value pairs

classname target_scriptrunner
origin 60 -36 4
targetname Cam
Usescript cam

Oh and what's wrong with my script?

And it still doesn't work if I use info_player_start as the trigger to target_scriptrunner

Xcom
06-26-2002, 06:23 AM
I suppose you have a file called cam.ibi exactly in base/scripts.

Also (and this may sound stupid), make sure you run the game in SinglePlayer version of the game.

About the script being wrong. Well, many things but the most important is that you'll get stuck in cinematic mode cuz there is no camera DISABLE command. Also you should always give cameras a position (ref_tag) to spawn otherwise they appear in world's origin. If I were you, I'd at least change the script into this:

rem ( "comment" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 120.000, 2000 );
wait (2000.000);
camera ( /*@CAMERA_COMMANDS*/ SHAKE, 16.000, 1000 );
wait (1000.000);
camera ( /*@CAMERA_COMMANDS*/ DISABLE );