CTF Mode Scripting

Discussion for Admins of Banimod servers.<br>
If you don't run a server, please don't post here...

Moderators: Forum moderators, developers

Post Reply
duke'ku
Posts: 1053
Joined: Sun Nov 03, 2002 1:42 pm
Location: portland, oregon
Contact:

CTF Mode Scripting

Post by duke'ku »

I'm trying to script CTF for wildwestctf_beta. The flagpoles show up in the correct places, and only the two flagpoles, but no flags are on the flagpoles and no one can take the flags. Here are the scripts:

ORIGINAL CP SCRIPT

Code: Select all

// tutorial script for objective game


game_manager
&#123;
	spawn
	&#123;
		// Set scenario information

		wm_mapdescription			"Checkpoint&#58; Secure the town of El Drab."

		// time until reinforcements in seconds

		wm_axis_respawntime		1
		wm_allied_respawntime		1

		wm_number_of_objectives		5

		// Set time until round ends in minutes

		wm_set_round_timelimit		15

		// Set objective #1 properties

		// Nazi's control objective #1 at the start
		wm_set_objective_status		1	-1
		wm_objective_axis_desc		1	"Capture the Sheriff's Office."
		wm_objective_allied_desc	1	"Capture the Sheriff's Office."

		wm_set_objective_status		2	-1
		wm_objective_axis_desc		2	"Capture the Saloon."
		wm_objective_allied_desc	2	"Capture the Saloon."

		wm_set_objective_status		3	-1
		wm_objective_axis_desc		3	"Capture the Stables."
		wm_objective_allied_desc	3	"Capture the Stables."

		wm_set_objective_status		4	-1
		wm_objective_axis_desc		4	"Capture the El Drab Stage Coach."
		wm_objective_allied_desc	4	"Capture the El Drab Stage Coach."

		wm_set_objective_status		5	-1
		wm_objective_axis_desc		5	"Capture the underground stream."
		wm_objective_allied_desc	5	"Capture the underground stream."

		//wm_overview_image			"video/none.roq"

		wm_overview_image				"gfx/2d/mp_objectives/wildwest_over.tga"
		wm_objective_image			1	"gfx/2d/mp_objectives/wildwest_obj1.tga"
		wm_objective_image			2	"gfx/2d/mp_objectives/wildwest_obj2.tga"
		wm_objective_image			3	"gfx/2d/mp_objectives/wildwest_obj3.tga"
		wm_objective_image			4	"gfx/2d/mp_objectives/wildwest_obj4.tga"
		wm_objective_image			5	"gfx/2d/mp_objectives/wildwest_obj5.tga"

		// SHORT DESCRIPTIONS

		wm_objective_short_axis_desc	1	"Sheriff's Office"
		wm_objective_short_axis_desc	2	"Saloon"
		wm_objective_short_axis_desc	3	"Stables"
		wm_objective_short_axis_desc	4	"Stage Coach"
		wm_objective_short_axis_desc	5	"Underground Stream"

		wm_objective_short_allied_desc	1	"Sheriff's Office"
		wm_objective_short_allied_desc	2	"Saloon"
		wm_objective_short_allied_desc	3	"Stables"
		wm_objective_short_allied_desc	4	"Stage Coach"
		wm_objective_short_allied_desc	5	"Underground stream"

		// If the round timer expires, nobody wins
		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED, -1 == Noone
		wm_setwinner -1

		// Accum 1-6 will be the state of the checkpoints, -1 means nobody controls the flag
		accum 1 set -1
		accum 2 set -1
		accum 3 set -1
		accum 4 set -1
		accum 5 set -1

		// Accum 7 tracks the tide of battle
		accum 7 set 0
	&#125;

	// The following functions are called from the checkpoints when either team takes control of it

	trigger cp1_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #1
		wm_set_objective_status		1	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp1_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 1 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the Sherrif's Office!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp1_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #1
		wm_set_objective_status		1	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp1_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 1 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the Sherrif's Office!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp2_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #1
		wm_set_objective_status		2	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp2_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 2 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"cowboys take the Saloon!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp2_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #2
		wm_set_objective_status		2	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp2_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 2 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits takes the Saloon!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp3_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #3
		wm_set_objective_status		3	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp3_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 3 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the stables!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp3_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #3
		wm_set_objective_status		3	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp3_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 3 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the stables!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp4_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #4
		wm_set_objective_status		4	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp4_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 4 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the stage coach!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp4_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #4
		wm_set_objective_status		4	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp4_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 4 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the stage coach!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

