Random starting spots for objectives are the coolest things


(Ifurita) #1

Random starting spots for objectives are the coolest things I’ve come across in a long long time. I’ve been working with Mean Mr. Mustard and Seven_DC (among others) on Vengeance. One of the things we’ve added is a random starting point for the objectives. They start in one of 3 ammo bunkers and the CM icon is turned on or off depending on whether the door is built. The Axis have to blow each door until they find the objectives and the Allied can turn the icons off (for those Axis not paying attention) by building the door again. Allies do not know where the objectives are at game start.

The really sweet thing about is, for comp play, you probably don’t want random starting points - no problem, you just comment out one line, and edit one value in another, and you can set the starting point in any one of the 3 bunkers. Here’s the code in case anyone is interested. Big kudos to Mustard for the scripting:


game_manager
{
	spawn 
   	{

		// Randomly places fail safe codes into one of three bunkers
		accum 3 set 0
		accum 3 random 3

		accum 3 trigger_if_equal 0 warhead_pick1 activate
		accum 3 trigger_if_equal 1 warhead_pick2 activate
		accum 3 trigger_if_equal 2 warhead_pick3 activate
	}
}
//End of Game_manager section

// ============================================================================ 
// Random points for fail safe pickups =========================================
// Mean Mr Mustard: 04-04-2004 ================================================
// ============================================================================

warhead_pick1
{
	spawn
	{
		wait 100
	}

	trigger activate
	{
		setstate warhead_trigger default
		setstate warhead_cmarker invisible
		trigger warhead_pick2 kill
		trigger warhead_pick3 kill
	}

	trigger kill
	{
		setstate warhead_trigger 		invisible
		remove
	}
}

warhead_pick2
{
	spawn
	{
		wait 100
	}

	trigger activate
	{
		setstate warhead_trigger2 default
		setstate warhead_cmarker2 invisible
		trigger warhead_pick1 kill
		trigger warhead_pick3 kill
	}

	trigger kill
	{
		setstate warhead_trigger2 		invisible
		remove
	}
}

warhead_pick3
{
	spawn
	{
		wait 100
	}

	trigger activate
	{
		setstate warhead_trigger3 default
		setstate warhead_cmarker3 invisible
		trigger warhead_pick1 kill
		trigger warhead_pick2 kill
	}

	trigger kill
	{
		setstate warhead_trigger3 		invisible
		remove
	}
}

// ============================================================================ 
// CONSTRUCTIBLE BARRIERS =====================================================
// ============================================================================ 

//Ammo Bunker Door #1

ammobunkerdoor_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 2 
		trigger self startup 
	} 

	buildstart final 
	{ 
	} 

	built final 
	{ 
		setstate ammobunkerdoor_target default
		setstate ammobunkerdoor_materials invisible 
		setstate warhead_cmarker invisible

		wm_announce "Ammo Bunker #1 Door has been built" 

		wm_objective_status	2 0 2
		wm_objective_status	2 1 1
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{ 
		setstate ammobunkerdoor_materials default
		setstate ammobunkerdoor_target invisible
		setstate warhead_cmarker default

		wm_announce "The Axis have breached Ammo Bunker #1" 

		wm_objective_status	2 0 1
		wm_objective_status	2 1 2
	} 

	trigger startup 
	{ 
		setstate ammobunkerdoor_target default
		setstate ammobunkerdoor_materials invisible 
	} 
}

//Ammo Bunker Door #2

ammobunkerdoor2_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 2 
		trigger self startup 
	} 

	buildstart final 
	{ 
	} 

	built final 
	{ 
		setstate ammobunkerdoor2_target default
		setstate ammobunkerdoor2_materials invisible 
		setstate warhead_cmarker2 invisible

		wm_announce "Ammo Bunker #2 Door has been built" 

		wm_objective_status	2 0 2
		wm_objective_status	2 1 1
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{ 
		setstate ammobunkerdoor2_materials default
		setstate ammobunkerdoor2_target invisible
		setstate warhead_cmarker2 default

		wm_announce "The Axis have breached Ammo Bunker #2" 

		wm_objective_status	2 0 1
		wm_objective_status	2 1 2
	} 

	trigger startup 
	{ 
		setstate ammobunkerdoor2_target default
		setstate ammobunkerdoor2_materials invisible 
	} 
}

//Ammo Bunker Door #3

ammobunkerdoor3_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 2 
		trigger self startup 
	} 

	buildstart final 
	{ 
	} 

	built final 
	{ 
		setstate ammobunkerdoor3_target default
		setstate ammobunkerdoor3_materials invisible 
		setstate warhead_cmarker3 invisible

		wm_announce "Ammo Bunker Door #3 has been built" 

		wm_objective_status	2 0 2
		wm_objective_status	2 1 1
	} 

	decayed final 
	{ 
		trigger self startup 
	} 

	death 
	{ 
		setstate ammobunkerdoor3_materials default
		setstate ammobunkerdoor3_target invisible
		setstate warhead_cmarker3 default

		wm_announce "The Axis have breached Ammo Bunker #3" 

		wm_objective_status	2 0 1
		wm_objective_status	2 1 2
	} 

	trigger startup 
	{ 
		setstate ammobunkerdoor3_target default
		setstate ammobunkerdoor3_materials invisible 
	} 
}

I think I got it all