invalid number of objectives/invalid objective number


([DeaD]-SLOTH-) #1

yeah… ive tried switching tons of things around and stuff and havent been able to fix this
I’m pretty sure it has something to do with the allied command post, because when i comment out the

wm_objective_status 10 1 0
&
wm_objective_status 10 0 0

and lower the number of objectives one, the map will play, yet when i build the ally cp, it crashes and says “invalid objective number”.

here’s my script, maybe someone can help :frowning: :banghead:

//
//Brush Scripting
//Map:ds_bunkers
//Last edited by: sam "[DeaD]-SLOTH-" mcgregor
//

game_manager
{
	spawn
	{
		accum 1 set 0		// axis win both stashes destroyed -- if 2
		accum 2 set 0		// allies win both weapons destroyed -- if 2
		accum 3 set 0		// Current number of Allied supply stashes destroyed
		accum 4 set 0		// Current number of Axis secret weapons destroyed
		accum 5 set 0		// axis comm post
		accum 6 set 0		// allied comm post

		globalaccum 3 set 0
		globalaccum 4 set 0

		// Game rules
		wm_axis_respawntime	25
		wm_allied_respawntime	25
		wm_number_of_objectives 10
		wm_set_round_timelimit	30

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

		// Objective overview status indicators
		//obj 2=ally stash 1
		//obj 3=ally stash 2
		//obj 4=axis weapon 1
		//obj 5=axis weapon 2
		//obj 6=forward spawn
		//obj 7=axis hatch
		//obj 8=allied hatch
		//obj 9=axis comm post
		//obj 10=allied comm post
		//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
		wm_objective_status 7 1 0
		wm_objective_status 7 0 0
		wm_objective_status 8 1 0
		wm_objective_status 8 0 0
		wm_objective_status 9 1 0
		wm_objective_status 9 0 0
		wm_objective_status 10 1 0
		wm_objective_status 10 0 0

		wait 200

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

		// If the round timer expires, the Axis have won, so set the current winning team
		// Set the round winner:  0 == AXIS, 1 == ALLIED -1 = neither
		wm_setwinner -1

		wait 200


	}

		trigger allied_stash_counter
	{
		accum 3 inc 1						// Increase game counter
		accum 3 abort_if_not_equal 2		// All stashes destroyed ?

		wm_announce	"Axis have destroyed both Allied Supply Stashes!"

		wait 2000

		accum 1 set 1				// Both stashes destroyed

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

	trigger checkgame_stashes
	{
		accum 1 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		// End the round
		wm_endround

	}

			trigger axis_secretweapon_counter
	{
		accum 4 inc 1						// Increase game counter
		accum 4 abort_if_not_equal 2		// All weapons destroyed ?

		wm_announce	"Allies have destroyed both Axis Secret Weapons!"

		wait 2000

		accum 2 set 1				// Both weapons destroyed

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

	trigger checkgame_secretweapons
	{
		accum 2 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End the round
		wm_endround

	}
}

	//FORWARD SPAWN FLAG*****************************************
	//***********************************************************

forwardflag
{
	spawn
	{
		accum 0 set -1	// Who has the flag: 0-Axis, 1-Allied
	}

	trigger axis_capture	// Flag has been touched by an Axis player
	{
		accum 0 abort_if_equal 0 // do Axis own flag?

		accum 0 set 0 // Axis own the pole
		wm_announce	"Axis have captured the Forward Spawn"

		wait 200

		setautospawn "Forward Spawn"	0
		setautospawn "Allied Spawn"		1

		wait 150

		wm_axis_respawntime		20
		wm_allied_respawntime	25

		wait 150

		wm_setwinner 0

		wait 150

		wm_objective_status 		6 0 1
		wm_objective_status 		6 1 2

		alertentity forwardspawn_wobj
	}

	trigger allied_capture	// Flag has been touched by an allied player
	{
		accum 0 abort_if_equal 1 // do Allies own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies have captured the Forward Spawn!"

		wait 200

		setautospawn "Forward Spawn"	1
		setautospawn "Axis Spawn"		0

		wait 150

		wm_axis_respawntime		25
		wm_allied_respawntime	20

		wait 150

		wm_setwinner 1

		wait 150

		wm_objective_status 		6 0 2
		wm_objective_status 		6 1 1

		alertentity forwardspawn_wobj
	}
}

//AXIS COMMAND POST ********************************************
//**************************************************************

axis_radio_destroyed
{
   spawn
   {
      wait 400
      setstate axis_radio_destroyed invisible
      setstate axis_radio_destroyed_model invisible
   }

   trigger hide
   {
      setstate axis_radio_destroyed invisible
      setstate axis_radio_destroyed_model invisible
   }

   trigger show
   {
      accum 5 abort_if_equal 0
      setstate axis_radio_destroyed default
      setstate axis_radio_destroyed_model default
   }

   trigger enable
   {
      accum 5 set 1
   }
}

axis_radio_closed
{
   trigger hide
   {
      setstate axis_radio_closed invisible
      setstate axis_radio_closed_model invisible
   }

   trigger show
   {
      accum 5 abort_if_equal 1
      setstate axis_radio_closed default
      setstate axis_radio_closed_model default
   }

   trigger disable
   {
      accum 5 set 1
   }
}

axis_radio_built
{
   spawn
   {
      wait 400

      constructible_class 2

      trigger axis_radio_built setup
   }

   trigger setup
   {
      setchargetimefactor 0 soldier 1
      setchargetimefactor 0 lieutenant 1
      setchargetimefactor 0 medic 1
      setchargetimefactor 0 engineer 1
      setchargetimefactor 0 covertops 1
      sethqstatus 0 0
   }

   buildstart final
   {
      trigger axis_radio_built_model trans

      trigger axis_radio_destroyed hide
      trigger axis_radio_closed    hide
   }

   built final
   {
      trigger axis_radio_built_model show

      trigger axis_radio_destroyed enable
      trigger axis_radio_closed    disable

      trigger axis_radio_built_model enable_axis_features

      enablespeaker axis_compost_sound
   }

   decayed final
   {
      trigger axis_radio_built_model hide

      trigger axis_radio_destroyed show
      trigger axis_radio_closed    show
   }

   death
   {
      trigger axis_radio_built_model hide

      trigger axis_radio_destroyed show

      trigger axis_radio_built_model disable_axis_features

      disablespeaker axis_compost_sound
   }
}

axis_radio_built_model
{
   spawn
   {
      wait 400
      setstate axis_radio_built_model invisible
   }

   trigger show
   {
      setstate axis_radio_built_model default
   }

   trigger hide
   {
      setstate axis_radio_built_model invisible
   }

   trigger trans
   {
      setstate axis_radio_built_model underconstruction
   }

   trigger enable_axis_features
   {
      setchargetimefactor 0 soldier 0.75
      setchargetimefactor 0 lieutenant 0.75
      setchargetimefactor 0 medic 0.75
      setchargetimefactor 0 engineer 0.75
      setchargetimefactor 0 covertops 0.75
      sethqstatus 0 1

      wm_announce   "Axis Command Post constructed. Charge speed increased!"

      // *----------------------------------- vo ------------------------------------------*
      wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

      wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

      wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
      // *----------------------------------- vo ------------------------------------------*

      wm_objective_status 9 1 2
      wm_objective_status 9 0 1

   }

   trigger disable_axis_features
   {
      // Some kind of UI pop-up to alert players
      wm_announce   "Allied team has destroyed the Axis Command Post!"

      // *----------------------------------- vo ------------------------------------------*
      wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

      wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
      // *----------------------------------- vo ------------------------------------------*

      setchargetimefactor 0 soldier 1
      setchargetimefactor 0 lieutenant 1
      setchargetimefactor 0 medic 1
      setchargetimefactor 0 engineer 1
      setchargetimefactor 0 covertops 1
      sethqstatus 0 0

      wm_objective_status 9 1 0
      wm_objective_status 9 0 0
   }
}

//ALLIED COMMAND POST ********************************************
//**************************************************************

allied_radio_destroyed
{
   spawn
   {
      wait 400
      setstate allied_radio_destroyed invisible
      setstate allied_radio_destroyed_model invisible
   }

   trigger hide
   {
      setstate allied_radio_destroyed invisible
      setstate allied_radio_destroyed_model invisible
   }

   trigger show
   {
      accum 6 abort_if_equal 0
      setstate allied_radio_destroyed default
      setstate allied_radio_destroyed_model default
   }

   trigger enable
   {
      accum 6 set 1
   }
}

allied_radio_closed
{
   trigger hide
   {
      setstate allied_radio_closed invisible
      setstate allied_radio_closed_model invisible
   }

   trigger show
   {
      accum 6 abort_if_equal 1
      setstate allied_radio_closed default
      setstate allied_radio_closed_model default
   }

   trigger disable
   {
      accum 6 set 1
   }
}

allied_radio_built
{
   spawn
   {
      wait 400

      constructible_class 2

      trigger allied_radio_built setup
   }

   trigger setup
   {
      setchargetimefactor 1 soldier 1
      setchargetimefactor 1 lieutenant 1
      setchargetimefactor 1 medic 1
      setchargetimefactor 1 engineer 1
      setchargetimefactor 1 covertops 1
      sethqstatus 1 0
   }

   buildstart final
   {
      trigger allied_radio_built_model trans

      trigger allied_radio_destroyed hide
      trigger allied_radio_closed    hide
   }

   built final
   {
      trigger allied_radio_built_model show

      trigger allied_radio_destroyed enable
      trigger allied_radio_closed    disable

      trigger allied_radio_built_model enable_allied_features

      enablespeaker allied_compost_sound
   }

   decayed final
   {
      trigger allied_radio_built_model hide

      trigger allied_radio_destroyed show
      trigger allied_radio_closed    show
   }

   death
   {
      trigger allied_radio_built_model hide

      trigger allied_radio_destroyed show

      trigger allied_radio_built_model disable_allied_features

      disablespeaker allied_compost_sound
   }
}

allied_radio_built_model
{
   spawn
   {
      wait 400
      setstate allied_radio_built_model invisible
   }

   trigger show
   {
      setstate allied_radio_built_model default
   }

   trigger hide
   {
      setstate allied_radio_built_model invisible
   }

   trigger trans
   {
      setstate allied_radio_built_model underconstruction
   }

   trigger enable_allied_features
   {
      setchargetimefactor 1 soldier 0.75
      setchargetimefactor 1 lieutenant 0.75
      setchargetimefactor 1 medic 0.75
      setchargetimefactor 1 engineer 0.75
      setchargetimefactor 1 covertops 0.75
      sethqstatus 1 1

      wm_announce   "Allied Command Post constructed. Charge speed increased!"

      // *----------------------------------- vo ------------------------------------------*
      wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

      wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

      wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
      // *----------------------------------- vo ------------------------------------------*

      wm_objective_status 10 1 2
      wm_objective_status 10 0 1

   }

   trigger disable_allied_features
   {
      // Some kind of UI pop-up to alert players
      wm_announce   "Axis team has destroyed the Allied Command Post!"

      // *----------------------------------- vo ------------------------------------------*
      wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

      wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
      // *----------------------------------- vo ------------------------------------------*

      setchargetimefactor 1 soldier 1
      setchargetimefactor 1 lieutenant 1
      setchargetimefactor 1 medic 1
      setchargetimefactor 1 engineer 1
      setchargetimefactor 1 covertops 1
      sethqstatus 1 0

      wm_objective_status 10 1 0
      wm_objective_status 10 0 0
   }
}


//allied mg42 ***************************************************
//***************************************************************
allied1_mg42_script
{
   spawn
   {
      wait 200
      constructible_class 2
      trigger self startup
   }

   buildstart final
   {
   }

   built final
   {
      setstate allied1_mg42_extra default
      setstate allied1_mg42_object default
      setstate allied1_mg42 invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "The Allied team has built the Allied MG-42!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "The Axis team has destroyed the Allied MG-42!"
   }

   trigger startup
   {
      setstate allied1_mg42_extra invisible
      setstate allied1_mg42_object invisible
      setstate allied1_mg42 default
      repairmg42 allied1_mg42_object
   }
}

//axis mg 42*****************************************
//***************************************************
axis1_mg42_script
{
   spawn
   {
      wait 200
      constructible_class 2
      trigger self startup
   }

   buildstart final
   {
   }

   built final
   {
      setstate axis1_mg42_extra default
      setstate axis1_mg42_object default
      setstate axis1_mg42 invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "The Axis team has built the Axis MG-42!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "The Allied team has destroyed the Axis MG-42!"
   }

   trigger startup
   {
      setstate axis1_mg42_extra invisible
      setstate axis1_mg42_object invisible
      setstate axis1_mg42 default
      repairmg42 axis1_mg42_object
   }
}

//axis defensive barrier**********************
//********************************************
axis1_backgate_script // scriptname in func_constructible
{
   spawn
   {
      wait 200
      constructible_class 1
      constructible_health 700
      trigger self startup
   }

   buildstart final
   {
   }

   built final
   {
      setstate axis1_backgate default
      setstate axis1_backgate invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "Axis team has built the Axis Defensive Barrier!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "Allied team has destroyed the Axis Defensive Barrier!"
   }

   trigger startup
   {
      setstate axis1_backgate invisible
      setstate axis1_backgate default
   }
}

//allied defensive barrier********************
//********************************************
allied1_backgate_script // scriptname in func_constructible
{
   spawn
   {
      wait 200
      constructible_class 1
      constructible_health 700
      trigger self startup
   }

   buildstart final
   {
   }

   built final
   {
      setstate allied1_backgate default
      setstate allied1_backgate invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "Allied team has built the Allied Defensive Barrier!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "Axis team has destroyed the Allied Defensive Barrier!"
   }

   trigger startup
   {
      setstate allied1_backgate invisible
      setstate allied1_backgate default
   }
}

//allied supply stash 1******************************
//***************************************************

game_manager
{
   spawn
   {
   }
}

allied1_stash
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Axis have destroyed the First Allied Supply Stash!"

      	wm_objective_status 		2 0 1
		wm_objective_status 		2 1 2

		wm_set_main_objective	3 0
		wm_set_main_objective	3 1

		// Update game manager counter for objectives
		trigger game_manager allied_stash_counter
   }
}

