Here’s what I think the script would look like – working from a very shoddy memory, haven’t done any scripting in more than 2 years.
This would just (for one flag) increment a counter (globalaccum 1) by 1 every time the allies capture a flag and decrement it by 1 whenever the axis capture a flag, and then call a subroutine to adjust the wm_setwinner if the number of flags under allied control is the right number.
//Objective counter and game win check scripts
trigger winstatus //Completion of Allied objectives
{
GLOBALACCUM 1 ABORT_IF_EQUAL 0
WM_SETWINNER 1
}
and the following is a fairly standard forward spawn script with my changes added in CAPS
forward_spawn
{
spawn
{
wait 200
accum 0 set 0 // Who has the flag: 0-Axis, 1-Allied
}
trigger axis_capture
{
accum 0 abort_if_equal 0
accum 0 set 0
GLOBALACCUM 1 INC -1
TRIGGER GAME_MANAGER WINSTATUS
// Change the objective state internally, so UI can update, etc.
// Axis takes control of forward flag
// Some kind of UI pop-up to alert players
wm_announce "Axis capture the Forward spawn!"
wm_objective_status 8 1 2
wm_objective_status 8 0 1
alertentity forwardflag_wobj
// *----------------------------------- vo ------------------------------------------*
wm_teamvoiceannounce 0 "rommel_axis_bunker_reclaimed"
wm_teamvoiceannounce 1 "rommel_allies_bunker_reclaimed"
// *---------------------------------------------------------------------------------*
}
trigger allied_capture
{
accum 0 abort_if_equal 1
accum 0 set 1
GLOBALACCUM 1 INC 1
TRIGGER GAME_MANAGER WINSTATUS
// Change the objective state internally, so UI can update, etc.
// Allied takes control of forward flag
// Some kind of UI pop-up to alert players
wm_announce "Allies capture the Forward spawn!"
wm_objective_status 8 1 1
wm_objective_status 8 0 2
alertentity forwardflag_wobj
// *----------------------------------- vo ------------------------------------------*
wm_teamvoiceannounce 0 "rommel_axis_bunker_captured"
wm_teamvoiceannounce 1 "rommel_allies_bunker_captured"
// *---------------------------------------------------------------------------------*
}
}