garage doors for truck


(Pukedukem) #1

Im trying to get my truck to stop at a spline intill the garade door is open. But I cant get the truck to stop, and im not sure how to setup my door for this. here is my door script.
Any help would be great.

Thanks.

gdoor_controller
{
activate
{
trigger gdoor use
}
}
gdoor
{
trigger use
{
trigger gdoor open
trigger gdoor close
}
trigger open
{
accum 1 abort_if_equal 1
accum 0 abort_if_equal 1
accum 1 set 1
accum 0 set 1
wait 60
playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
faceangles 270 0 0 4000
playsound sound/movers/misc/garage_door_end_01.wav volume 96
stopsound
accum 0 set 0
}

trigger close
{
accum 1 abort_if_equal 0
accum 0 abort_if_equal 1
accum 1 set 0
accum 0 set 1
wait 50

  playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
  faceangles 0 0 0 4000
  playsound sound/movers/misc/garage_door_end_01.wav volume 96
  stopsound
  accum 0 set 0

}
}


(Pukedukem) #2

you can send me a instant message if you want to help me out.

kingbee_20@yahoo.com


(seven_dc) #3

Maybe check the accum 1 in you spline script?
Like:
accum 1 abort_if_equal 1


Irritable bowel syndrome advice


(grizzlybear) #4

the door will need to trigger an accum state change in the truck script
look at how the script lockouts work for the tank barriers in goldrush (or pull the splines outta goldrush and delete inbetween moves that are not needed)

if u dont use the scriptlockout to stop the truck then sound, animation and damage/repair may not work correctly when stopped :wink:


(G0-Gerbil) #5

Canyou post a bit for the script lockouts? I don’t need them myself at the mo, but may do soon.


(grizzlybear) #6

they were the last piece of the puzzle (4 months after i started head scratching)
should of said stuck_checks
// ===========================================================================================
// ===========================================================================================
// stuck checking
trigger stuck_check
{
accum 1 bitreset 3
trigger self stuck_check_barrier1_built
trigger self stuck_check_scriptlockout
trigger self stuck_check_finished
}
trigger stuck_check_finished
{
accum 3 abort_if_less_than 15 //end point in tank/truck path
accum 1 bitset 3 //able to move again (movement loop)
}
trigger stuck_check_scriptlockout
{
accum 6 abort_if_equal 0 // use scriptlockout if animation (tankfire) needed
accum 1 bitset 3 //able to move again (movement loop)
}
trigger stuck_check_barrier1_built
{
accum 3 abort_if_not_equal 10 //ignore unless at point 10 of the tank/truck path

	accum 1 abort_if_not_bitset 0 // barrier/obstruction state

	accum 1 bitset 3 //able to move again (movement loop)
}

:wink:
starting to forget it all already :wink:
hope this helps

i have a scriptlockout in the tank path when the halftrack fires at the maingate the first time
just before the barrier
trigger run_3.6
{

	accum 1 bitset 2
	followspline 0 tp3.6 50 wait length 32
	accum 1 bitreset 2		//normal run
	trigger self script_lockout //halt 
	trigger tank_sound stop			//remove (unsure confused again)
	
	trigger self tracks_stop		//force tank to stop (prolly y tank sound stop is in)
	
	
	startanimation 45 10 15 nolerp norandom  // tank jiggle halt
	wait 666
	startanimation 0 1 15 nolerp norandom
	
	wait 900
	trigger tank startfire		//what it sez on the tin anim
	setstate tank_smoke default  //puf o smoke
	alertentity tank_shoot				// tank flash target_explosion
	wait 200
	setstate tank_smoke invisible //puf o smoke end
	trigger tank stopfire		// anim
	
	trigger frontdoor blownup		//dent door
	wait 1000
	trigger self script_lockout_stop //let all continue
	trigger self run_incpos		//tell script its arrived
								//stuck_check will run before next move and check barrier state
	
	
}
trigger run_4
{
	//trigger ht_wheels parra
	trigger self tracks_forward
	
	accum 1 bitset 2
	//followspline 0 tp3.6 50 wait length 32
	followspline 0 tp4 50 wait length 32
	accum 1 bitreset 2
	// **********************************
	trigger barricade remove
	// **********************************
	trigger self run_continue
	
	

}