trigger cp5_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #5
		wm_set_objective_status		5	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp5_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 5 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the underground stream!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

trigger cp5_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #5
		wm_set_objective_status		5	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp5_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 5 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the underground stream!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;



	// Check for game-winning condition

	trigger checkgame_blue
	&#123;
		// Check all for checkpoints and see if they have been set to '1' - allied
		accum 1 abort_if_not_equal 1
		accum 2 abort_if_not_equal 1
		accum 3 abort_if_not_equal 1
		accum 4 abort_if_not_equal 1
		accum 5 abort_if_not_equal 1

		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End the round
		wm_endround
	&#125;

	trigger checkgame_red
	&#123;
		// Check all for checkpoints and see if they have been set to '0' - axis
		accum 1 abort_if_not_equal 0
		accum 2 abort_if_not_equal 0
		accum 3 abort_if_not_equal 0
		accum 4 abort_if_not_equal 0
		accum 5 abort_if_not_equal 0

		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		// End the round
		wm_endround
	&#125;

	// Keep winner set to team with most flags

	trigger checkwinner
	&#123;
		wm_setwinner -1
		accum 7 abort_if_equal 0
		wm_setwinner 1
		accum 7 abort_if_greater_than 0
		wm_setwinner 0
	&#125;

	trigger adjustwinner_cp1_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 1 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp1_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 1 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp2_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 2 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp2_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 2 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp3_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 3 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp3_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 3 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp4_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 4 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp4_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 4 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp5_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 5 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp5_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 5 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

&#125;

checkpoint01
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp1_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp1_blue
	&#125;
&#125;

checkpoint02
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp2_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp2_blue
	&#125;
&#125;

checkpoint03
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp3_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp3_blue
	&#125;
&#125;

checkpoint04
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp4_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp4_blue
	&#125;
&#125;

checkpoint05
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp5_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp5_blue
	&#125;
&#125;

///Moving scripted stuff goes hewre...............................

vulture
&#123;
	spawn
	&#123;
	trigger vulture start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7500
	faceangles 0 180 0 7500
	faceangles 0 270 0 7500
	faceangles 0 360 0 7500
	trigger vulture start
	&#125;
&#125;

eagle
&#123;
	spawn
	&#123;
	trigger eagle start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7000
	faceangles 0 180 0 7000
	faceangles 0 270 0 7000
	faceangles 0 360 0 7000
	trigger eagle start
	&#125;
&#125;

eagle2
&#123;
	spawn
	&#123;
	trigger eagle2 start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 6500
	faceangles 0 180 0 6500
	faceangles 0 270 0 6500
	faceangles 0 360 0 6500
	trigger eagle2 start
	&#125;
&#125;
CTF SCRIPT

Code: Select all

// tutorial script for objective game
// last modified by&#58; WeblionX
// first modified by&#58; duke'ku

