Objective Scripting - crashes server


(BloodLusts) #1

Guys -sighs-

I am trying to script the blowing of some doors in my map as an Obj - but it crashes the server anytime i run the script

I have commented out the lines that i had to to make the map run – can someone please look at this script and tell me whats wrong - and y its crashing when it runs with lines uncommented


game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	10
		wm_allied_respawntime	10
		//wm_number_of_objectives 1
		wm_set_round_timelimit	35

		//wm_objective_status 1 0 0 // <objective team status>
		//wm_set_main_objective		1	0
		//wm_set_main_objective		1	1

		wm_setwinner 0
	
		//accum 1 set 0		
	}
}

//********************************************************
// TANK ROUTINES                                         *
//********************************************************

tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
}


//********************************************************
// digibob: converting truck script from goldrush over...
// ============================================================================
// accum 0, track state
// accum 1
//  - bit 0: barrier1 state		( 0 = not built,	1 = built		)
//  - bit 1: barrier2 state		( 0 = not built,	1 = built		)
//  - bit 2: spline status 		( 0 = not moving, 1 = moving 		)
//  - bit 3: stuck check flag 	( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: flag for message		( 0 = dont display, 1= display	)
//  - bit 5: blank			(						)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead	)
//  - bit 8: player check 		( 0 = players, 		1 = no players	)
//  - bit 9: visible state		( 0 = alive, 		1 = dead	)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, blank
// accum 7, blank
// ===========================================================================================
// spline points are spln2 -> spln78
// ===========================================================================================
// track events:
//  - tracks_forward
//  - tracks_stop
//  - tracks_turn_left
//  - tracks_turn_right

tank
{
	spawn
	{
		changemodel models/mapobjects/tanks_sd/churchhill.md3

		wait 400

		followspline 0 spln1 50000 length 32 wait

		trigger tank sound_idle
	}

	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}

// ===========================================================================================
	trigger tracks_forward
	{
		accum 1 abort_if_bitset 5
		accum 1 bitset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_turningleft
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_backward
		remapshaderflush
	}

	trigger tracks_turningright
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_backward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 1 abort_if_not_bitset 5
		accum 1 bitreset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_r
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_r
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_l
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_l
		remapshaderflush
	}
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger tank tracks_forward

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		accum 3 trigger_if_equal 20 tank run_20
		accum 3 trigger_if_equal 21 tank run_21
		accum 3 trigger_if_equal 22 tank run_22
		accum 3 trigger_if_equal 23 tank run_23
		accum 3 trigger_if_equal 24 tank run_end
		accum 3 trigger_if_equal 25 tank run_end
//		accum 3 trigger_if_equal 26 tank run_26
//		accum 3 trigger_if_equal 27 tank run_27
//		accum 3 trigger_if_equal 28 tank run_28
//		accum 3 trigger_if_equal 29 tank run_29
//		accum 3 trigger_if_equal 30 tank run_30
//		accum 3 trigger_if_equal 31 tank run_31
//		accum 3 trigger_if_equal 32 tank run_32
//		accum 3 trigger_if_equal 33 tank run_33
//		accum 3 trigger_if_equal 34 tank run_34
//		accum 3 trigger_if_equal 35 tank run_35
//		accum 3 trigger_if_equal 36 tank run_36
//		accum 3 trigger_if_equal 37 tank run_37
//		accum 3 trigger_if_equal 38 tank run_38
//		accum 3 trigger_if_equal 39 tank run_39
//		accum 3 trigger_if_equal 40 tank run_40
//		accum 3 trigger_if_equal 41 tank run_41
//		accum 3 trigger_if_equal 42 tank run_42
//		accum 3 trigger_if_equal 43 tank run_43
//		accum 3 trigger_if_equal 44 tank run_44
//		accum 3 trigger_if_equal 45 tank run_45
//		accum 3 trigger_if_equal 46 tank run_46
//		accum 3 trigger_if_equal 47 tank run_47
//		accum 3 trigger_if_equal 48 tank run_48
//		accum 3 trigger_if_equal 49 tank run_49
//		accum 3 trigger_if_equal 50 tank run_50
//		accum 3 trigger_if_equal 51 tank run_51
//		accum 3 trigger_if_equal 52 tank run_52
//		accum 3 trigger_if_equal 53 tank run_53
//		accum 3 trigger_if_equal 54 tank run_54
//		accum 3 trigger_if_equal 55 tank run_55
//		accum 3 trigger_if_equal 56 tank run_56
//		accum 3 trigger_if_equal 57 tank run_57
//		accum 3 trigger_if_equal 58 tank run_58
//		accum 3 trigger_if_equal 59 tank run_59
//		accum 3 trigger_if_equal 60 tank run_60
//		accum 3 trigger_if_equal 61 tank run_61
//		accum 3 trigger_if_equal 62 tank run_62
//		accum 3 trigger_if_equal 63 tank run_63
//		accum 3 trigger_if_equal 64 tank run_64
//		accum 3 trigger_if_equal 65 tank run_65
//		accum 3 trigger_if_equal 66 tank run_66
//		accum 3 trigger_if_equal 67 tank run_67
//		accum 3 trigger_if_equal 68 tank run_68
//		accum 3 trigger_if_equal 69 tank run_69
//		accum 3 trigger_if_equal 70 tank run_70
//		accum 3 trigger_if_equal 71 tank run_71
//		accum 3 trigger_if_equal 72 tank run_72
//		accum 3 trigger_if_equal 73 tank run_73
//		accum 3 trigger_if_equal 74 tank run_74
//		accum 3 trigger_if_equal 75 tank run_75
//		accum 3 trigger_if_equal 76 tank run_end

		trigger self run_continue

	}