:wink: confusious sez wat :slight_smile:


(Pukedukem) #7

thanks have goto work. Will try it later.
Thanks


(G0-Gerbil) #8

SDo basically is what you are saying is this:


they were the last piece of the puzzle (4 months after i started head scratching)
should of said stuck_checks
// ===========================================================================================
// ===========================================================================================
// stuck checking
trigger stuck_check
{
accum 1 bitreset 3
trigger self stuck_check_barrier1_built
trigger self stuck_check_scriptlockout
trigger self stuck_check_finished
}
trigger stuck_check_finished
{
accum 3 abort_if_less_than 15 //end point in tank/truck path
accum 1 bitset 3 //able to move again (movement loop)
}
trigger stuck_check_scriptlockout
{
accum 6 abort_if_equal 0 // use scriptlockout if animation (tankfire) needed
accum 1 bitset 3 //able to move again (movement loop)
}

If you want to override the normal following spline behaviour, you set accum 6 equal to zero, and when the tank animation has finished, you set accum 6 to a non-zero value again and it’ll work fine?


(Pukedukem) #9

fixed my problem


(Pukedukem) #10

i fixed it


(G0-Gerbil) #11

It’d help to detail how, in case other people have same problem in future :slight_smile:


(Pukedukem) #12

well I just stared at the script and the goldrush script forever. In my script i needed the door to start open so when you first shut it. it triggers the truck to stop if the door is closed. and to get the truck to stop I had to put in a spline number that was two steps before it had to stop. heres the working truck script. Hope it helps.

// Sat Aug 30 02:06:01 EDT 2003 - rain - fixed captured gold counter

game_manager
{
spawn
{
remapshader “models/mapobjects/tanks_sd/mg42turret” “models/mapobjects/tanks_sd/mg42turret_2”

	remapshaderflush
	
	// Game rules
	wm_axis_respawntime	05
	wm_allied_respawntime	05
	wm_number_of_objectives 7
	wm_set_round_timelimit	30

	// Objectives
	// 1: Steal Tank
	// 2: Protect Tank
	// 3: Blow bank doors
	// 4: Steal Gold
	// 5: Escape with gold
	// 6: Allied command post
	// 7: Axis command post

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

	wm_objective_status 1 0 0
	wm_objective_status 1 1 0
	wm_objective_status 2 0 0
	wm_objective_status 2 1 0
	wm_objective_status 3 0 0
	wm_objective_status 3 1 0
	wm_objective_status 4 0 0
	wm_objective_status 4 1 0
	wm_objective_status 5 0 0
	wm_objective_status 5 1 0
	wm_objective_status 6 0 0
	wm_objective_status 6 1 0
	wm_objective_status 7 0 0
	wm_objective_status 7 1 0

	wm_set_main_objective		1	0
	wm_set_main_objective		1	1

	// Stopwatch mode defending team (0=Axis, 1=Allies)
	wm_set_defending_team	0

	// Winner on expiration of round timer (0=Axis, 1=Allies)
	wm_setwinner	0

	wait 500
	setautospawn	"Tank Depot"	0
	setautospawn	"Allied Spawn"	1

	accum 4 set 0 // have the Allies stolen the tank?

	// start triggered loops on/off as required (eg: command post radio sounds)
	disablespeaker allies_compost_sound
	disablespeaker axis_compost_sound
	disablespeaker allies_compost_sound_lms
	disablespeaker axis_compost_sound_lms

	wait 2000

	// *----------------------------------- vo ------------------------------------------*
	wm_addteamvoiceannounce 0 "goldrush_axis_tank_steal"
	wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

	wm_addteamvoiceannounce 1 "goldrush_allies_tank_steal"
	wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

	wm_teamvoiceannounce 0 "goldrush_axis_tank_steal"
	wm_teamvoiceannounce 0 "axis_hq_compost_construct"

	wm_teamvoiceannounce 1 "goldrush_allies_tank_steal"
	wm_teamvoiceannounce 1 "allies_hq_compost_construct"
	// *---------------------------------------------------------------------------------*
}

trigger allies_win
{
	wm_setwinner	1
	wm_announce "Allied team escaped with the Gold Crates!"

	wm_objective_status 5 0 2
	wm_objective_status 5 1 1

	wait 1500
	wm_endround
}

trigger allies_steal_tank
{
	accum 4 abort_if_not_equal 0

	wm_announce "Allied team has stolen the Tank!"

	wm_objective_status 1 0 2
	wm_objective_status 1 1 1

	alertentity tankdepot_axis_spawns
	alertentity tankdepot_allied_spawns
	alertentity tankdepotblob		// Tank Depot team_WOLF_objective

	setautospawn	"Axis Spawn"	0
	setautospawn	"Tank Depot"	1

	accum 4 set 1
	wm_set_main_objective		2	0
	wm_set_main_objective		2	1

	trigger game_manager allies_steal_tank_allied_msg
	trigger game_manager allies_steal_tank_axis_msg

}

trigger allies_steal_tank_allied_msg
{
	// *----------------------------------- vo ------------------------------------------*
	wm_addteamvoiceannounce 1 "goldrush_allies_tank_courtyard"

	wm_teamvoiceannounce 1 "goldrush_allies_tank_stolen"
	wm_teamvoiceannounce 1 "goldrush_allies_tankbars_destroy"
	wm_teamvoiceannounce 1 "goldrush_allies_tank_courtyard"

	wm_removeteamvoiceannounce 1 "goldrush_allies_tank_steal"
	// *---------------------------------------------------------------------------------*
}

trigger allies_steal_tank_axis_msg
{
	// *----------------------------------- vo ------------------------------------------*
	wm_addteamvoiceannounce 0 "axis_hq_tank_stop"
	wm_addteamvoiceannounce 0 "goldrush_axis_tankbars_construct"

	wm_teamvoiceannounce 0 "goldrush_axis_tank_stolen"
	wm_teamvoiceannounce 0 "goldrush_axis_tankbars_construct"

	wm_removeteamvoiceannounce 0 "goldrush_axis_tank_steal"
	// *---------------------------------------------------------------------------------*
}

}

