//
//Brush Scripting
//Map: obtest
//created by eyeronik
//

game_manager - the name of the script we told our our "script multiplayer" to look for
{
spawn
{
// Set scenario information

wm_mapdescription "allies must destroy percy and tommy. axis must defend percy and tommy at all costs" - this is the description of the map what will appear in game

wm_axis_respawntime 25 - how long it takes the axis to respawn,
wm_allied_respawntime 20 - same as above only for allies

wm_number_of_objectives 2 - we have 2 objectives, "percy" and "tommy", so its 2 obviously

wm_set_round_timelimit 15 - how long each round lasts, ive put 15, so thats 15 minutes a round

// Set objective #1 properties

// axis control objective #1 at the start
wm_set_objective_status 1 0 - the "1" means objective 1 in this case, the "0" after it means the "axis" control it at start, as "allies" means "1" and "axis" is "0" for that column, as you can see it says "0" in the right column, so that means axis, if it had a "1" in that columnm, it would mean the allies controlled it at start as there defined as "1" in that column, sounds a bit confusing, but youll understand it later

wm_set_objective_status 2 0 - objective 2, owned by "axis" as you can see it has a "0" on the right side

wm_objective_axis_desc 1 "Primary Objective:**Defend percy at all costs." - description for the axis for objective 1, displayed in game

wm_objective_axis_desc 2 "Primary Objective:**Defend tommy, must be saved to ensure the continued plight of tom boy." - description for the axis for objective 2, displayed in game, you should leave in the ** or it prolly wont work

wm_objective_allied_desc 1 "Primary Objective:**Destroy percy, this is vital, without percy the axis are fooked." - description for the allies for objective 1, displayed in game

wm_objective_allied_desc 2 "Primary Objective:**Destroy tommy, tom boy is there pride and joy, take it out!." - description for the allies for objective 1, displayed in game


wm_objective_image 1 "gfx/2d/mp_objectives/base_obj_2.tga" // NERVE - MBJ
wm_objective_image 2 "gfx/2d/mp_objectives/base_obj_1.tga" // NERVE - MBJ - these are both what pictures appear in the boxes in the game menu, ive left these as the mp_base ones, just so its not blank, you can make your own for your map and change the path to reflect where you put yours. I heard that they must be 24bit images or it will crash.


wm_overview_image "video/mp_base.roq" - the video file that runs, ive left it as the mp_base one, just so for this example its not blank.

// SHORT DESCRIPTIONS

wm_objective_short_axis_desc 1 "Defend percy"
wm_objective_short_axis_desc 2 "Defend tommy"

- as it suggests, short description's that appear in menu for axis, you can put what you want in these text things, its doesnt relate to the objective names in any way, i could put "Defend the ass" if i wanted.

wm_objective_short_allied_desc 1 "Destroy percy"
wm_objective_short_allied_desc 2 "Destroy tommy"

- as it suggests, short description's that appear in menu for allies

// Set Defending Team for SW Mode

wm_set_defending_team 0 - this means defending side is the axis in stopwatch mode.

// If the round timer expires, the Nazis have won, so set the current winning team
// Set the round winner: 0 == AXIS, 1 == ALLIED
wm_setwinner 0 - this means the axis will win if the timer runs out

// Accum #1 will be the state of objective number one
accum 1 set 0
accum 2 set 0
}

trigger objective_1 - our objective_1 trigger
{
// Change the objective state internally, so UI can update, etc.
// Allied takes control of objective #1
wm_set_objective_status 1 1 - allies have objective "1", allies are number "1" on the right hand column remember, and the first "1" here means objective 1, if it said 1 0 that would mean axis would of taken control of the objective, as axis as number "0" on that right hand side

// Change the variable within the script so that we can check if someone wins the round
accum 1 set 1

// Some kind of UI pop-up to alert players
wm_announce "Allied team has destroyed percy!! no!!!!" - this comes on screen when the allies destroy objective 1

// Call function to check if the round has been won
trigger game_manager checkgame - this checks to see if this is end of game or not
}

trigger objective_2 0 - our second objective script starts
{
// Change the objective state internally, so UI can update, etc.
// Allied takes control of objective #2
wm_set_objective_status 2 1 - "2" here means objective "2", "1" means allies have won it, as before, if it saud 2 0, that would mean the axis have taken control if you are making a axis objective you might want to use that.

// Change the variable within the script so that we can check if someone wins the round
accum 2 set 1

// Some kind of UI pop-up to alert players
wm_announce "Allied team has killed tommy!!! waaaaaaaaaa!!" - this comes on screen when the allies destroy objective 2

// Call function to check if the round has been won
trigger game_manager checkgame
}

trigger checkgame
{
accum 1 abort_if_not_equal 1
accum 2 abort_if_not_equal 1

// Set the round winner: 0 == AXIS, 1 == ALLIED
wm_setwinner 1 - I just left this as if from mp_base, to set the round winner as allies if they destroy the objectives.

wait 1500 - wait before the finish screen comes up, the end of round

// End the round
wm_endround
}
}

percy_obj1 // - this is what we said our scriptname is in our map remember, this is the script it follows, our objective 1 had this as its "scriptname"
{
spawn
{
}

death
{
trigger game_manager objective_1 - essential piece, tells it percy_obj1, is objective 1, so it can follow the correct parts of the script
}
}

tommy_obj2 //
{
spawn
{
}

death
{
trigger game_manager objective_2 - essential piece too, tells it tommy_obj2, is objective 2, so it can follow the correct parts of the script

}
}