//allied supply stash 2********************************
//*****************************************************

game_manager
{
   spawn
   {
   }
}

allied2_stash
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Axis have destroyed the Second Allied Supply Stash!"

      	wm_objective_status 		3 0 1
		wm_objective_status 		3 1 2

		// Update game manager counter for objectives
		trigger game_manager allied_stash_counter
   }
}

//axis secret weapon 1******************************
//***************************************************

game_manager
{
   spawn
   {
   }
}

axis1_secretweapon
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Allies have destroyed the First Axis Secret Weapon!"

      	wm_objective_status 		4 1 1
		wm_objective_status 		4 0 2

		wm_set_main_objective	5 0
		wm_set_main_objective	5 1

		// Update game manager counter for objectives
		trigger game_manager axis_secretweapon_counter
   }
}

//axis secret weapon 2********************************
//*****************************************************

game_manager
{
   spawn
   {
   }
}

axis2_secretweapon
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Allies have destroyed the Second Axis Secret Weapon!"

      	wm_objective_status 		5 1 1
		wm_objective_status 		5 0 2

		// Update game manager counter for objectives
		trigger game_manager axis_secretweapon_counter
   }
}

//axis main hatch********************************
//*****************************************************

game_manager
{
   spawn
   {
   }
}

axis1_mainhatch
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Allies have destroyed the Axis Main Hatch!"

      	wm_objective_status 		7 1 1
		wm_objective_status 		7 0 2
   }
}

//allied main hatch********************************
//*****************************************************

game_manager
{
   spawn
   {
   }
}

allied1_mainhatch
{
   spawn
   {
      wait 200
      constructible_class 3
   }
   death
   {
      wm_announce "Axis have destroyed the Allied Main Hatch!"

      	wm_objective_status 		8 1 2
		wm_objective_status 		8 0 1
   }
}


(evillair) #2

I think there’s a max of 8 objectives, I may be wrong though. Comment out 2 random ones and see if that works.


([DeaD]-SLOTH-) #3

hmmm that makes sense…
thanks.


([DeaD]-SLOTH-) #4

also, my forward spawn works but there isnt any flag on the map…

im suspicious that this has something to do with the spawnflags in the team_wolf_objective… because i dont want it to belong to anyone at the beginning of the match


(DeAtHmAsTeR) #5

aparently you can only have 8 obj;s