game_manager
&#123;
	spawn
	&#123;
		// Set scenario information

		wm_mapdescription			"Checkpoint&#58; Secure the town of El Drab."

		// time until reinforcements in seconds

		wm_axis_respawntime		1
		wm_allied_respawntime		1

		wm_number_of_objectives		2

		// Set time until round ends in minutes

		wm_set_round_timelimit		15

		// Set objective #1 properties

		// Nazi's control objective #1 at the start
		wm_set_objective_status		1	1
		wm_objective_axis_desc		1	"Allied Flag."
		wm_objective_allied_desc	1	"Allied Flag."

		wm_set_objective_status		2	-1
		wm_objective_axis_desc		2	"Axis Flag."
		wm_objective_allied_desc	2	"Axis Flag."

		//wm_overview_image			"video/none.roq"

		wm_overview_image				"gfx/2d/mp_objectives/wildwest_over.tga"
		wm_objective_image			1	"gfx/2d/mp_objectives/wildwest_obj1.tga"
		wm_objective_image			2	"gfx/2d/mp_objectives/wildwest_obj2.tga"
		wm_objective_image			3	"gfx/2d/mp_objectives/wildwest_obj3.tga"
		wm_objective_image			4	"gfx/2d/mp_objectives/wildwest_obj4.tga"
		wm_objective_image			5	"gfx/2d/mp_objectives/wildwest_obj5.tga"

		// SHORT DESCRIPTIONS

		wm_objective_short_axis_desc	1	"Sheriff's Office"
		wm_objective_short_axis_desc	2	"Saloon"

		wm_objective_short_allied_desc	1	"Sheriff's Office"
		wm_objective_short_allied_desc	2	"Saloon"

		// If the round timer expires, nobody wins
		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED, -1 == Noone
		wm_setwinner -1

		// Accum 1-6 will be the state of the checkpoints, -1 means nobody controls the flag
		// accum 1 set -1
		// accum 2 set -1
		// accum 3 set -1
		// accum 4 set -1
		// accum 5 set -1

		// Accum 7 tracks the tide of battle
		// accum 7 set 0
	&#125;

	// The following functions are called from the checkpoints when either team takes control of it

	trigger cp1_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #1
		wm_set_objective_status		1	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp1_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 1 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the Sherrif's Office!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp1_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #1
		wm_set_objective_status		1	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp1_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 1 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the Sherrif's Office!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp2_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #1
		wm_set_objective_status		2	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp2_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 2 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"cowboys take the Saloon!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp2_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #2
		wm_set_objective_status		2	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp2_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 2 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits takes the Saloon!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp3_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #3
		wm_set_objective_status		3	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp3_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 3 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the stables!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp3_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #3
		wm_set_objective_status		3	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp3_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 3 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the stables!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

	trigger cp4_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #4
		wm_set_objective_status		4	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp4_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 4 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the stage coach!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

	trigger cp4_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #4
		wm_set_objective_status		4	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp4_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 4 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the stage coach!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;

trigger cp5_blue
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of checkpoint #5
		wm_set_objective_status		5	1

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp5_blue

		// Change the variable within the script so that we can check if someone wins the round
		accum 5 set 1

		// Some kind of UI pop-up to alert players
		wm_announce	"Cowboys take the underground stream!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_blue
	&#125;

trigger cp5_red
	&#123;
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of checkpoint #5
		wm_set_objective_status		5	0

		// First update winner based on number of flags held by both teams
		trigger game_manager adjustwinner_cp5_red

		// Change the variable within the script so that we can check if someone wins the round
		accum 5 set 0

		// Some kind of UI pop-up to alert players
		wm_announce	"Bandits take the underground stream!"

		// Call function to check if the round has been won
		trigger game_manager checkgame_red
	&#125;



	// Check for game-winning condition

	trigger checkgame_blue
	&#123;
		// Check all for checkpoints and see if they have been set to '1' - allied
		accum 1 abort_if_not_equal 1
		accum 2 abort_if_not_equal 1
		accum 3 abort_if_not_equal 1
		accum 4 abort_if_not_equal 1
		accum 5 abort_if_not_equal 1

		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End the round
		wm_endround
	&#125;

	trigger checkgame_red
	&#123;
		// Check all for checkpoints and see if they have been set to '0' - axis
		accum 1 abort_if_not_equal 0
		accum 2 abort_if_not_equal 0
		accum 3 abort_if_not_equal 0
		accum 4 abort_if_not_equal 0
		accum 5 abort_if_not_equal 0

		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		// End the round
		wm_endround
	&#125;

	// Keep winner set to team with most flags

	trigger checkwinner
	&#123;
		wm_setwinner -1
		accum 7 abort_if_equal 0
		wm_setwinner 1
		accum 7 abort_if_greater_than 0
		wm_setwinner 0
	&#125;

	trigger adjustwinner_cp1_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 1 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp1_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 1 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp2_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 2 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp2_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 2 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp3_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 3 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp3_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 3 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp4_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 4 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp4_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 4 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp5_blue
	&#123;
		accum 7 inc 1
		trigger game_manager checkwinner
		accum 5 abort_if_not_equal 0
		accum 7 inc 1
		trigger game_manager checkwinner
	&#125;

	trigger adjustwinner_cp5_red
	&#123;
		accum 7 inc -1
		trigger game_manager checkwinner
		accum 5 abort_if_not_equal 1
		accum 7 inc -1
		trigger game_manager checkwinner
	&#125;

