Page 1 of 1
planes that drop bombs
Posted: Sat Jun 28, 2003 1:23 pm
by mohaa_rox
hello ppl, i can make planes, but i can't make 'em drop bombs. how to? i'm confused after i read the bomber.scr.
and how do i create the bomb speaker?
Posted: Sat Jun 28, 2003 2:04 pm
by nuggets
you could at certain times trigger the bomb only when the plane is at certain points
while ($plane istouching $overmydeadbody)
{$plane thread drop_bomb}
or
while (($plane.origin[0] > **) && ($plane.origin[0] < **))
{$plane thread drop_bomb}
Posted: Sat Jun 28, 2003 5:23 pm
by Desert Eagle
You could spawn them in like in the Berlin TOW, that is what I did for My Come In Fighting TOW.
On the map portion I set up 3 flypaths for the plane. The script does the rest: (Of course you could just change the while statement)
call_air_strike:
while( $Obj_airstrike.ControlledBy == 1 )
{
//Plane 1 flypath
local.rand = randomint (3)
switch( local.rand )
{
//local.flypath is the path the plane will follow
//local.wait is the delay before it drops it's bombs
case 0:
local.flypath = $plane_path1
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;
case 1:
local.flypath = $plane_path2
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;
case 2:
local.flypath = $plane_path3
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;
}
thread spawn_plane "Plane1" "Plane1_bomb" "Plane1_bomb2" local.flypath local.wait
//How long between plane runs
wait 15
}
end
//-----------------------------------------------
// Spawn in a plane
//-----------------------------------------------
spawn_plane local.planeName local.bombName local.bombName2 local.flypath local.wait:
//spawn the plane in and start flying over the target
spawn script_model model models/vehicles/p47fly.tik "$targetname" local.planeName origin local.flypath.origin
local.planeName followpath local.flypath 2500 1000 256
local.planeName playsound plane
local.planeName move
local.planeName notsolid
wait (randomfloat 1 + 0.5)
spawn models/projectiles/Berlin_Bombs.tik "$targetname" local.bombName origin local.flypath.origin
local.bombName becomebomb local.planeName
local.bombName model "ammo/us_bomb.tik"
local.bombName show
//Delay slightly before dropping the second bomb
wait 0.2
spawn models/projectiles/Berlin_Bombs.tik "$targetname" local.bombName2 origin local.flypath.origin
local.bombName2 becomebomb local.planeName
local.bombName2 model "ammo/us_bomb.tik"
local.bombName2 show
local.planeName waitmove
local.planeName remove
end