ceilingfan
{
spawn
{
wait 100
setrotation 0 300 0
}
}

/////////////////////////GARAGE DOORS//////////////////////////
glever22_controller
{
activate
{
trigger glever22 use
}
}
glever22
{
trigger use
{
trigger glever22 open
trigger glever22 close
}
trigger open
{
accum 1 abort_if_equal 1
accum 0 abort_if_equal 1
accum 1 set 1
accum 0 set 1
wait 60
// playsound sound
playsound sound/movers/switches/switch.wav
trigger gdoor2 open
trigger defense3 open
faceangles 270 0 0 1000
wait 3000
accum 0 set 0
}
trigger close
{
accum 1 abort_if_equal 0
accum 0 abort_if_equal 1
accum 1 set 0
accum 0 set 1
wait 60
// playsound sound/
playsound sound/movers/switches/switch.wav
trigger gdoor2 close
trigger defense3 close
faceangles 0 0 0 1000
wait 3000
accum 0 set 0
}
}

gdoor2_controller
{
activate
{
trigger gdoor2 use
}
}
gdoor2
{
trigger use
{
trigger gdoor2 open
trigger gdoor2 close
}
trigger open
{
accum 1 abort_if_equal 1
accum 0 abort_if_equal 1
accum 1 set 1
accum 0 set 1
wait 60
playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
faceangles 270 0 0 4000
playsound sound/movers/misc/garage_door_end_01.wav volume 96
stopsound
accum 0 set 0
}
trigger close
{
accum 1 abort_if_equal 0
accum 0 abort_if_equal 1
accum 1 set 0
accum 0 set 1
wait 50
playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
faceangles 0 0 0 4000
playsound sound/movers/misc/garage_door_end_01.wav volume 96
stopsound
accum 0 set 0
}
}

