Forward spawn problem


(Pukedukem) #1

when the allies capture the flag axis still can spawn at the flag. here is my spawn script.
anyone’s help would be great

Thanks

// ================================================
// ============    FORWARD SPAWN     ==============
// ================================================

forward_spawn
{
	spawn
	{
	// accum 3 set 2	// 0-Axis, 1-Allied
	}


	trigger axis_capture
	{

		accum 3 abort_if_not_equal 1

		accum 3 set 0

		trigger game_manager axis_flag

		setautospawn	"Axis Spawn"	0
		setautospawn	"Allies Spawn"	1

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "all1_axis_bunker_defend"

		wm_teamvoiceannounce 1 "all1_allies_bunker_capture"

		wm_addteamvoiceannounce 0 "all1_axis_bunker_defend"

		wm_addteamvoiceannounce 1 "all1_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
	}

	trigger allied_capture
	{

		accum 3 abort_if_not_equal 0

		accum 3 set 1

		trigger game_manager allies_flag

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

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "all1_axis_bunker_lost"

		wm_teamvoiceannounce 1 "all1_allies_bunker_captured"

		wm_addteamvoiceannounce 0 "all1_axis_bunker_lost"

		wm_addteamvoiceannounce 1 "all1_allies_bunker_captured"
		// *---------------------------------------------------------------------------------*

	}
}
// ================================================


(sock) #2

Here is a collection of working forward spawn example map files and scripts:

Initially Allies controlled: http://www.planetquake.com/simland/ldr1_1/samplemap07a.htm
Initially Axis controlled: http://www.planetquake.com/simland/ldr1_1/samplemap07b.htm
Permenant switch: http://www.planetquake.com/simland/ldr1_1/samplemap07c.htm

Sock
:moo:


(Pukedukem) #3

thanks Sock

:drink:


(Pukedukem) #4

still having a problem it worked fine in a test map, but now axis have to pick to spawn at the flag before the round starts?

// Blood on the Rhine ////////

game_manager
{
	spawn
	{
		remapshader "models/mapobjects/tanks_sd/mg42turret" "models/mapobjects/tanks_sd/mg42turret_2"
		
		remapshaderflush
		
		// Game rules
		wm_axis_respawntime	05
		wm_allied_respawntime	05
		wm_number_of_objectives 7
		wm_set_round_timelimit	30

		// Objectives
		// 1: repair Tank
		// 2: blow first entrance
		// 3: capture bunker
		// 4: blow tunnel gate
		// 5: blow tunnel wall
		// 6: blow second entrance
		// 7: take book from office, then to truck
		// 8: escape to beach lander with truck
		
		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
		wm_objective_status 6 0 0
		wm_objective_status 6 1 0
		wm_objective_status 7 0 0
		wm_objective_status 7 1 0
		wm_objective_status 8 1 0
		wm_objective_status 8 1 0
		
		wait 50				// Wait for all entities to spawn
		setautospawn "Forward Spawn"	0	// Set Axis to forward spawn

		// 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
	}
	
		trigger allies_win
	{
		wm_setwinner	1
		wm_announce "Allied team escaped with the Book!"

		wm_objective_status 8 0 2
		wm_objective_status 8 1 1

		wait 1500
		wm_endround
	}

}

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
	spawn
	{
		accum 0 set 1			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis reclaim the Forward Spawn!"

		alertentity forwardspawn1_wobj		// Switch command map marker
		setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// 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 capture the Forward Spawn!"

		alertentity forwardspawn1_wobj		// Switch command map marker
		setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
	}
}



(sock) #5

still having a problem it worked fine in a test map, but now axis have to pick to spawn at the flag before the round starts?

Umm there is a typo in my script. The initial value for the forwardspawn1_flag routine is wrong. It should be this:


   spawn 
   { 
      accum 0 set 0         // Who owns flag: 0-Axis, 1-Allied 
   } 

Sounds like the problem you are having is to do with the initial state of the spawn points. If the spawnpoints are not active the autospawn function will not work. All the entities have to be setup correctly otherwise the script will be out of sync. Re-check the spawnflag option on all your spawnpoints, Axis need to be “start active, invul”. Allied need to be “invul” This is assuming you want the Axis spawning there first.

Sock
:moo:


(Pukedukem) #6

fixed.
it was that i had start active checked on the back axis spawns.

Thanks Sock
thought I would never figure that out


(Ifurita) #7

ah, that was my problem too


(Pukedukem) #8

:drink: