News

Maps

Tutorial    mission script

Work in Progress

          the ..script       General overview

The .ent

The .items

The .script

 
                 
         

For this part, read CAREFULLY the is more than important. it's the half of the work. take the time to make it on paper before (i use to print it). If you have an error in the console like "blabla line 46 in script" remember that all the empty lines and "//" line are not used. For the script, reading the console is important cause it allway say when u have an error. if u need to keep the error message as a .txt use this command /condump filename.txt it will save the consol as .txt (open it with wordpad and not notepad it's allway beter).

okay , let's look the first part of a script: it's the game variable (the help are in red)

game_init

{

spawn

{

mapdescription "Team Red has to steal the suitcase and escape with it."

number_of_objectives 2   // the numbers of objective the map has. 0-6

set_objective_status 1 "2" //it set the status of the HUD icon for the objective 0=none 1=red 2=blue

set_objective_status 2 "2"

objective_red_desc 1 "Take the suitcase"

objective_red_desc 2 "Escape with the suitcase"

objective_blue_desc 1 "Prevent Red from stealing the suitcase"

objective_blue_desc 2 "Prevent Red from escaping with the suitcase"

objective_image 1 "mission/pics/ob1.tga"

objective_image 2 "mission/pics/ob2.tga"

set_red_inventory 3 // 0=none 1=bomb    2=defuse pliers

set_blue_inventory 3

red_respawntime 1

blue_respawntime 1

set_mission_time 15

setwinner 1

}

in this exemple i've remove all the unused lines. personaly i prefere it like this but take the time to look at the info in the original script file. There is some other games variable:

set_ mission_rounds # //number of rounds

set_mission_caps # //number of capture limit

set_mission_frag # // fraglimit

set_mission_lives # // number of lives

Now lets see the second part of the same script (it's about the suitcase)

setwinner 1// here think to look at the syntax. keep the same structure in your script.

}

trigger objective2

{

set_objective_status 2 "1"

broadcast "Red escaped with the suitcase" // use broadcast to print something at the screen

setwinner 1 // who won if it happen 1=red 2=blue

}

trigger blue_object_stolen

{

broadcast "The suitcase has been taken"

set_objective_status 1 "1"

}

trigger blue_object_dropped

{

broadcast "The suitcase carrier has been fraged"

set_objective_status 1 "0"

}

trigger blue_object_returned

{

broadcast "The suitcase has returned :)"

set_objective_status 1 "2"

}

}

SuitCase // here the name is important cause it call what u put in the .ent and the .items. the name is important for the bomb too. keep the structure of the file as clean as possible.

{

spawn

{

goalnumber 1 // this is the number of the objective

goal_state 2 //when set to  1= active/used  2=idle waiting to be used  3=hidden(idle and hidden)

team 1 // set the team of goal 1=red 2=blue

goal_activation 4 // this is how we activate the goal: 1=by touch 2=C4 damage 4=drop ot on death 8=by damage 16=by grenade damage

}

details

{

if_AP_IsTeam 1 // team that can activate this goal 1=red 2=blue

}

faildetails

{

broadcastAP "Only Team Red may pick the suitcase up!"

}

pickup

{

trigger game_init blue_object_stolen

}

drop

{

trigger game_init blue_object_dropped

}

respawn

{

trigger game_init blue_object_returned

}

}

Now let's see the exit

exit //here the name call the func_static who have the key "script : exit"

{

spawn

{

goalnumber 2

goal_state 2

goal_activation 1

goal_result 4 // What to do when activated, end level

IsTrigger 2  //1=non solid  2=non solid and invisible (if the poly who set the exit aera is solid you won't be able to exit)

}

details

{

need_item 1 // Item you must have to activate this goal

}

faildetails

{

broadcastAP "You need the suitcase!"

}

touch

{

trigger game_init objective2 // here we jump to the trigger 2 cause it have "setwinner 1" if the objective is done

}

}

Now i give an exmple of a bomb (from bahamut). all the bomb have the same structure, you juste have to change the variable.

Press

{

spawn

{

goalnumber 1

goal_state 2

goal_activation 2

}

death

{

set_objective_status 1 "1"

broadcast "The printing press has been destroyed"

}

}