////////////////////////////////////TRUCK DOOR//////////////////////////////////////////////////
glever_controller
{
activate
{
trigger glever use
}
}
glever
{
trigger use
{
trigger glever open
trigger glever close
}
trigger open // actually door closes
{
accum 1 abort_if_equal 1
accum 0 abort_if_equal 1
accum 1 set 1
accum 0 set 1
wait 60
// playsound sound/effects/open_door.wav // play the open sound here if u want.
playsound sound/movers/switches/switch.wav
trigger gdoor open
faceangles 270 0 0 1000
wait 3000
accum 0 set 0
trigger truck stuck_check_glever
trigger truck enable_stage1
}
trigger close // actually opens door
{
accum 1 abort_if_equal 0
accum 0 abort_if_equal 1
accum 1 set 0
accum 0 set 1
wait 60
// playsound sound/effects/close_door.wav // play the close sound if you want.
playsound sound/movers/switches/switch.wav
trigger gdoor close
faceangles 0 0 0 1000
wait 3000
accum 0 set 0
trigger truck stuck_check_glever_close_msg
trigger truck disable_stage1
}

}

gdoor_controller
{
activate
{
trigger gdoor use
}
}
gdoor
{
trigger use
{
trigger gdoor open
trigger gdoor close
}
trigger open
{
accum 1 abort_if_equal 1
accum 0 abort_if_equal 1
accum 1 set 1
accum 0 set 1
wait 60
playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
faceangles 270 0 0 4000
stopsound
accum 0 set 0

}

trigger close
{
accum 1 abort_if_equal 0
accum 0 abort_if_equal 1
accum 1 set 0
accum 0 set 1
wait 50

  playsound sound/movers/misc/garage_door_loop_01.wav looping volume 512
  faceangles 0 0 0 4000
  playsound sound/movers/misc/garage_door_end_01.wav volume 96
  stopsound
  accum 0 set 0

}
}
/////////////////////////////////////////////////////////////////////////////////////////
//
//
//
// **********************************************
// ****************** TRUCK STUFF ***************
// **********************************************

truck_smoke
{
spawn
{
wait 300
attachtotag truck tag_wfront
setstate truck_smoke invisible
}
}

// sound “thread”
truck_engine
{
spawn
{
wait 200
attachtotag truck tag_wfront

	trigger truck_engine sound_idle
}

trigger start
{
	trigger truck_engine sound_start
	wait 950
	trigger truck_engine sound_move
}

trigger stop
{
	trigger truck_engine sound_stop
	wait 950
	trigger truck_engine sound_idle
}

// ========================================
// sound events
trigger sound_idle
{
	playsound sound/vehicles/truck/truck_idle.wav looping
}

trigger sound_start
{
	stopsound
	playsound sound/vehicles/truck/truck_revup.wav volume 96
}

trigger sound_move
{
	playsound sound/vehicles/truck/truck_move.wav looping
}

trigger sound_stop
{
	stopsound
	playsound sound/vehicles/truck/truck_revdown.wav volume 96
}

trigger sound_death
{
	stopsound
	playsound sound/vehicles/truck/truck_stop.wav volume 96
}

// ========================================
// ========================================

}

truck_build
{
spawn
{
wait 500

	attachtotag truck tag_wback
}

}

truck_construct
{
spawn
{
constructible_class 2
constructible_health 1050
constructible_constructxpbonus 10
constructible_destructxpbonus 10
}

built final
{
	alertentity truck

	wm_announce "The Truck has been repaired!"
}

}

// digibob: ok, for once i’m gonna PLAN this one, so NOTHING WILL BREAK EVAR
// ============================================================================
// accum 0, gold bars collected
// accum 1
// - bit 0: barrier 1 status ( 0 = destroyed, 1 = built )
// - bit 1: barrier 2 status ( 0 = destroyed, 1 = built )
// - bit 2: spline status ( 0 = not moving, 1 = moving )
// - bit 3: stuck check flag ( 0 = not stuck, 1 = stuck )
// - bit 4: script lockout ( 0 = no lockout, 1 = lockout )
// - 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, blank
// accum 6, blank
// accum 7, blank
// ============================================================================
// spline points are tspln_X with X = 1 to 23
// ============================================================================
// wheel events:
// - wheels_forward
// - wheels_backward
// - wheels_stop

truck
{
spawn
{
faceangles 0 0 0 0
}

// ========================================
// wheeeeeeeeeeeeeeels. eeels. ls.
trigger wheels_forward
{
	trigger truck_bwheel2 forward
	trigger truck_fwheel forward
}

trigger wheels_backward
{
	trigger truck_bwheel2 backward
	trigger truck_fwheel backward
}

trigger wheels_stop
{
	trigger truck_bwheel2 stop
	trigger truck_fwheel stop
}

// ========================================
// ========================================

trigger add_goldbar
{
	accum 0 inc 1

	trigger gold_full_0 show
	trigger gold_trans_0 hide
	trigger gold_crate secured

	accum 0 abort_if_less_than 2

	trigger gold_full_1 show
	trigger gold_trans_1 hide

	trigger self truck_escape_msg

	wm_announce "Allied team is escaping with the Gold Crates!"

	wm_objective_status 4 0 2
	wm_objective_status 4 1 1

	wm_set_main_objective 5 0
	wm_set_main_objective 5 1

	setstate goldbars_toi invisible
	setstate goldbars_cm_marker invisible
}

trigger truck_escape_msg
{
	// *----------------------------------- vo ------------------------------------------*
	wm_addteamvoiceannounce 0 "axis_hq_truck_stop"

	wm_addteamvoiceannounce 1 "allies_hq_truck_escort"

	wm_teamvoiceannounce 0 "goldrush_axis_truck_stolen"

	wm_teamvoiceannounce 1 "goldrush_allies_truck_stolen"

	wm_removeteamvoiceannounce 0 "goldrush_axis_bank_courtyard"
	wm_removeteamvoiceannounce 0 "goldrush_axis_gold_defend"

	wm_removeteamvoiceannounce 1 "goldrush_allies_bank_courtyard"
	wm_removeteamvoiceannounce 1 "goldrush_allies_gold_get"
	// *---------------------------------------------------------------------------------*
}

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

trigger move_check
{
	trigger truck stuck_check
	accum 1 abort_if_bitset 3

	trigger truck dispatch
}

trigger run_continue
{
	trigger truck deathcheck
	trigger truck stopcheck
	trigger truck move

}
trigger move
{
	trigger truck move_check

	wait 500

	trigger truck move
}

// ========================================
// ========================================
trigger run_1
{
	accum 1 bitset 2
	followspline 0 tspln_1 125 wait length 304 wait roll 0 2 dampin
	accum 1 bitreset 2

	accum 3 set 1
	trigger truck run_continue
}

trigger run_2
{
	accum 1 bitset 2
	followspline 0 tspln_2 125 wait length 304 wait roll 2 -1 dampout
	accum 1 bitreset 2

	accum 3 set 2
	trigger truck run_continue
}

trigger run_3
{
	
	accum 1 bitset 2
	followspline 0 tspln_3 125 wait length 304 wait roll 1 -1 dampout
	accum 1 bitreset 2

	accum 3 set 3
	trigger truck run_continue
}

trigger run_4
{
	accum 1 bitset 2
	followspline 0 tspln_4 125 wait length 304
	accum 1 bitreset 2

	accum 3 set 4
	trigger truck run_continue
}

trigger run_5
{

	accum 1 bitset 2
	followspline 0 tspln_5 125 wait length 304
	accum 1 bitreset 2
	
	
	accum 3 set 5
	trigger truck stuck_check_glever_close_msg
	trigger truck run_continue
}

trigger run_6
{
	accum 1 bitset 2
	followspline 0 tspln_6 125 wait length 304
	accum 1 bitreset 2

	accum 3 set 6
	trigger truck run_continue
}

trigger run_7
{
	
	
	accum 1 bitset 2
	followspline 0 tspln_7 125 wait length 304
	accum 1 bitreset 2

	accum 3 set 7
	trigger truck run_continue
}

trigger run_8
{
	
	trigger gdoor open
	
	accum 1 bitset 2
	followspline 0 tspln_8 125 wait length 304
	accum 1 bitreset 2

	accum 3 set 8
	trigger truck run_continue
}

trigger run_9
{
	accum 1 bitset 2
	followspline 0 tspln_9 125 wait length 304
	accum 1 bitreset 2

	accum 3 set 9

	trigger truck wheels_stop

	trigger game_manager allies_win
}

trigger dispatch
{
	accum 3 trigger_if_equal 0 	truck run_1
	accum 3 trigger_if_equal 1 	truck run_2
	accum 3 trigger_if_equal 2	truck run_3
	accum 3 trigger_if_equal 3 	truck run_4
	accum 3 trigger_if_equal 4 	truck run_5
	accum 3 trigger_if_equal 5 	truck run_6
	accum 3 trigger_if_equal 6 	truck run_7
	accum 3 trigger_if_equal 7 	truck run_8
	accum 3 trigger_if_equal 8 	truck run_9

}

// ========================================
// barrier checking
// digibob: since we cant return variables, just use bit 3 of accum 1 as a register... mmmm assembly......

trigger stuck_check
{
	accum 1 bitreset 3

	trigger truck stuck_check_gold
	trigger truck stuck_check_glever
	trigger truck stuck_check_scriptlockout
	trigger truck stuck_check_finished
}

trigger stuck_check_finished
{
	accum 3 abort_if_not_equal 6

	accum 1 bitset 3
}

trigger stuck_check_scriptlockout
{
	accum 1 abort_if_not_bitset 4

	accum 1 bitset 3
}

trigger stuck_check_gold
{
	accum 3 abort_if_not_equal 0

	accum 0 abort_if_greater_than 1

	accum 1 bitset 3
}

trigger stuck_check_glever
{
	accum 3 abort_if_not_equal 2

	accum 1 abort_if_not_bitset 0

	accum 1 bitset 3
}

trigger stuck_check_glever_close_msg
{
	accum 1 abort_if_not_bitset 0

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

// ========================================
// ========================================




// ========================================
// stop check

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 truck 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 keep going
}

trigger stopcheck
{
	trigger truck stopcheck_setup
	accum 1 abort_if_not_bitset 6

	trigger truck script_lockout

	// Any just stopped moving stuff goes here
	trigger truck_engine stop
	trigger truck 		wheels_stop
	// <<<<< stop animation goes here

	trigger truck script_lockout_stop
	resetscript
}

// ========================================
// ========================================




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

trigger script_lockout
{
	accum 1 bitset 4
}

trigger script_lockout_stop
{
	accum 1 bitreset 4
}

// ========================================
// ========================================


// ========================================
// enable/disable

trigger truck_enable
{
	trigger truck 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 1 abort_if_bitset 4 	// script lockout

	accum 1 abort_if_bitset 7 	// death check

	// Any just started moving stuff goes here
	trigger truck_engine start
	trigger truck wheels_forward
	// <<<<< start animation goes here
	trigger truck move
}

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

	accum 1 bitset 8			// set stop check

	trigger truck deathcheck
}

