EF2 scripting update

The map is going steady, about 75% of the first maze is completed. I was thinking about creating a script that, depending on the gametype, seals different mazes so different types of gameplay can be made in one area.


Example of the script till now (scripts in ef2 are stored in a .scr file with EXACTLY the same name as your map):

//comments are like this!
//declaration of all functions
void main();
void init();
void actforcefield1();
void turnonforcefield1();
void turnoffforcefield1();

float wallstate1=0; //start state of the forcefields, setting this to 1 causes all the forcefields to be active at game startup, 0 is the opposite.

#include “maps/global_scripts/global_common.scr”//script include declaration

void main() //main function
soundtrack( “sound/music/glassmaze” );
thread init(); //set the soundtrack and fire thread init.

void init() //thread init
$forcefield.notsolid(); //the item(s) with the name forcefield is/are not solid
$forcefield1.hide(); //hide the forcefields
thread actforcefield1();//fire thread

void actforcefield1()//when the console in the admin room is fired this thread is activated
if(wallstate1 == 0) //checks what the current status of the forcefield is
thread turnoffforcefield1();
thread turnonforcefield1();

void turnoffforcefield1()
$actiforcefield.playsound(“sound/environment/computer/lcars_yes.wav”,3,1,100); //play a sound
$forcefield1.notSolid(); //forcefields remain not solid
$forcefield1.hide(); //forcefields are not visible.
wallstate1=1; //wallstate is 1

void turnonforcefield1()
$forcefield1.Solid(); //forcefields are solid
$forcefield1.forcealpha(1); //alpha (visibility)
$forcefield1.alpha(1); //apply the alpha
$forcefield1.show(); //make forcefields visible again.
wallstate1=0; //set wallstate to ON so you can turn it off again.

Also I’m working on a small idea about another machinima, but I’m going to change the story since I don’t want to wait for voice actors all the time. As usual it plays in a Star Trek environment, this time it’s about an abandoned research centre on a planet long abandoned by the Federation….


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s