PDA

View Full Version : script help 4 wm_endgame


shmol
11th September 2003, 19:48
hi, after several hours i gave up..

cant figure out hot to make the game manager assign the winner afer objective completed. plz help
here my script:
--------------
game_manager
{
spawn
{
// Game rules
wm_axis_respawntime 3
wm_allied_respawntime 2
wm_number_of_objectives 1
wm_set_round_timelimit 3

// Objectives
// 1: blow crate up

// Current main objectives for each team (0=Axis, 1=Allies)
wm_set_main_objective 1 0
wm_set_main_objective 1 1

//wm_objective_status <objective> <team (0=Axis, 1=Allies)>
//<status (0=neutral 1=complete 2=failed)>
wm_objective_status 1 0 0
wm_objective_status 1 1 0

// Stopwatch mode defending team (0=Axis, 1=Allies)
wm_set_defending_team 0

// Winner on expiration of round timer (0=Axis, 1=Allies)
wm_setwinner 0

wait 500
setautospawn "Axis Spawn" 0
setautospawn "Allied Spawn" 1
}
}

dynamite_obj
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Allies have blown up the object"
wm_objective_status 1 0 2
wm_objective_status 1 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
}
}

------------
can some1 give me url of scriptin docs and reference :)

Drakir
11th September 2003, 20:35
hi, after several hours i gave up..

cant figure out hot to make the game manager assign the winner afer objective completed. plz help
here my script:
--------------
game_manager
{
spawn
{
// Game rules
wm_axis_respawntime 3
wm_allied_respawntime 2
wm_number_of_objectives 1
wm_set_round_timelimit 3

// Objectives
// 1: blow crate up

// Current main objectives for each team (0=Axis, 1=Allies)
wm_set_main_objective 1 0
wm_set_main_objective 1 1

//wm_objective_status <objective> <team (0=Axis, 1=Allies)>
//<status (0=neutral 1=complete 2=failed)>
wm_objective_status 1 0 0
wm_objective_status 1 1 0

// Stopwatch mode defending team (0=Axis, 1=Allies)
wm_set_defending_team 0

// Winner on expiration of round timer (0=Axis, 1=Allies)
wm_setwinner 0

wait 500
setautospawn "Axis Spawn" 0
setautospawn "Allied Spawn" 1
}
}

dynamite_obj
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Allies have blown up the object"
wm_objective_status 1 0 2
wm_objective_status 1 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
}
}

------------
can some1 give me url of scriptin docs and reference :)


If u want scriping refs, check out the page at my site under tutorials.
But what u need is to add a winner when the thing goes boom.

Like this:

game_manager
{
spawn
{
// Game rules
wm_axis_respawntime 3
wm_allied_respawntime 2
wm_number_of_objectives 1
wm_set_round_timelimit 3

// Objectives
// 1: blow crate up

// Current main objectives for each team (0=Axis, 1=Allies)
wm_set_main_objective 1 0
wm_set_main_objective 1 1

//wm_objective_status <objective> <team (0=Axis, 1=Allies)>
//<status (0=neutral 1=complete 2=failed)>
wm_objective_status 1 0 0
wm_objective_status 1 1 0

// Stopwatch mode defending team (0=Axis, 1=Allies)
wm_set_defending_team 0

// Winner on expiration of round timer (0=Axis, 1=Allies)
wm_setwinner 0

wait 500
setautospawn "Axis Spawn" 0
setautospawn "Allied Spawn" 1
}

// Check if the game is over
trigger gameover
{
wm_setwinner 1
wait 1500
wm_endround
}
}

dynamite_obj
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Allies have blown up the object"
wm_objective_status 1 0 2
wm_objective_status 1 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
// This line trigger the part in "game_manager" above!
trigger game_manager gameover
}
}

Mean Mr. Mustard
11th September 2003, 20:37
Trying adding something like this to your game_manager. Then trigger it when the allies have one

trigger allies_win
{
wm_setwinner 1
wm_announce "Allied team has blown up the object!"

wm_objective_status 1 0 2
wm_objective_status 1 1 1

wait 1500
wm_endround
}



Something like this:
dynamite_obj
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Allies have blown up the object"
wm_objective_status 1 0 2
wm_objective_status 1 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
trigger game_manager allies_win
}
}


EDIT: damn, Drakir beat me to it :D

shmol
11th September 2003, 20:48
[quote="Drakir"][quote="shmol"]hi,
{smiles} looks so easy if u know how.

thz a lot for ur fast help.
ur site is great drakir was there
be4
nice support here {bigsmile}

cul8r