// ========================================
// ========================================

// ========================================
// death / rebirth

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

	changemodel models/mapobjects/blitz_sd/blitzbody.md3

	setstate truck_smoke invisible

	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "axis_hq_truck_repaired_allies"

	wm_teamvoiceannounce 1 "allies_hq_truck_repaired"
	// *---------------------------------------------------------------------------------*

	trigger truck move
}

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 1 abort_if_bitset 4		// are we not in a script lockout?

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

	wm_announce "The Truck has been damaged!"

	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "axis_hq_truck_damaged"

	wm_teamvoiceannounce 1 "allies_hq_truck_damaged_axis"
	// *---------------------------------------------------------------------------------*

	setstate truck_smoke default
	kill truck_construct

	trigger truck_engine sound_death
	//trigger truck tracks_stop		// truck with tracks? i don't think so
	trigger truck wheels_stop
	// <<<< stop anim goes here

	changemodel models/mapobjects/blitz_sd/blitzbody_damaged.md3

	resetscript
}

// ========================================
// ========================================




// ========================================
// barriers

trigger enable_stage1
{
	accum 1 bitreset 0
}

trigger disable_stage1
{
	accum 1 bitset 0
}

trigger enable_stage2
{
	accum 1 bitreset 1
}

trigger disable_stage2
{
	accum 1 bitset 1
}

// ========================================
// ========================================

}

truck_bwheel2
{
spawn
{
wait 500

	attachtotag truck tag_wback
}

trigger forward
{
	setrotation 130 0 0
}

trigger backward
{
	setrotation -130 0 0
}

trigger stop
{
	stoprotation
}

}

truck_fwheel
{
spawn
{
wait 500

	attachtotag truck tag_wfront
}

trigger forward
{
	setrotation 130 0 0
}

trigger backward
{
	setrotation -130 0 0
}

trigger stop
{
	stoprotation
}

}

truck_trigger
{
spawn
{
wait 500

	attachtotag truck tag_wback
}

}

truck_disabler
{
trigger run
{
trigger truck truck_disable
}
}

truck_enabler
{
trigger run
{
trigger truck truck_enable
}
}

// *********************************************
// *********************************************
// ****************** FLAG STUFF ***************
// *********************************************

goldbar_holder
{
death
{
trigger truck add_goldbar
}
}
// *********************************************
// ****************** GOLD STUFF ***************
// *********************************************

gold_crate
{
spawn
{
accum 0 set 0 // gold counter
accum 1 set 0 // rain - captured gold counter
}

trigger stolen
{
	accum 0 inc 1
	accum 0 trigger_if_equal 1 gold_crate stolen1
	accum 0 trigger_if_equal 2 gold_crate stolen2
}

trigger secured
{
	accum 1 inc 1
	accum 1 trigger_if_equal 1 gold_crate secured1
	accum 1 trigger_if_equal 2 gold_crate secured2
}

trigger returned
{
	accum 0 inc -1
	accum 0 trigger_if_equal 0 gold_crate returned1
	accum 0 trigger_if_equal 1 gold_crate returned2
}

trigger stolen1
{
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold1_taken"

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

trigger stolen2
{
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold2_taken"

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

trigger secured1
{
	wm_announce "Allied team has secured the first Gold Crate!"

	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold1_secured"

	wm_teamvoiceannounce 1 "goldrush_allies_gold1_secured"
	// *---------------------------------------------------------------------------------*
}

trigger secured2
{
	wm_announce "Allied team has secured the second Gold Crate!"

	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold2_secured"

	wm_teamvoiceannounce 1 "goldrush_allies_gold2_secured"

	wm_removeteamvoiceannounce 0 "goldrush_axis_gold_defend"

	wm_removeteamvoiceannounce 1 "goldrush_allies_gold_defend"
	// *---------------------------------------------------------------------------------*
}

trigger returned1
{
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold1_returned"

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

trigger returned2
{
	// *----------------------------------- vo ------------------------------------------*
	wm_teamvoiceannounce 0 "goldrush_axis_gold2_returned"

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

}

gold_full_0
{
spawn
{
wait 500
attachtotag truck tag_obj1
faceangles 0 90 0 50

	setstate gold_full_0 invisible
}

trigger show
{
	setstate gold_full_0 default
}

}

gold_full_1
{
spawn
{
wait 500
attachtotag truck tag_obj2
faceangles 0 90 0 50

	setstate gold_full_1 invisible
}

trigger show
{
	setstate gold_full_1 default
}

}

gold_trans_0
{
spawn
{
wait 500
attachtotag truck tag_obj1
faceangles 0 90 0 50
}

trigger hide
{
	setstate gold_trans_0 invisible
}

}

gold_trans_1
{
spawn
{
wait 500
attachtotag truck tag_obj2
faceangles 0 90 0 50
}

trigger hide
{
	setstate gold_trans_1 invisible
}

}

// ================================================

still havn’t finished my script to turn the gold into one book. should be easier then this tank and truck stuff.


(grizzlybear) #13

If you want to override the normal following spline behaviour, you set accum 6 equal to zero, and when the tank animation has finished, you set accum 6 to a non-zero value again and it’ll work fine?

i think so :wink:

the stuch check would be used for pausing (waiting for something to happen> map side)

accum 6

i think it stops the tank death interupting the scripted anim movement
i think i used it so i could stop sound and tracks movement before end of script movement

the tank script is so complicated im starting to forget it all :frowning:

gerbil u taught me tanks for rtcw :wink: happy to repay the honour :slight_smile:
ps. have u changed the tank for a ramming tower yet :wink:
ive got some juciy ideas :wink:


(Pukedukem) #14

yeah tank script was crazy. But I did it. and soon may forget it.