map wont end


(cookie_box) #1

my map wont end after all main objectives are destroyed :eek: , here is my script:

game_manager
{
spawn
{

// Game rules
wm_axis_respawntime 18
wm_allied_respawntime 14
wm_number_of_objectives 8
wm_set_round_timelimit 30

// Objectives
// 1: S20
// 2: S21
// 3: S34
// 4: S27
// 5: Main gate
// 6: Side wall

// Objective overview status indicators
//wm_objective_status <objective> <team (0=Axis, 1=Allies)> <status (0=neutral 1=complete 2=failed)>
wm_objective_status 1 1 0
wm_objective_status 1 0 0
wm_objective_status 2 1 0
wm_objective_status 2 0 0
wm_objective_status 3 1 0
wm_objective_status 3 0 0
wm_objective_status 4 1 0
wm_objective_status 4 0 0
wm_objective_status 5 1 0
wm_objective_status 5 0 0
wm_objective_status 6 1 0
wm_objective_status 6 0 0

globalaccum 1 set 0
globalaccum 2 set 0
globalaccum 3 set 0
globalaccum 4 set 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 for everything to settle
wait 1000
}

trigger allies_win
{
globalaccum 1 abort_if_not_equal 1
globalaccum 2 abort_if_not_equal 1
globalaccum 3 abort_if_not_equal 1
globalaccum 4 abort_if_not_equal 1

  wm_setwinner 1
  wait 5000
  wm_endround

}
}

// ================================================
// ============ Eboats ==============
// ================================================

S27
{
spawn
{
wait 200
trigger S27 setup
constructible_class 3
}
trigger setup
{
setstate S27 invisible

  setstate S27 default

}
death
{
setstate S27 default

  setstate S27 invisible

  globalaccum 1 set 1		

  wm_announce	"The allies have destroyed S27!"

  trigger game_manager allies_win	

}
}

S34
{
spawn
{
wait 200
trigger S34 setup
constructible_class 3
}
trigger setup
{
setstate S34 invisible

  setstate S34 default

}
death
{
setstate S34 default

  setstate S34 invisible

  globalaccum 2 set 1		

  wm_announce	"The allies have destroyed S34!"

  trigger game_manager allies_win	

}
}

S21
{
spawn
{
wait 200
trigger S21 setup
constructible_class 3
}
trigger setup
{
setstate S21 invisible

  setstate S21 default

}
death
{
setstate S21 default

  setstate S21 invisible

  globalaccum 3 set 1		

  wm_announce	"The allies have destroyed S21!"

  trigger game_manager allies_win	

}
}

S20
{
spawn
{
wait 200
trigger S20 setup
constructible_class 3
}
trigger setup
{
setstate S20 invisible

  setstate S20 default

}
death
{
setstate S20 default

  setstate S20 invisible

  globalaccum 4 set 1		

  wm_announce	"The allies have destroyed S20!"

  trigger game_manager allies_win	

}
}

//////////////////////////////////entrances////////////////////////////////////////

side_wall
{
spawn
{
wait 200
trigger side_wall setup
constructible_class 3
}
trigger setup
{
setstate side_wall invisible

  setstate side_wall default

}
death
{
setstate side_wall default

  setstate side_wall invisible
  

  wm_announce	"The allies have destroyed the side wall!"

}
}

gate
{
spawn
{
wait 200
trigger gate setup
constructible_class 3
}
trigger setup
{
setstate gate invisible

  setstate gate default

}
death
{
setstate gate default

  setstate gate invisible
  

  wm_announce	"The allies have destroyed the main gate!"

}
}


(nUllSkillZ) #2

It should end after 5 seconds (the “wait 5000” time).
You should remove this action.

There are some other “mistakes” in the script.
Some of the “setstate” actions are not needed.

Also the “wm_objective_status” aren’t actualised.


(cookie_box) #3

should i remove the whole “wait 5000”


(nUllSkillZ) #4

Just comment it out:


trigger allies_win
{
	globalaccum 1 abort_if_not_equal 1
	globalaccum 2 abort_if_not_equal 1
	globalaccum 3 abort_if_not_equal 1
	globalaccum 4 abort_if_not_equal 1

	wm_setwinner 1
	//wait 5000
	wm_endround
}


(Flippy) #5

why comment it out? he can just as well delete it? saves another 11 bytes from the script size…:stuck_out_tongue: