Jump to content

Home

Scripting Prolems


Monder

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

 

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...