&#125;

checkpoint01
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp1_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp1_blue
	&#125;
&#125;

checkpoint02
&#123;
	spawn
	&#123;
		remove
	&#125;
	trigger axis_capture
	&#123;
		trigger game_manager cp2_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp2_blue
	&#125;
&#125;

checkpoint03
&#123;
	spawn
	&#123;
		remove
	&#125;
	trigger axis_capture
	&#123;
		trigger game_manager cp3_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp3_blue
	&#125;
&#125;

checkpoint04
&#123;
	spawn
	&#123;
		remove
	&#125;
	trigger axis_capture
	&#123;
		trigger game_manager cp4_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp4_blue
	&#125;
&#125;

checkpoint05
&#123;
	trigger axis_capture
	&#123;
		trigger game_manager cp5_red
	&#125;

	trigger allied_capture
	&#123;
		trigger game_manager cp5_blue
	&#125;
&#125;

///Moving scripted stuff goes hewre...............................

vulture
&#123;
	spawn
	&#123;
	trigger vulture start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7500
	faceangles 0 180 0 7500
	faceangles 0 270 0 7500
	faceangles 0 360 0 7500
	trigger vulture start
	&#125;
&#125;

eagle
&#123;
	spawn
	&#123;
	trigger eagle start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7000
	faceangles 0 180 0 7000
	faceangles 0 270 0 7000
	faceangles 0 360 0 7000
	trigger eagle start
	&#125;
&#125;

eagle2
&#123;
	spawn
	&#123;
	trigger eagle2 start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 6500
	faceangles 0 180 0 6500
	faceangles 0 270 0 6500
	faceangles 0 360 0 6500
	trigger eagle2 start
	&#125;
&#125;
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

you need to put "flag 1" in the spawn function of the allied spawnpoint, and "flag 0" in the function of the axis spawnpoint...

also, the wm_set_objective_status for the objectives should be set to 1 and 0 so the objective indicators start out correctly too.

// Nazi's control objective #1 at the start
wm_set_objective_status 1 1
wm_objective_axis_desc 1 "Allied Flag."
wm_objective_allied_desc 1 "Allied Flag."

wm_set_objective_status 2 0
wm_objective_axis_desc 2 "Axis Flag."
wm_objective_allied_desc 2 "Axis Flag."

checkpoint01
{
spawn
{
flag 1
}

trigger axis_capture
{
wm_set_objective_status 1 -1
}

trigger allied_capture
{
wm_set_objective_status 1 1
}
}

i think you can guess whats needed for checkpoint05 8)

you can get rid of all the 'trigger cp*' functions, 'trigger checkwinner', 'trigger adjustwinner_*', 'checkgame_*' functions as they are not needed for ctf.
duke'ku
Posts: 1053
Joined: Sun Nov 03, 2002 1:42 pm
Location: portland, oregon
Contact:

Post by duke'ku »

Here's what it is now, gonna test if it works soon... if anyone sees anything wrong, tell me.

