Tank can not be repaired


(ArnoWar) #1

I have a tank in my map and it starts as disabled, you can repair it the first time but the first time it gets damaged its not posible to repair it again?
everything else works as it should, splines, barriers etc

Anyone seen this before?

The tank script is remade from fuledump to fit my needs ( I can post it if needed)
or you can download a beta version of the map with the error here http://www.bucher.dk/projects/rtcw_et/maps/alchemycastle_b2.zip
I made sevel search in the forum but was not able to find anything.


(ArnoWar) #2

Here is my tank script

// ================================================
// ========== accum's and where they are used =====
// ================================================
// globalaccum 0, barrier1
// globalaccum 1, barrier2
// 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, Allied CP
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, Axis CP
// accum 7, Obj. Docs
// accum 8, Forward Spawn
//


// ========================================================
// ============ Tank stuff starts here ====================
// ========================================================

tank
{
	spawn
	{
		wait 400
		followspline 0 spln0 50000 length 32 wait
		followspline 1 spln0 50000 length 32 wait

		trigger tank sound_idle
		trigger tank tracks_stop
	}

	death
	{
		accum 1 bitset 7
	}

	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/jagdpanther_africa_tracks.md3

		setstate tank_smoke invisible

		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"
		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	trigger barrier_built
	{
		accum 1 bitset 1
	}

	trigger barrier_destroyed
	{
		accum 1 bitreset 1
	}

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

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

		trigger self deathcheck_message
		accum 1 bitset 4

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks2.md3

		setstate tank_smoke default

		kill tank_construct

		trigger self sound_death
		trigger self tracks_stop

		trigger self script_lockout

		trigger self tracks_stop
		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!"

		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"
		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"
	}

	// ========================
	// movement

	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_24
		accum 3 trigger_if_equal 25 tank run_25
		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
	}

	trigger move
	{
		trigger self move_check
		wait 500
		trigger self move
	}

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger self dispatch
	}

	trigger run_continue
	{
		accum 3 inc 1

		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}

	trigger run_0
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln0 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_1
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln1 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln2 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln3 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_4
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln4 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_5
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln5 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_6
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln6 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_7
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln7 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_8
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln8 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_9
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln9 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_10
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln10 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_11
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln11 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_12
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln12 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln13 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_14
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln14 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_15
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln15 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_16
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln16 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_17
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln17 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_18
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln18 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_19
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln19 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_20
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln20 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_21
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln21 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_22
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln22 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_23
	{
		trigger self tracks_forward
		accum 1 bitset 2
	//	=======================
		trigger barrier1 remove
	//	=======================
		followspline 0 spln23 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_24
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln24 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_25
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln25 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_26
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln26 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_27
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln27 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_28
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln28 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_29
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln29 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_30
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln30 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_31
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln31 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_32
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln32 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_33
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln33 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_34
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln34 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_35
	{
		trigger self tracks_forward
		accum 1 bitset 2
	//	=======================
		trigger barrier2 remove
	//	=======================
		followspline 0 spln35 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_36
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln36 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_37
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln37 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_38
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln38 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_39
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln39 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_40
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln40 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_41
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln41 80 wait
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_42
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln42 80 wait
		accum 1 bitreset 2

		trigger self script_lockout

		accum 3 inc 1

		trigger tank_sound stop
		trigger self tracks_stop		
		startanimation 5 10 15 nolerp norandom	// stopping
		wait 666
		startanimation 0 1 15 nolerp norandom	// stopped

		wait 900

		trigger tank_turret turn
	}

	// =========================
	// script lockouts

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

	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
	}

	// ================================
	// stop check
	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		trigger tank_sound 	stop
		trigger self 		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 stopcheck_setup
	{
		accum 1 bitset 6				// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, 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
	}

	// ======================================
	// stuck checking

	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier
		trigger self stuck_check_barrier2
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
	//	The check should be the final spln nbr + 1
		accum 3 abort_if_less_than 43
		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0
		accum 1 bitset 3
	}

	trigger stuck_check_barrier
	{
		accum 3 abort_if_not_equal 23
		globalaccum 0 abort_if_not_bitset 0	// abort if barrier not built
		accum 1 bitset 3
	}
	trigger stuck_check_barrier2
	{
		accum 3 abort_if_not_equal 35
		globalaccum 1 abort_if_not_bitset 0	// abort if barrier not built
		accum 1 bitset 3
	}

	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
	}

	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

		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 tracks_forward

		trigger self script_lockout_stop

		trigger self move
	}

	trigger tracks_forward
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_left
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_right
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_left
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_right
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_left
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_right

		remapshaderflush
	}

	trigger tracks_turn_left
	{
		accum 0 abort_if_equal 2
		accum 0 set 2

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_turn_right
	{
		accum 0 abort_if_equal 3
		accum 0 set 3

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_backward

		remapshaderflush
	}

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}
}

