planes again:P
Posted: Mon Apr 19, 2004 5:39 pm
ok, i have a plane that when triggerd spawns and then follows a path and then when it gets to the end it stops..all fine.gdgd
but..if triggerd again it already excists so it doesnt make spawn a new 1. but then the plane path says its running..but the plane is sat still...still.
1. How can i make a plane run over a path twice?
2. how can i make an entity spawn then someone shoots a trigger and it blows up. and then spawn another 1. (not needed as nuch as i could make it dissapear and then reuse it and show it again)
The plane is triggerd and then flys drops the bomb then flys out the map.then i want it to do it everytime the trigger is triggerd. Also the plane can be shot down then it crashes to someplace and it would be better for serv if it dissapeared and was reused but it would look better if it crashed then stayed their and a new plane was spawned. its usualy just me m8's and bro's playing anyway in lan. And the bomb has to be reused aswell. or deleted and respawned,, hope ya get me :/.
NOTE: Its Stock Map " Destroyed Village "
here is the code i used...it's like my 2nd script so please feel free to slate me:P
but..if triggerd again it already excists so it doesnt make spawn a new 1. but then the plane path says its running..but the plane is sat still...still.
1. How can i make a plane run over a path twice?
2. how can i make an entity spawn then someone shoots a trigger and it blows up. and then spawn another 1. (not needed as nuch as i could make it dissapear and then reuse it and show it again)
The plane is triggerd and then flys drops the bomb then flys out the map.then i want it to do it everytime the trigger is triggerd. Also the plane can be shot down then it crashes to someplace and it would be better for serv if it dissapeared and was reused but it would look better if it crashed then stayed their and a new plane was spawned. its usualy just me m8's and bro's playing anyway in lan. And the bomb has to be reused aswell. or deleted and respawned,, hope ya get me :/.
NOTE: Its Stock Map " Destroyed Village "
here is the code i used...it's like my 2nd script so please feel free to slate me:P
Code: Select all
local.master= spawn ScriptMaster
local.master aliascache snd_binoculars sound/mechanics/Mec_RadioNoise_11.wav soundparms 0.5 0.2 0.9 0.1 160 1600 item loaded maps "m3l2 m3l3 m5l3"
local.master aliascache drop_bomb6 sound/weapons/explo/Exp_LeadIn_11.wav soundparms 0.9 0.2 0.7 0.5 1600 9000 auto loaded maps level.script
local.master aliascache drop_bomb7 sound/weapons/explo/Exp_LeadIn_12.wav soundparms 0.9 0.2 0.7 0.5 1600 9000 auto loaded maps level.script
local.master aliascache drop_bomb8 sound/weapons/explo/Exp_LeadIn_13.wav soundparms 0.9 0.2 0.7 0.5 1600 9000 auto loaded maps level.script
local.master aliascache explode_tank1 sound/weapons/explo/Explo_MetalMed1.wav soundparms 0.9 0.2 0.8 0.2 1500 9000 weapon loaded maps level.script
local.master aliascache explode_tank2 sound/weapons/explo/Explo_MetalMed2.wav soundparms 0.9 0.2 0.8 0.2 1500 9000 weapon loaded maps level.script
local.master aliascache explode_tank3 sound/weapons/explo/Explo_MetalMed3.wav soundparms 0.9 0.2 0.8 0.2 1500 9000 weapon loaded maps level.script
local.master aliascache explode_tank4 sound/weapons/explo/Explo_MetalMed4.wav soundparms 0.9 0.2 0.8 0.2 1500 9000 weapon loaded maps level.script
binocular_fire:
if ($world.farplane == NIL ) {
level.bnok_sight_max = 22000
} else {
if ($world.farplane < 1) {
level.bnok_sight_max = 22000
} else {
level.bnok_sight_max = $world.farplane
}
}
self playsound snd_binoculars
thread plane_check
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * level.scout_sight_max) 0
local.org = spawn script_origin "targetname" "bomb_target1"
local.org.origin = local.hit_location
local.newvector = local.org.origin
local.newvector[0] = local.newvector[0]
local.newvector[1] = local.newvector[1]
local.newvector[2] = 800 ///local.newvector[2]
local.org1 = spawn script_origin "targetname" "bomb_target"
local.org1.origin = local.newvector
thread plane_spawn
end
plane_spawn:
//////**************main arioplane ***********///////
if(parm.planedone!=1)
{
spawn script_model "targetname" "plane" "model" "vehicles/stuka_fly.tik"///spwan airpolane
$plane.origin = ( -287.21 -3724.47 520.37 ) ///( -2365 -2535 -62 )
$plane.scale = 1.0
iprintln "lalla"
///////////////////**************spwan trigger to hurt plane*****//////////
local.shoot_plane = spawn trigger_multiple "spawnflags" "128" // "health" "100"
local.shoot_plane targetname shoot_plane
local.shoot_plane setsize ( -300 -300 -300 ) ( 300 300 300 )
local.shoot_plane setthread plane_hit
parm.planedone = 1
$shoot_plane glue $plane
}
thread events
end
events: /////////////////************Events for plane**********************////////////////////////
waitthread plane_path
thread drop_bomb ////drop the bom on the target sighted by the guy
waitthread plane_path2
//////////////testing stuff here to re-use plane
$plane respawn
$plane.origin = ( -287.21 -3724.47 520.37 )
end
//////////**********main plane fly path***********/////////
plane_path:
local.path1 = spawn info_splinepath "targetname" "path1"
local.path1.origin = $plane.origin
local.path1.angles = ( 0 0 0 )
local.path2 = spawn info_splinepath "targetname" "path2"
local.path2.origin = $bomb_target.origin
local.path2.angles = ( 0 0 0 )
iprintln "working"
local.path3 = spawn info_splinepath "targetname" "path3"
local.path3.origin = $bomb_target.origin - ( 1 1 0 )//
local.path3.angles = ( 0 0 0 )
local.path1 target local.path2
local.path2 target local.path3
$plane flypath $path1 900 400 150
$plane waitmove // or move
end
plane_path2:
local.path4 = spawn info_splinepath "targetname" "path4"
local.path4.origin = ( -1880 1383 800 )
local.path4.angles = ( 0 0 0 )
local.path5 = spawn info_splinepath "targetname" "path5"
local.path5.origin = ( -3342 1267 428 )
local.path5.angles = ( 0 0 0 )
local.path6 = spawn info_splinepath "targetname" "path6"
local.path6.origin = ( -3631 816 428 ) + ( 100 100 100 )
local.path6.angles = ( 0 0 0 )
local.path4 target local.path5
local.path5 target local.path6
$plane flypath $path4 900 400 150
$plane waitmove // or move
end
drop_bomb:
local.bottom_spot = $bomb_target1.origin
local.spot = trace $plane.origin local.bottom_spot 0
local.bomb = spawn script_model "targetname" "bomb"
$bomb model "ammo/us_bomb.tik"
$bomb.origin = $plane.origin
$bomb.angles= ( 90 0 0 )
$bomb notsolid
iprintln "dropped bomb"
$bomb playsound drop_bomb
$bomb moveto local.spot
$bomb speed 800
$bomb waitmove
//$bomb remove
$bomb scale 3.0
parm.target = local.spot
thread blow_a_place_up
$bomb delete
end
blow_a_place_up:
local.target = parm.target
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.Exp3 = spawn "animate/fx_mortar_higgins.tik"
exec global/earthquake.scr .23 4 0 0
iprintln parm.target
local.Exp1.origin = parm.target
local.Exp1 anim start
local.Exp2.origin = parm.target
local.Exp2 anim start
local.Exp3.origin = parm.target
local.Exp3 anim start
wait 1
// Remove the animations.
local.Exp1 remove
local.Exp2 remove
local.Exp3 remove
end
plane_hit:
local.player=parm.other
iprintln "PLANE SHOT"
///////****(note to self)*******sort this bit out later, use code writen for plane crash in algeriers******////////
$shoot_plane triggerable
$shoot_plane glue $plane
end