Code: Select all

// tutorial script for objective game
// last modified by&#58; WeblionX
// first modified by&#58; duke'ku

game_manager
&#123;
	spawn
	&#123;
		// Set scenario information

		wm_mapdescription			"Checkpoint&#58; Secure the town of El Drab."

		// time until reinforcements in seconds

		wm_axis_respawntime		15
		wm_allied_respawntime		20

		wm_number_of_objectives		2

		// Set time until round ends in minutes

		wm_set_round_timelimit		15

		// Set objective #1 properties

	// Nazi's control objective #1 at the start 
	wm_set_objective_status		1   1 
	wm_objective_axis_desc		1   "Allied Flag." 
	wm_objective_allied_desc	1   "Allied Flag." 

	wm_set_objective_status     2   0 
	wm_objective_axis_desc      2   "Axis Flag." 
	wm_objective_allied_desc   	2   "Axis Flag." 

		//wm_overview_image			"video/none.roq"

		wm_overview_image				"gfx/2d/mp_objectives/wildwest_over.tga"
		wm_objective_image			1	"gfx/2d/mp_objectives/wildwest_obj1.tga"
		wm_objective_image			2	"gfx/2d/mp_objectives/wildwest_obj2.tga"
		wm_objective_image			3	"gfx/2d/mp_objectives/wildwest_obj3.tga"
		wm_objective_image			4	"gfx/2d/mp_objectives/wildwest_obj4.tga"
		wm_objective_image			5	"gfx/2d/mp_objectives/wildwest_obj5.tga"

		// SHORT DESCRIPTIONS

		wm_objective_short_axis_desc	1	"Sheriff's Office"
		wm_objective_short_axis_desc	2	"Saloon"

		wm_objective_short_allied_desc	1	"Sheriff's Office"
		wm_objective_short_allied_desc	2	"Saloon"

		// If the round timer expires, nobody wins
		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED, -1 == Noone
		wm_setwinner -1

		// Accum 1-6 will be the state of the checkpoints, -1 means nobody controls the flag
		// accum 1 set -1
		// accum 2 set -1
		// accum 3 set -1
		// accum 4 set -1
		// accum 5 set -1

		// Accum 7 tracks the tide of battle
		// accum 7 set 0
	&#125;

	// The following functions are called from the checkpoints when either team takes control of it

	// First update winner based on number of flags held by both teams
&#125;

checkpoint01 
&#123;
	spawn 
	&#123;
		flag 1 
	&#125;

	trigger axis_capture 
	&#123;
		wm_set_objective_status      1   -1 
	&#125;

	trigger allied_capture 
	&#123;
		wm_set_objective_status      1   1 
	&#125;
&#125;

checkpoint05
&#123;
	spawn 
	&#123;
		flag 1 
	&#125;

	trigger axis_capture 
	&#123;
		wm_set_objective_status      1   -1 
	&#125;

	trigger allied_capture 
	&#123;
		wm_set_objective_status      1   1 
	&#125;
&#125;
///Moving scripted stuff goes hewre...............................

vulture
&#123;
	spawn
	&#123;
	trigger vulture start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7500
	faceangles 0 180 0 7500
	faceangles 0 270 0 7500
	faceangles 0 360 0 7500
	trigger vulture start
	&#125;
&#125;

eagle
&#123;
	spawn
	&#123;
	trigger eagle start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7000
	faceangles 0 180 0 7000
	faceangles 0 270 0 7000
	faceangles 0 360 0 7000
	trigger eagle start
	&#125;
&#125;

eagle2
&#123;
	spawn
	&#123;
	trigger eagle2 start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 6500
	faceangles 0 180 0 6500
	faceangles 0 270 0 6500
	faceangles 0 360 0 6500
	trigger eagle2 start
	&#125;
&#125;
duke'ku
Posts: 1053
Joined: Sun Nov 03, 2002 1:42 pm
Location: portland, oregon
Contact:

Post by duke'ku »

Hm. Now, one flag works (sherriff's office), but there is no place to take the flag - and it's the wrong flag. It should be the axis flag. The other flag is not present, but the flagpoles are. All of them.
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Re: CTF Mode Scripting

Post by bani »

Code: Select all

// tutorial script for objective game

game_manager
&#123;
	spawn
	&#123;
		// Set scenario information

		wm_mapdescription			"Capture the flag&#58; Capture the enemy flag."

		// time until reinforcements in seconds

		wm_axis_respawntime		1
		wm_allied_respawntime		1

		wm_number_of_objectives		2

		// Set time until round ends in minutes

		wm_set_round_timelimit		15

		// Set objective #1 properties

		// Nazi's control objective #1 at the start
		wm_set_objective_status		1	1
		wm_objective_axis_desc		1	"Allied Flag"
		wm_objective_allied_desc	1	"Allied Flag"

		wm_set_objective_status		2	0
		wm_objective_axis_desc		2	"Axis Flag"
		wm_objective_allied_desc	2	"Axis Flag"

		//wm_overview_image			"video/none.roq"

		wm_overview_image				"gfx/2d/mp_objectives/wildwest_over.tga"
		wm_objective_image			1	"gfx/2d/mp_objectives/wildwest_obj1.tga"
		wm_objective_image			2	"gfx/2d/mp_objectives/wildwest_obj5.tga"

		// SHORT DESCRIPTIONS

		wm_objective_short_axis_desc	1	"Allied Flag"
		wm_objective_short_axis_desc	2	"Axis Flag"

		wm_objective_short_allied_desc	1	"Allied Flag"
		wm_objective_short_allied_desc	2	"Axis Flag"

		// If the round timer expires, nobody wins
		// Set the round winner&#58;  0 == AXIS, 1 == ALLIED, -1 == Noone
		wm_setwinner -1
	&#125;
&#125;

checkpoint01
&#123;
	spawn
	&#123;
		flag 1
	&#125;

	trigger flag_taken
	&#123;
		wm_set_objective_status		1	-1
	&#125;

	trigger flag_returned
	&#123;
		wm_set_objective_status		1	1
	&#125;
&#125;

checkpoint02
&#123;
	spawn
	&#123;
		remove
	&#125;
&#125;

checkpoint03
&#123;
	spawn
	&#123;
		remove
	&#125;
&#125;

checkpoint04
&#123;
	spawn
	&#123;
		remove
	&#125;
&#125;

checkpoint05
&#123;
	spawn
	&#123;
		flag 0
	&#125;

	trigger flag_taken
	&#123;
		wm_set_objective_status		2	-1
	&#125;

	trigger flag_returned
	&#123;
		wm_set_objective_status		2	0
	&#125;
&#125;

///Moving scripted stuff goes hewre...............................

vulture
&#123;
	spawn
	&#123;
	trigger vulture start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7500
	faceangles 0 180 0 7500
	faceangles 0 270 0 7500
	faceangles 0 360 0 7500
	trigger vulture start
	&#125;
&#125;

eagle
&#123;
	spawn
	&#123;
	trigger eagle start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 7000
	faceangles 0 180 0 7000
	faceangles 0 270 0 7000
	faceangles 0 360 0 7000
	trigger eagle start
	&#125;
&#125;

eagle2
&#123;
	spawn
	&#123;
	trigger eagle2 start
	&#125;

	trigger start
	&#123;
	faceangles 0 90 0 6500
	faceangles 0 180 0 6500
	faceangles 0 270 0 6500
	faceangles 0 360 0 6500
	trigger eagle2 start
	&#125;
&#125;
User avatar
=FF=im2good4u
Posts: 3821
Joined: Wed Feb 05, 2003 7:30 am
Location: The Netherlands, HOLLAND
Contact:

Post by =FF=im2good4u »

i think you better copy mp_ice_ctf then put the moving stuff there and rename the scripts and checpionts
Post Reply