tank_build
{
	spawn
	{
		wait 500
		attachtotag tank_shell 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_disabler
{
	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	trigger run
	{
		trigger tank tank_enable
	}
}

tank_fire_sound
{
	trigger run
	{
		setposition tank
		alertentity tank_fire_sound
	}
}

tank_flash
{
	spawn
	{
		wait 300
 		attachtotag tank_turret tag_flash
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_gunsmoke default
		setstate tank_flash default
		wait 100
		trigger tank_turret blow_door
		setstate tank_flash invisible
		setstate tank_gunsmoke invisible
	}
}

tank_gunsmoke
{
	spawn
	{
		wait 300
 		attachtotag tank_turret tag_flash
		setstate tank_gunsmoke invisible
	}
}

tank_shell
{
	spawn
	{
		wait 400
		attachtotag tank tag_tank
	}
}

tank_smoke
{
	spawn
	{
		wait 300
		attachtotag tank_shell tag_smoke
		setstate tank_smoke invisible
	}
}

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

tank_trigger
{
	spawn
	{
		wait 500
		attachtotag tank_shell tag_turret
	}
}

tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank_shell tag_turret
	}

	trigger turn
	{
		wait 1000

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 340 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav
		trigger tank_flash run
		wait 300
		trigger blowmain kill_door
		wait 300
		trigger tank stopfire

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

(TomTom7777) #3

By experiment the origin of the tank func_construct appears to be too high (z axis). I scripted in the following origin change and it tested OK.


tank_construct
{
	spawn
	{
[B]	   set
	   {
	      origin "-2612 -4124 750"
	   }[/B]
...

So shift the entity


{
"classname" "func_constructible"
"scriptname" "tank_construct"
"targetname" "tank_construct"
"spawnflags" "9"
"health" "50"
"origin" "-2612 -4124 1100"
"model" "*60"
}

down a bit ( inside the map editor) and then see if that makes it work in vanilla ET too. Why Goldrush’s func_construct works with its similar coords I don’t know but here 740 works, 750 works but 780 does not.


(ArnoWar) #4

I will try that asap… hope it helps. but I was sure it was a script problem as the tank can be repaired the first time ? :S

Thx in advance


(isbowhten) #5

built final
{
alertentity tank
wm_announce “The tank has been repaired!”
}
in the tank_construct part…
is only “alertentity tank” but the accum 7 (for death check purpouse) still remains bitset to 1, so it aborts the deathcheck


(ArnoWar) #6

Just to be sure we are talking about the same entity… My yellow (non solid no draw) with the origin inside right?
I tryed moveing them both down to 750 to the top of origin and mid of and bottom of but it dident help

But sure enough it works with the set origin in the script… its alittle wired :S


(ArnoWar) #7

[QUOTE=isbowhten;187510]built final
{
alertentity tank
wm_announce “The tank has been repaired!”
}
in the tank_construct part…
is only “alertentity tank” but the accum 7 (for death check purpouse) still remains bitset to 1, so it aborts the deathcheck[/QUOTE]

Isent that done here at the start of the script?

tank
{
	spawn
	{
		wait 400
		followspline 0 spln0 50000 length 32 wait
		followspline 1 spln0 50000 length 32 wait

		trigger tank sound_idle
		trigger tank tracks_stop
	}

	death
	{
		accum 1 bitset 7
	}

	rebirth


(TomTom7777) #8

I was confused by Isbowthen’s reply too. As long as the alertentity triggers the rebirth event it should work just identical to goldrush. The only other thing about accum 7 is in the allied_obj entity’s block (right after the end of the game_manager) which looks like dead code since allied_obj is not inside the game_manager where accum 7 is used and set.

Comparing to goldrush I note that without the change in origin you can’t initially repair the tank at the back of it like in goldrush. The construct/trigger_objective_info is shifted to the front. and when damaged its like the trigger_objective_info and the construct state are disconnected. The tag to the trigger_objective_info seems to work fine(i.e. command map and track parameter move). Now goldrush spawnflags are a little different on the tank_construct (2 extra flags are set in goldrush) and the trigger_objective_info has 1 more spawnflag set in goldrush. Using set in the script on the spawnflags did not work, but you could try setting them in the editor and see if it makes any difference.

EDIT:
On second thought skip that. The values I get using a bsp reader for goldrush I can’t set with the check boxes in GTKRad 1.5 so either the extra flags are useless or the reader is wrong.


(isbowhten) #9

yes youre right, i did not see that piece of script


(th0rn3) #10

can anyone explain me those bitsets? I dont understand a thing shame


(ArnoWar) #11

Ok I have moved this entity up and down the last copple of days, the problem still there… it only works when i add it to the script, what am i doing wrong?
How i did it…
hit L select the entity moved it down to 750 on the red ruler in the the 2d window

one bit is always 1 or 0 (bitset / bitreset)

this means you have 10 memery bits in one accum (0-9) this is only on/off bits and can remember if something is build or not and you can then check that bit in eg the tank script to se if a barrier is build or not can the tank move on?
If you need to remember a number you need the hole accum to make that number in a binary code
eg
1= 10000000
3= 11000000
32= 000001000
33= 100001000
2047= 111111111

Well, thats how i understand it :slight_smile:


(th0rn3) #12

I understand how it works too, but I just dont understand it in ET