//********************************************************
// this sets the tracks in motion and follows one spline *
// to the next.                                          *
//********************************************************
	trigger run_0
	{
		
		accum 1 bitset 2
		followspline 0 spln2 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}
//********************************************************
// at this spline you can see where it calls the         *
// game manager to state the allies stole the tank       *
//********************************************************
	trigger run_1
	{
		

		accum 1 bitset 2
		followspline 0 spln3 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		

		accum 1 bitset 2
		followspline 0 spln4 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		

		accum 1 bitset 2
		followspline 0 spln5 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_4
	{
		

		accum 1 bitset 2
		followspline 0 spln6 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_5
	{
		

		accum 1 bitset 2
		followspline 0 spln7 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_6
	{
		

		accum 1 bitset 2
		followspline 0 spln8 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_7
	{
		

		accum 1 bitset 2
		followspline 0 spln9 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_8
	{
		

		accum 1 bitset 2
		followspline 0 spln10 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_9
	{
		

		accum 1 bitset 2
		followspline 0 spln11 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_10
	{
		

		accum 1 bitset 2
		followspline 0 spln12 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_11
	{
		

		accum 1 bitset 2
		followspline 0 spln13 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_12
	{
		

		accum 1 bitset 2
		followspline 0 spln14 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_turn_right

		accum 1 bitset 2
		followspline 0 spln15 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_14
	{
		

		accum 1 bitset 2
		followspline 0 spln16 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_15
	{
		

		accum 1 bitset 2
		followspline 0 spln17 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_16
	{
		

		accum 1 bitset 2
		followspline 0 spln18 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_17
	{
		

		accum 1 bitset 2
		followspline 0 spln19 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_18
	{
		

		accum 1 bitset 2
		followspline 0 spln20 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_19
	{
		

		accum 1 bitset 2
		followspline 0 spln21 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_20
	{
		

		accum 1 bitset 2
		followspline 0 spln22 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_21
	{
		

		accum 1 bitset 2
		followspline 0 spln23 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_22
	{
		

		accum 1 bitset 2
		followspline 0 spln24 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_23
	{
		

		accum 1 bitset 2
		followspline 0 spln25 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_24
	{
		

		accum 1 bitset 2
		followspline 0 spln26 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_25
	{
		

		accum 1 bitset 2
		followspline 0 spln27 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_end
	{
		
		trigger self script_lockout

		trigger tank_sound 	stop
		trigger tank tracks_stop

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		wait 900

		trigger tank_turret turn

		accum 3 inc 100

		trigger self script_lockout_stop

	}

	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
//**************************************************************
//* stopping at spline 5 rather than 77 to make the tank stuck *
//* at the end of the splines.  ie stop the tank at the end    *
//* of its run.                                                *
//**************************************************************
//		accum 3 abort_if_less_than 77

		accum 3 abort_if_less_than 25

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 23

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built_msg
	{
		accum 1 abort_if_not_bitset 0

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 67

		accum 1 abort_if_not_bitset 1

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_not_bitset 1

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stopcheck_setup
	{
		accum 1 bitset 6				// stop if we're stuck

		accum 1 abort_if_bitset 8		// no one in the trigger around tank to make it move, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop

		trigger tank tracks_stop

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		
		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		changemodel models/mapobjects/tanks_sd/churchhill.md3

		setstate tank_smoke invisible

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_tank_stop"

		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"

		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"

		wm_removeteamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		// *---------------------------------------------------------------------------------*

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		trigger self deathcheck_message
		accum 1 bitset 4

		setstate tank_smoke default

		changemodel models/mapobjects/tanks_sd/churchhill_broken.md3

		kill tank_construct

		trigger self sound_death

		trigger self script_lockout

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	trigger deathcheck_message
	{
		accum 1 abort_if_not_bitset 4

		wm_announce "The Tank has been damaged!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"

		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_tank_stop"
		// *---------------------------------------------------------------------------------*
	}

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}

	trigger enable_stage2
	{
		accum 1 bitreset 0
	}

	trigger disable_stage2
	{
		accum 1 bitset 0
	}

	trigger enable_stage4
	{
		accum 1 bitreset 1
	}

	trigger disable_stage4
	{
		accum 1 bitset 1
	}
}

tank_trigger
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
		trigger tank_trigger bot_goal_loop
	}

	trigger bot_goal_loop
	{
		wait 4000	// check every 4 seconds
		trigger tank bot_active_check
		trigger tank_trigger bot_goal_loop
	}
}

tank_build
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
	}
}

tank_construct
{
	spawn
	{
		wait 1000

//		kill tank

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank

		wm_announce "The Tank has been repaired!"
	}
}

tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank tag_turret
	}

	trigger turn
	{
		wait 1000
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 -80 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav

//		trigger boomtrigger boom_all		// triggers the hurts around bank explosions (each has its own wait for timing)

		trigger tank_flash run

		wait 200
		trigger tank stopfire
		trigger self blow_doors
	}

	trigger blow_doors
	{
		setstate tank_flash invisible

		wait 200

		alertentity target_000
		alertentity door_effect
		//setstate doorframe invisible
		//setstate doorframe_damaged default

		wm_announce "Allies have Destroyed The Storage Gates!"
		//accum 1 set 1
		//wm_objective_status 1 0 2
		//wm_objective_status 1 1 1

		//wm_set_main_objective		1	0
		//wm_set_main_objective		1	1

		wait 100

		//trigger bank_door2_damaged bankbackboom

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank sound_death
		trigger tank script_lockout_stop
	}
}


tank_flash
{
	spawn
	{
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_flash default

 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50

		wait 50
		
		setstate tank_flash invisible

//		trigger tank_turret blow_doors
	}
}

tank_disabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_enable
	}
}

tank_smoke
{
	spawn
	{
		wait 300

		attachtotag tank tag_smoke
		setstate tank_smoke invisible
	}
}

tank_ladder
{
	spawn
	{
		wait 300

		attachtotag tank tag_turret
	}
}


(Ifurita) #2

Holy crap. How about just posting the objective script where the objective gets blown. I don’t have the time to search though your entire script just to find it.

Then again, you do set the winner immediately upon the map loading … maybe that’s the problem


(BloodLusts) #3

Well the wm_setwinner 0 – Does not set the winner when the map starts - wm_setwinner 0 – is the command for setting the winner when timer runs out

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

— Now as for the OBJ information


	trigger blow_doors
	{
		setstate tank_flash invisible

		wait 200

		alertentity target_000
		alertentity door_effect
		//setstate doorframe invisible
		//setstate doorframe_damaged default

		wm_announce "Allies have Destroyed The Storage Gates!"
		//accum 1 set 1
		//wm_objective_status 1 0 2
		//wm_objective_status 1 1 1

		//wm_set_main_objective		1	0
		//wm_set_main_objective		1	1

		wait 100

		//trigger bank_door2_damaged bankbackboom

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank sound_death
		trigger tank script_lockout_stop
	}

I have commented out the parts for OBJ’s cuz they were causing crashes -etc… the wm_setwinner code does not cause any errors - its just the code to mark who wins when time limit runs out


(Ifurita) #4

You are indeed correct. Damn, it’s been a long time since i dove into a script. In that case, not really sure what’s going on.


(BloodLusts) #5

well im toying with it trying to fix it – u get any ideas let me know


(Ifurita) #6

Go into the Battery script and pull the game win script out of that and see if that helps out. Most scripts seem to call a game_manager/objective check script once the final obj/objectives are completed.


(BloodLusts) #7

i got objs going smooth - my final issue is – my Tank

it will run its course - Stop at last spline Destroy the gates/trigger OBJ info - etc… thats all perfect

BUT - if ur an Axis and u use Nades to kill the tank – it will not show the Tank Destroyed Tank – it still shows a perfectly intact tank
it Does kill it thought all sound stops,u cannot use the MG etc… it just doesnt Show it as visually dead

– and it only does this on the Last Spline - it works 100% Perfect the rest of the time
Below is my Tank Scripting see if u can spot the error cuz i cant


//********************************************************
// TANK ROUTINES                                         *
//********************************************************

tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
}


//********************************************************
// digibob: converting truck script from goldrush over...
// ============================================================================
// accum 0, track state
// accum 1
//  - bit 0: barrier1 state		( 0 = not built,	1 = built		)
//  - bit 1: barrier2 state		( 0 = not built,	1 = built		)
//  - bit 2: spline status 		( 0 = not moving, 1 = moving 		)
//  - bit 3: stuck check flag 	( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: flag for message		( 0 = dont display, 1= display	)
//  - bit 5: blank			(						)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead	)
//  - bit 8: player check 		( 0 = players, 		1 = no players	)
//  - bit 9: visible state		( 0 = alive, 		1 = dead	)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, blank
// accum 7, blank
// ===========================================================================================
// spline points are spln2 -> spln78
// ===========================================================================================
// track events:
//  - tracks_forward
//  - tracks_stop
//  - tracks_turn_left
//  - tracks_turn_right

tank
{
	spawn
	{
		changemodel models/mapobjects/tanks_sd/churchhill.md3

		wait 400

		followspline 0 spln1 50000 length 32 wait

		trigger tank sound_idle
	}

	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}

// ===========================================================================================
	trigger tracks_forward
	{
		accum 1 abort_if_bitset 5
		accum 1 bitset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_turningleft
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_backward
		remapshaderflush
	}

	trigger tracks_turningright
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_backward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 1 abort_if_not_bitset 5
		accum 1 bitreset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_r
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_r
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_l
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_l
		remapshaderflush
	}
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger tank tracks_forward

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		accum 3 trigger_if_equal 20 tank run_20
		accum 3 trigger_if_equal 21 tank run_21
		accum 3 trigger_if_equal 22 tank run_22
		accum 3 trigger_if_equal 23 tank run_23
		accum 3 trigger_if_equal 24 tank run_end

		trigger self run_continue

	}
//********************************************************
// this sets the tracks in motion and follows one spline *
// to the next.                                          *
//********************************************************
	trigger run_0
	{
		
		accum 1 bitset 2
		followspline 0 spln2 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}
//********************************************************
// at this spline you can see where it calls the         *
// game manager to state the allies stole the tank       *
//********************************************************
	trigger run_1
	{
		

		accum 1 bitset 2
		followspline 0 spln3 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		

		accum 1 bitset 2
		followspline 0 spln4 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		

		accum 1 bitset 2
		followspline 0 spln5 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_4
	{
		

		accum 1 bitset 2
		followspline 0 spln6 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_5
	{
		

		accum 1 bitset 2
		followspline 0 spln7 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_6
	{
		

		accum 1 bitset 2
		followspline 0 spln8 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_7
	{
		

		accum 1 bitset 2
		followspline 0 spln9 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_8
	{
		

		accum 1 bitset 2
		followspline 0 spln10 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_9
	{
		

		accum 1 bitset 2
		followspline 0 spln11 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_10
	{
		

		accum 1 bitset 2
		followspline 0 spln12 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_11
	{
		

		accum 1 bitset 2
		followspline 0 spln13 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_12
	{
		

		accum 1 bitset 2
		followspline 0 spln14 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_turn_right

		accum 1 bitset 2
		followspline 0 spln15 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_14
	{
		

		accum 1 bitset 2
		followspline 0 spln16 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_15
	{
		

		accum 1 bitset 2
		followspline 0 spln17 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_16
	{
		

		accum 1 bitset 2
		followspline 0 spln18 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_17
	{
		

		accum 1 bitset 2
		followspline 0 spln19 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_18
	{
		

		accum 1 bitset 2
		followspline 0 spln20 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_19
	{
		

		accum 1 bitset 2
		followspline 0 spln21 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_20
	{
		

		accum 1 bitset 2
		followspline 0 spln22 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_21
	{
		

		accum 1 bitset 2
		followspline 0 spln23 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_22
	{
		

		accum 1 bitset 2
		followspline 0 spln24 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_23
	{
		

		accum 1 bitset 2
		followspline 0 spln25 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_24
	{
		

		accum 1 bitset 2
		followspline 0 spln26 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_25
	{
		

		accum 1 bitset 2
		followspline 0 spln27 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_end
	{
		
		trigger self script_lockout

		trigger tank_sound 	stop
		trigger tank tracks_stop

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		wait 900

		trigger tank_turret turn

		accum 3 inc 100

		trigger self script_lockout_stop

	}

	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
//**************************************************************
//* stopping at spline 5 rather than 77 to make the tank stuck *
//* at the end of the splines.  ie stop the tank at the end    *
//* of its run.                                                *
//**************************************************************
//		accum 3 abort_if_less_than 77

		accum 3 abort_if_less_than 25

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 23

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built_msg
	{
		accum 1 abort_if_not_bitset 0

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 67

		accum 1 abort_if_not_bitset 1

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_not_bitset 1

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stopcheck_setup
	{
		accum 1 bitset 6				// stop if we're stuck

		accum 1 abort_if_bitset 8		// no one in the trigger around tank to make it move, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop

		trigger tank tracks_stop

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		
		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		changemodel models/mapobjects/tanks_sd/churchhill.md3

		setstate tank_smoke invisible

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_tank_stop"

		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"

		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"

		wm_removeteamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		// *---------------------------------------------------------------------------------*

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	      wm_announce "The Tank has been damaged!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"

		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_tank_stop"
		// *---------------------------------------------------------------------------------*
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		trigger self deathcheck_message
		accum 1 bitset 4

		setstate tank_smoke default

		changemodel models/mapobjects/tanks_sd/churchhill_broken.md3

		kill tank_construct

		trigger self sound_death

		trigger self script_lockout

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	//trigger deathcheck_message
	//{
	//	accum 1 abort_if_not_bitset 4
      // }

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}

	trigger enable_stage2
	{
		accum 1 bitreset 0
	}

	trigger disable_stage2
	{
		accum 1 bitset 0
	}

	trigger enable_stage4
	{
		accum 1 bitreset 1
	}

	trigger disable_stage4
	{
		accum 1 bitset 1
	}
}

tank_trigger
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
		trigger tank_trigger bot_goal_loop
	}

	trigger bot_goal_loop
	{
		wait 4000	// check every 4 seconds
		trigger tank bot_active_check
		trigger tank_trigger bot_goal_loop
	}
}

tank_build
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
	}
}

tank_construct
{
	spawn
	{
		wait 1000

//		kill tank

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank

		wm_announce "The Tank has been repaired!"
	}
}

tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank tag_turret
	}

	trigger turn
	{
		wait 1000
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 -80 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav

//		trigger boomtrigger boom_all		// triggers the hurts around bank explosions (each has its own wait for timing)

		trigger tank_flash run

		wait 200
		trigger tank stopfire
		trigger self blow_doors
	}

	trigger blow_doors
	{
		setstate tank_flash invisible

		wait 200

		alertentity target_000
		alertentity door_effect
		trigger game_manager allies_obj1
		setstate axisgate_toi invisible
		wait 100

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank sound_death
		trigger tank script_lockout_stop
	}
}


tank_flash
{
	spawn
	{
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_flash default

 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50

		wait 50
		
		setstate tank_flash invisible

//		trigger tank_turret blow_doors
	}
}

tank_disabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_enable
	}
}

tank_smoke
{
	spawn
	{
		wait 300

		attachtotag tank tag_smoke
		setstate tank_smoke invisible
	}
}

tank_ladder
{
	spawn
	{
		wait 300

		attachtotag tank tag_turret
	}
}

any advice? - this is the last bug keeping me from releasing this map - etc…


(S14Y3R) #8

In tank death, instead of directly killing the tank from the script, set up a target_kill(targetname tank_killer) and target it at the tank_construct. So then “alertentity tank_killer” kills it instead. should help :slight_smile:


(BloodLusts) #9

ok im not sure what u mean by that –

I now have 2 issues – the tank not showing as destroyed on the last spline is one –
and the other is

– here is what happens
obj - escort tank to blow gates – tank runs fine blows the gates thats cool
obj2 - Steal the Documents – here is the problem – On my limbo screen the Documents are already marked as stolen

it marked them as stolen when i blew the gates with the Tank

its not supposed to mark em as stolen until the player picks up the docs etc…

The rest of the Objs work fine – etc… - i just cannot figure out whats causing it to mark the Documents as stolen when i blow the gates – I have double checked my Objective_status settings - they are correct - i have also tried many different ways to make this work - to no avail


game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	10
		wm_allied_respawntime	10
		wm_number_of_objectives 3
		wm_set_round_timelimit	35

		wm_objective_status 1 0 0 // <objective team status>
		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_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_setwinner 0

	}

}

//********************************************************
// TANK ROUTINES                                         *
//********************************************************

tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
}


//********************************************************
// digibob: converting truck script from goldrush over...
// ============================================================================
// accum 0, track state
// accum 1
//  - bit 0: barrier1 state		( 0 = not built,	1 = built		)
//  - bit 1: barrier2 state		( 0 = not built,	1 = built		)
//  - bit 2: spline status 		( 0 = not moving, 1 = moving 		)
//  - bit 3: stuck check flag 	( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: flag for message		( 0 = dont display, 1= display	)
//  - bit 5: blank			(						)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead	)
//  - bit 8: player check 		( 0 = players, 		1 = no players	)
//  - bit 9: visible state		( 0 = alive, 		1 = dead	)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, blank
// accum 7, blank
// ===========================================================================================
// spline points are spln2 -> spln78
// ===========================================================================================
// track events:
//  - tracks_forward
//  - tracks_stop
//  - tracks_turn_left
//  - tracks_turn_right

tank
{
	spawn
	{
		changemodel models/mapobjects/tanks_sd/churchhill.md3

		wait 400

		followspline 0 spln1 50000 length 32 wait

		trigger tank sound_idle
	}

	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}

// ===========================================================================================
	trigger tracks_forward
	{
		accum 1 abort_if_bitset 5
		accum 1 bitset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_turningleft
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_forward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_backward
		remapshaderflush
	}

	trigger tracks_turningright
	{
		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_backward
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_backward
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_forward
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_forward
		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 1 abort_if_not_bitset 5
		accum 1 bitreset 5

		remapshader models/mapobjects/tanks_sd/bits_r models/mapobjects/tanks_sd/bits_r
		remapshader models/mapobjects/tanks_sd/wheel_r models/mapobjects/tanks_sd/wheel_r
		remapshader models/mapobjects/tanks_sd/bits_l models/mapobjects/tanks_sd/bits_l
		remapshader models/mapobjects/tanks_sd/wheel_l models/mapobjects/tanks_sd/wheel_l
		remapshaderflush
	}
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger tank tracks_forward

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		accum 3 trigger_if_equal 20 tank run_20
		accum 3 trigger_if_equal 21 tank run_21
		accum 3 trigger_if_equal 22 tank run_22
		accum 3 trigger_if_equal 23 tank run_23
		accum 3 trigger_if_equal 24 tank run_end
		accum 3 trigger_if_equal 25 tank run_end
//		accum 3 trigger_if_equal 26 tank run_26
//		accum 3 trigger_if_equal 27 tank run_27
//		accum 3 trigger_if_equal 28 tank run_28
//		accum 3 trigger_if_equal 29 tank run_29
//		accum 3 trigger_if_equal 30 tank run_30
//		accum 3 trigger_if_equal 31 tank run_31
//		accum 3 trigger_if_equal 32 tank run_32
//		accum 3 trigger_if_equal 33 tank run_33
//		accum 3 trigger_if_equal 34 tank run_34
//		accum 3 trigger_if_equal 35 tank run_35
//		accum 3 trigger_if_equal 36 tank run_36
//		accum 3 trigger_if_equal 37 tank run_37
//		accum 3 trigger_if_equal 38 tank run_38
//		accum 3 trigger_if_equal 39 tank run_39
//		accum 3 trigger_if_equal 40 tank run_40
//		accum 3 trigger_if_equal 41 tank run_41
//		accum 3 trigger_if_equal 42 tank run_42
//		accum 3 trigger_if_equal 43 tank run_43
//		accum 3 trigger_if_equal 44 tank run_44
//		accum 3 trigger_if_equal 45 tank run_45
//		accum 3 trigger_if_equal 46 tank run_46
//		accum 3 trigger_if_equal 47 tank run_47
//		accum 3 trigger_if_equal 48 tank run_48
//		accum 3 trigger_if_equal 49 tank run_49
//		accum 3 trigger_if_equal 50 tank run_50
//		accum 3 trigger_if_equal 51 tank run_51
//		accum 3 trigger_if_equal 52 tank run_52
//		accum 3 trigger_if_equal 53 tank run_53
//		accum 3 trigger_if_equal 54 tank run_54
//		accum 3 trigger_if_equal 55 tank run_55
//		accum 3 trigger_if_equal 56 tank run_56
//		accum 3 trigger_if_equal 57 tank run_57
//		accum 3 trigger_if_equal 58 tank run_58
//		accum 3 trigger_if_equal 59 tank run_59
//		accum 3 trigger_if_equal 60 tank run_60
//		accum 3 trigger_if_equal 61 tank run_61
//		accum 3 trigger_if_equal 62 tank run_62
//		accum 3 trigger_if_equal 63 tank run_63
//		accum 3 trigger_if_equal 64 tank run_64
//		accum 3 trigger_if_equal 65 tank run_65
//		accum 3 trigger_if_equal 66 tank run_66
//		accum 3 trigger_if_equal 67 tank run_67
//		accum 3 trigger_if_equal 68 tank run_68
//		accum 3 trigger_if_equal 69 tank run_69
//		accum 3 trigger_if_equal 70 tank run_70
//		accum 3 trigger_if_equal 71 tank run_71
//		accum 3 trigger_if_equal 72 tank run_72
//		accum 3 trigger_if_equal 73 tank run_73
//		accum 3 trigger_if_equal 74 tank run_74
//		accum 3 trigger_if_equal 75 tank run_75
//		accum 3 trigger_if_equal 76 tank run_end

		trigger self run_continue

	}
//********************************************************
// this sets the tracks in motion and follows one spline *
// to the next.                                          *
//********************************************************
	trigger run_0
	{
		
		accum 1 bitset 2
		followspline 0 spln2 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}
//********************************************************
// at this spline you can see where it calls the         *
// game manager to state the allies stole the tank       *
//********************************************************
	trigger run_1
	{
		

		accum 1 bitset 2
		followspline 0 spln3 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		

		accum 1 bitset 2
		followspline 0 spln4 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		

		accum 1 bitset 2
		followspline 0 spln5 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_4
	{
		

		accum 1 bitset 2
		followspline 0 spln6 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_5
	{
		

		accum 1 bitset 2
		followspline 0 spln7 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_6
	{
		

		accum 1 bitset 2
		followspline 0 spln8 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_7
	{
		

		accum 1 bitset 2
		followspline 0 spln9 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_8
	{
		

		accum 1 bitset 2
		followspline 0 spln10 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_9
	{
		

		accum 1 bitset 2
		followspline 0 spln11 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_10
	{
		

		accum 1 bitset 2
		followspline 0 spln12 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_11
	{
		

		accum 1 bitset 2
		followspline 0 spln13 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_12
	{
		

		accum 1 bitset 2
		followspline 0 spln14 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_turn_right

		accum 1 bitset 2
		followspline 0 spln15 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_14
	{
		

		accum 1 bitset 2
		followspline 0 spln16 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_15
	{
		

		accum 1 bitset 2
		followspline 0 spln17 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_16
	{
		

		accum 1 bitset 2
		followspline 0 spln18 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_17
	{
		

		accum 1 bitset 2
		followspline 0 spln19 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_18
	{
		

		accum 1 bitset 2
		followspline 0 spln20 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_19
	{
		

		accum 1 bitset 2
		followspline 0 spln21 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_20
	{
		

		accum 1 bitset 2
		followspline 0 spln22 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_21
	{
		

		accum 1 bitset 2
		followspline 0 spln23 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_22
	{
		

		accum 1 bitset 2
		followspline 0 spln24 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_23
	{
		

		accum 1 bitset 2
		followspline 0 spln25 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_24
	{
		

		accum 1 bitset 2
		followspline 0 spln26 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_25
	{
		

		accum 1 bitset 2
		followspline 0 spln27 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_end
	{
		
		trigger self script_lockout

		trigger tank_sound 	stop
		trigger tank tracks_stop

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		wait 900

		trigger tank_turret turn

		accum 3 inc 100

		trigger self script_lockout_stop

	}

	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
//**************************************************************
//* stopping at spline 5 rather than 77 to make the tank stuck *
//* at the end of the splines.  ie stop the tank at the end    *
//* of its run.                                                *
//**************************************************************
//		accum 3 abort_if_less_than 77

		accum 3 abort_if_less_than 25

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 23

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built_msg
	{
		accum 1 abort_if_not_bitset 0

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 67

		accum 1 abort_if_not_bitset 1

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_not_bitset 1

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger stopcheck_setup
	{
		accum 1 bitset 6				// stop if we're stuck

		accum 1 abort_if_bitset 8		// no one in the trigger around tank to make it move, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop

		trigger tank tracks_stop

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		
		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		changemodel models/mapobjects/tanks_sd/churchhill.md3

		setstate tank_smoke invisible

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_tank_stop"

		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"

		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"

		wm_removeteamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		// *---------------------------------------------------------------------------------*

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	      wm_announce "The Tank has been damaged!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"

		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_tank_stop"
		// *---------------------------------------------------------------------------------*
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		trigger self deathcheck_message
		accum 1 bitset 4

		setstate tank_smoke default

		changemodel models/mapobjects/tanks_sd/churchhill_broken.md3

		kill tank_construct

		trigger self sound_death

		trigger self script_lockout

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	//trigger deathcheck_message
	//{
	//	accum 1 abort_if_not_bitset 4
      // }

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}

	trigger enable_stage2
	{
		accum 1 bitreset 0
	}

	trigger disable_stage2
	{
		accum 1 bitset 0
	}

	trigger enable_stage4
	{
		accum 1 bitreset 1
	}

	trigger disable_stage4
	{
		accum 1 bitset 1
	}
}

tank_trigger
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
		trigger tank_trigger bot_goal_loop
	}

	trigger bot_goal_loop
	{
		wait 4000	// check every 4 seconds
		trigger tank bot_active_check
		trigger tank_trigger bot_goal_loop
	}
}

tank_build
{
	spawn
	{
		wait 500

		attachtotag tank tag_turret
	}
}

tank_construct
{
	spawn
	{
		wait 1000

//		kill tank

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank

		wm_announce "The Tank has been repaired!"
	}
}

tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank tag_turret
	}

	trigger turn
	{
		wait 1000
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 -80 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav

//		trigger boomtrigger boom_all		// triggers the hurts around bank explosions (each has its own wait for timing)

		trigger tank_flash run

		wait 200
		trigger tank stopfire
		trigger self blow_doors
	}

	trigger blow_doors
	{
		setstate tank_flash invisible

		wait 200
		setstate gate_info1 invisible
		alertentity target_000
		alertentity door_effect
		//wm_teamvoiceannounce 1 "allies_hq_objdest"
		wm_announce "Allies have Blasted The Axis Storage Gates!"
		wm_objective_status 1 0 2
		wm_objective_status 1 1 1
		wait 100

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank sound_death
		trigger tank script_lockout_stop
	}
}


tank_flash
{
	spawn
	{
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_flash default

 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50

		wait 50
		
		setstate tank_flash invisible

//		trigger tank_turret blow_doors
	}
}

tank_disabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	spawn
	{
		wait 200
	}

	trigger run
	{
		trigger tank tank_enable
	}
}

tank_smoke
{
	spawn
	{
		wait 300

		attachtotag tank tag_smoke
		setstate tank_smoke invisible
	}
}

tank_ladder
{
	spawn
	{
		wait 300

		attachtotag tank tag_turret
	}
}

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

   buildstart final
   {
   }

   built final
   {

      setstate construction_materials invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "Allied team has built A Rocket Control System!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "Axis team has destroyed the Allies Rocket Controls!"
   }

   trigger startup
   {
      setstate construction_materials default
   }
}

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

   buildstart final
   {
   }

   built final
   {

      setstate construction_materials1 invisible

      // Some kind of UI pop-up to alert players
      wm_announce   "Axis team has built a Rocket Control System!"
   }

   decayed final
   {
      trigger self startup
   }

   death
   {
      trigger self startup
      // Some kind of UI pop-up to alert players
      wm_announce   "Allies team has destroyed the Axis Rocket Controls!"
   }

   trigger startup
   {

      setstate construction_materials1 default

   }

}

allies_obj2
{
	spawn
	{
	}

	trigger stolen
	{

	      wm_objective_status 2 0 2
		wm_objective_status 2 1 1
	}

	trigger returned
	{
	      wm_objective_status 2 0 1
		wm_objective_status 2 1 2

	}

	trigger captured
	{
        wait 1000
		wm_announce "Allies have Transmitted The Enigma Cypher Codes"
		wm_objective_status 3 0 2
		wm_objective_status 3 1 1
		//trigger self winmatch
	}

}

allies_obj3
{	
	spawn
	{
	}
}

can u look over that script and see if u can spot whats causing it to mark the Docs as Stolen - when the tank blows the gates –
tank blows the gates and its supposed to only mark the Gates as Blown - not mark the docs as stolen - hopefully u get what im saying etc…

and can u please clearify on howto fix the tank so when its on its last spline - it actually shows the tank as destroyed if an axis blows it up etc…

these are the last 2 bugs i have in the map i cannot figure them out


(S14Y3R) #10

Hi! here ya go… :slight_smile:

First, why don’t you set up your tank to spawn as “fixed”, instead of changing model right away. In the tanks script_mover entity is a key called model2, change it in there instead.

tank
{
   spawn
   {
      changemodel models/mapobjects/tanks_sd/churchhill.md3 // <---??

      wait 400

      followspline 0 spln1 50000 length 32 wait //<---- length should be 1/2 of total length for nicer turns

      trigger tank sound_idle
   }

!!Your calling “run_end” twice, eh. fix that, should stop okay. Was it firing twice too?? LOL

   accum 3 trigger_if_equal 22 tank run_22
      accum 3 trigger_if_equal 23 tank run_23
      accum 3 trigger_if_equal 24 tank run_end
      accum 3 trigger_if_equal 25 tank run_end
//      accum 3 trigger_if_equal 26 tank run_26
//      accum 3 trigger_if_equal 27 tank run_27
//      accum 3 trigger_if_equal 28 tank run_28

Your missing volume keys in a bunch of playsounds:

playsound sound/vehicles/tank/turret_spin.wav looping 

should be:

playsound sound/vehicles/tank/tank_idle.wav looping volume 512 //<-------!!