mohaa-spearhead-sdk/maps/tutorial/Test_Tanks.Scr
2003-02-06 00:00:00 +00:00

70 lines
2 KiB
Text

//-------------------------------------------------------------------------------
// Test_Tanks.Scr
//
// - Example code used to have the player drive a tank.
// - Examples of enemy tanks on paths attacking player tank.
//
//
//-------------------------------------------------------------------------------
level waittill prespawn
level waittill spawn
main:
level.lookahead = 256 // how far enemy tanks "look ahead" when driving
level.enemytankspeed = 200 // how fast the enemy tanks are
level.sightdistance = 2048 // how far the enemy tanks can "see"
$player holster
$player takeall
$player physics_off
$playertank waitthread global/vehicles_thinkers.scr::players_tank NULL
$playertank vehiclespeed 200
thread second_tank
// setup enemy tank targets...
level.playertanktarget = $player
wait 5
$s5_tank1 thread TankGo $s5_tank_path level.enemytankspeed empty_panzer_desert
end
//----------------------------------------------------------------------
second_tank:
//----------------------------------------------------------------------
$tank2_trigger waittill trigger
$tank2 thread TankGo $start_tank2 level.enemytankspeed empty_panzer_desert
end
//----------------------------------------------------------------------
TankGo local.path local.speed local.type:
//----------------------------------------------------------------------
self immune aagun
self thread global/vehicles_thinkers.scr::enemy_tank_think 0 local.type
self thread drive_path local.path local.speed
end
//----------------------------------------------------------------------
drive_path local.path local.speed:
//----------------------------------------------------------------------
self.driving = 1
// drive Vector position, speed, acceleration, reach_distance, look_ahead
self drive local.path local.speed 30 200 level.lookahead
self waittill drive
if (self)
{
self stop
self.driving = 0
}
end