Objective scripting, is this possible?


(Apple) #1

I’d like to create a dual objective map where one of the objectives doesn’t spawn untill the first has been capped. Think of Gold Rush for instance where you have two crates of gold, I’d like to set it up where the second gold crate doesn’t spawn untill the first has been secured on the truck. Is this possible?

I already have the scripting done for the two crates:


game_manager
{
	spawn
   	{
		wm_axis_respawntime 20
		wm_allied_respawntime 20
		wm_set_round_timelimit 15
		wm_setwinner 0
		accum 1 set 0
	}

	trigger objective_counter
	{
		accum 1 inc 1
		trigger game_manager checkgame
	}

	trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 1
		wait 1500

		wm_endround
	}		
}

axis_gold1
{
	spawn
	{
		wait 200
		setstate axis_gold_captured1 invisible
	}

	trigger stolen
	{
		wm_announce "The Allies have stolen a gold crate!"
		setstate axis_gold_cm_marker invisible
	}

	trigger returned
	{
		wm_announce "The Axis have intercepted the stolen gold crate!"
		setstate axis_gold_cm_marker default
	}

	trigger captured
	{
		wm_announce "The Allies have secured a gold crate!"
		setstate axis_gold_red1 invisible
		setstate axis_gold_captured1 default
		setstate axis_gold_cm_marker default
	}
}

axis_gold2
{
	spawn
	{
		wait 200
		setstate axis_gold_captured2 invisible
	}

	trigger stolen
	{
		wm_announce "The Allies have stolen a gold crate!"
		setstate axis_gold_cm_marker invisible
	}

	trigger returned
	{
		wm_announce "The Axis have intercepted the stolen gold crate!"
		setstate axis_gold_cm_marker default
	}

	trigger captured
	{
		wm_announce "The Allies have secured a gold crate!"
		setstate axis_gold_red2 invisible
		setstate axis_gold_captured2 default
	}
}

truckbed_trigger
{
	spawn
	{
	}

	death
	{
				trigger game_manager objective_counter
	}
}

I’m just not sure what needs to be added in order for the second crate to not spawn at the beginning of the game, and instead spawn only once the first has been capped.

P.S. I’m not talking about the gold crate model, I’m talking about the flag itself.