scripting problem


(TF) #1

K,this script that i have seems to be working fine,except the part that should give forward bunker to allies and secure it if they destroy the “maindoor1” :stuck_out_tongue: now it kills the flag but bunker stays to who owned the bunker before :stuck_out_tongue:
here is the script

////////////////
//game_manager//
////////////////
game_manager
{
	spawn
	{
		accum 1 set 0		
		

		// Game rules
		wm_axis_respawntime	30
		wm_allied_respawntime	20
		wm_number_of_objectives 1
		wm_set_round_timelimit	20

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

		// Objective overview status indicators
		//wm_objective_status <objective> <team (0=Axis, 1=Allies)> <status (0=neutral 1=complete 2=failed)>
		wm_objective_status 1 0 0

		
		
		// 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
		wm_setwinner 0





	}

	trigger maindoor1_destroyed
	{
		
		wm_announce "Allies have secured the forward bunker!"
		
		setautospawn "Axis second spawn" 0
      		setautospawn "Forward Bunker" 1

      		kill ForwardBunker
	
	}




	trigger objective1
	{
		accum 1 set 1
		trigger game_manager checkgame
	}



	trigger checkgame
	{
		accum 1 abort_if_not_equal 1
		wm_setwinner 1
		wait 1000
		wm_endround
	}
}


v2rocket
{
	spawn
	{
		wait 300

		constructible_class 3
	}

	death
	{
		wm_announce	"Allies have blown the prototype rocket!"
		trigger game_manager objective1
	}
}
////////
//BOOM//
////////
door1 // Base gate
{
	spawn
	{
		wait 200

		constructible_class 3
	}

	death
	{
		wm_announce	"Allies have blown the base gate!"
	}
}

maindoor1 // 2nd door
{
	spawn
	{
		wait 200

		constructible_class 3
	}

	death
	{
		wm_announce	"Allies have blown the bunker door!"
		trigger game_manager maindoor1_destroyed
	}
}


//////////
//spawn//
////////

bunker_check
{
   spawn
   {
   wait 1000
   accum 0 set 0
   }

   trigger axis_capture
   {
   accum 0 abort_if_equal 0
   accum 0 set 0
   alertentity bunker
   setautospawn "Forward Bunker" 0
   setautospawn "Allied start" 1
   }

   trigger allied_capture
   {
   accum 0 abort_if_equal 1
   accum 0 set 1
   alertentity bunker
   setautospawn "Axis second spawn" 0
   setautospawn "Forward Bunker" 1
   }
}

maybe there are more errors then just this one… :smiley:


(Ifurita) #2

In this block:


trigger maindoor1_destroyed 
   { 
       
      wm_announce "Allies have secured the forward bunker!" 
       
      setautospawn "Axis second spawn" 0 
            setautospawn "Forward Bunker" 1 

            kill ForwardBunker 
    
   } 

You need to add some logic that checks the value of accum 0 and if it = 0, then alertentity the flag before killing it. There is similar logic built into the scripts for Vengeance_TE and Rommel


(TF) #3
trigger maindoor1_destroyed
   {
       
      wm_announce "Allies have secured the forward bunker!"
      
      accum 0 abort_if_equal 1
      alertentity bunker
      setautospawn "Axis second spawn" 0
      setautospawn "Forward Bunker" 1

      kill ForwardBunker
   
   } 

like this?


(Ifurita) #4

Here is the scripting from Vengeance:

Forward flag scripting


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

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

	trigger axis_capture
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of forward flag

		// Some kind of UI pop-up to alert players
		wm_announce	"Axis capture the Ammo Depot!"

		// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "vengeance_axis_obj_flag_captured"
		wm_teamvoiceannounce 1 "vengeance_allied_obj_flag_lost"
		// *----------------------------------- vo ----*

		wm_objective_status	6 1 2
		wm_objective_status	6 0 1

		alertentity forwardflag_wobj
	}

	trigger allied_capture
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of forward flag

		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the Ammo Depot!"
		
		// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "vengeance_axis_obj_flag_lost"
		wm_teamvoiceannounce 1 "vengeance_allied_obj_flag_captured"
		// *----------------------------------- vo ----*

		wm_objective_status	6 1 1
		wm_objective_status	6 0 2

		alertentity forwardflag_wobj
	}

	trigger axis_keep
	{
		//setstate allied_forward_spawnblob invisible
		setautospawn "Allied Spawn" 0
		setautospawn "Forward Spawn" 1
		remove

		accum 0 abort_if_equal 0
		alertentity forwardflag_wobj
		alertentity forward_spawnblob
	}
}


and the part where blowing the objective changes the flag permanently


ammobunkerdoor2_script
{ 
	spawn 
	{ 
		wait 200 
		constructible_class 3  
		setstate ammobunkerdoor2_target default

		setstate obj_bunker invisible
		setstate obj_bunker_toi invisible
	} 

	death 
	{ 
		setstate ammobunkerdoor2_target invisible

		wm_announce "The Axis have breached the bunker door" 

		// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "vengeance_axis_obj_destroyed"
		wm_teamvoiceannounce 1 "vengeance_allied_obj_destroyed"
		// *----------------------------------- vo ----*

		trigger forward_spawn axis_keep

		setstate obj_bunker default
		setstate obj_bunker_toi default

		wm_objective_status	2 0 1
		wm_objective_status	2 1 2
	} 

	trigger startup 
	{ 
	} 
}


(TF) #5

heh,finally,after 3 hours it works ( i think so :smiley: )
thanks