Global strafeing and bombing script
Moderator: Moderators
Global strafeing and bombing script
Well the global strafeing and bombing script I was working on is done . The is a lot of things that can be done with this script too much for me to explain so I will just post the keys . Also there is some docs with it and a crude map .
//---------------------------------------------------------------------------------------------------
// First info_splinepath node keys
//---------------------------------------------------------------------------------------------------
//
// Key:$targetname Value: strafe_path ( not optional )
// Key:#set Value: < integer > ( set each each node to same set# each path to a different set # )
// Key:$mdl Value: < model > ( Plane model default vehicles/p47fly.tik)
// Key:$scrplane Value: < script_object> ( Script object brush model for plane instead of $mdl )
// Key:angles Value: < x y z > ( pitch roll yaw )
// Key:#planescale Value: < float > ( plane scale default 1 )
// Key:#gunangle Value: < angle > ( gun pitch angle default 30 )
// Key:#guns Value: < boolean > ( guns on or off (1,0) default 1 on )
// Key:#sideoffset Value: < float > ( gun offset from center * #planescale( damage trigger 100x100 * scale on center ) default 70 )
// Key:#forwardoffset Value: < float > ( gun forward offset from origin default 100 )
// Key:#heightoffset Value: < float > ( gun height offset from origin default 0 )
// Key:#damage Value: < integer > ( health when new plane spawned or after plane death default 1000)
// Key:#destroyable Value: < boolean > ( 1 destoyable 0 not destroyable default 1 overrides #damage )
// Key:$planeexpmdl Value: < emitter > ( plane explosion emitter default animate/fx_mortar_higgins.tik)
// Key:#planeexpscale Value: < float > ( plane explosion scale default 1 )
// Key:#pause Value: < time > ( optional time to wait after spawn before flying in sec )
//
//---------------------------------------------------------------------------------------------------
// All info_splinepath nodes keys ( read from node )
//---------------------------------------------------------------------------------------------------
//
// Key:#set Value: < integer > ( set each each node to same set# each path to a different set # )
// Key:$setthread Value: < thread > ( optional level.script thread to run when plane flys over node passes #set and #node to thread )
// Key:model Value: < model > ( optional editor model ( editor only ))
// Key:#planescale Value: < float > ( optional new plane scale )
// Key:#bombstart Value: < spawn # > ( optional spawn # delay for bombing if #bomb or #singlebomb set )
// Key:#bomb Value: < # spawns > ( optional value for bombing every # spawns (after #bombstart if #bombstart set))
// Key:#singlebomb Value: < boolean > ( optional value for single bomb drop , resets #bomb to NIL after bombing can be used with #bombstart )
// Key:#randombomb Value: < integer > ( optional Value for random bombing chance of bomb 1 to #randombomb )
// Key:$bombtarget Value: < targetname > ( optional entity targetname for bombing ( is reset to default bombing angles or $statictarget after bombing))
// Key:$statictarget Value: < targetname > ( optional entity targetname for bombing ( is not reset to default and is overridden if $bombtarget set))
// Key:$bombmodel Value: < model > ( optional model for bomb default ammo/us_bomb.tik )
// Key:#bombscale Value: < float > ( optional bomb scale set each node default 1 )
// Key:bombsound Value: < soundalias > ( optional sound for dropping bomb default drop_bomb )
// Key:bombdamage Value: < float > ( optional bomb damage default 500 )
// Key:bombradius Value: < float > ( optional bomb damage radius default 500 )
// Key:$expmodel Value: < emitter > ( optional explosion model for bombing default models/emitters/explosion_mine)
// Key:#expscale Value: < float > ( optional explosion model scale set each node default 1 )
// Key:$bombthread Value: < thread > ( optional level.script thread to run after bomb explosion passes #set and #node to thread)
// Key:#guns Value: < boolean > ( optional value to start/stop guns fireing ( 1 on 0 off ))
// Key:#gunangle Value: < newangle > ( optional new gun pitch angle )
// Key:speed Value: < float > ( optional new speed setting at node default 1 or speed set in editor )
//
//
//---------------------------------------------------------------------------------------------------
// Level Nodes ( Keys can be changed by script see Keys above )
//---------------------------------------------------------------------------------------------------
//
// level.strafenode[set #][node #].origin ( node origin )
// level.strafenode[set #][node #].angles ( node angles )
// level.strafenode[set #][node #].<key> ( read from node each flight )
// level.startbomb[set #][node # ] ( Stored after node setup can be changed to delay )
// ( bombing or set #bomb Key to NIL to stop bombing )
//
// level.index[set #][node #] ( counter for #bombstart and #bomb key , 1 to )
// ( startbomb then 1 to #bomb )
//
//---------------------------------------------------------------------------------------------------
You can get it here
http://members.shaw.ca/B.Boddy/global_strafe.pk3
//---------------------------------------------------------------------------------------------------
// First info_splinepath node keys
//---------------------------------------------------------------------------------------------------
//
// Key:$targetname Value: strafe_path ( not optional )
// Key:#set Value: < integer > ( set each each node to same set# each path to a different set # )
// Key:$mdl Value: < model > ( Plane model default vehicles/p47fly.tik)
// Key:$scrplane Value: < script_object> ( Script object brush model for plane instead of $mdl )
// Key:angles Value: < x y z > ( pitch roll yaw )
// Key:#planescale Value: < float > ( plane scale default 1 )
// Key:#gunangle Value: < angle > ( gun pitch angle default 30 )
// Key:#guns Value: < boolean > ( guns on or off (1,0) default 1 on )
// Key:#sideoffset Value: < float > ( gun offset from center * #planescale( damage trigger 100x100 * scale on center ) default 70 )
// Key:#forwardoffset Value: < float > ( gun forward offset from origin default 100 )
// Key:#heightoffset Value: < float > ( gun height offset from origin default 0 )
// Key:#damage Value: < integer > ( health when new plane spawned or after plane death default 1000)
// Key:#destroyable Value: < boolean > ( 1 destoyable 0 not destroyable default 1 overrides #damage )
// Key:$planeexpmdl Value: < emitter > ( plane explosion emitter default animate/fx_mortar_higgins.tik)
// Key:#planeexpscale Value: < float > ( plane explosion scale default 1 )
// Key:#pause Value: < time > ( optional time to wait after spawn before flying in sec )
//
//---------------------------------------------------------------------------------------------------
// All info_splinepath nodes keys ( read from node )
//---------------------------------------------------------------------------------------------------
//
// Key:#set Value: < integer > ( set each each node to same set# each path to a different set # )
// Key:$setthread Value: < thread > ( optional level.script thread to run when plane flys over node passes #set and #node to thread )
// Key:model Value: < model > ( optional editor model ( editor only ))
// Key:#planescale Value: < float > ( optional new plane scale )
// Key:#bombstart Value: < spawn # > ( optional spawn # delay for bombing if #bomb or #singlebomb set )
// Key:#bomb Value: < # spawns > ( optional value for bombing every # spawns (after #bombstart if #bombstart set))
// Key:#singlebomb Value: < boolean > ( optional value for single bomb drop , resets #bomb to NIL after bombing can be used with #bombstart )
// Key:#randombomb Value: < integer > ( optional Value for random bombing chance of bomb 1 to #randombomb )
// Key:$bombtarget Value: < targetname > ( optional entity targetname for bombing ( is reset to default bombing angles or $statictarget after bombing))
// Key:$statictarget Value: < targetname > ( optional entity targetname for bombing ( is not reset to default and is overridden if $bombtarget set))
// Key:$bombmodel Value: < model > ( optional model for bomb default ammo/us_bomb.tik )
// Key:#bombscale Value: < float > ( optional bomb scale set each node default 1 )
// Key:bombsound Value: < soundalias > ( optional sound for dropping bomb default drop_bomb )
// Key:bombdamage Value: < float > ( optional bomb damage default 500 )
// Key:bombradius Value: < float > ( optional bomb damage radius default 500 )
// Key:$expmodel Value: < emitter > ( optional explosion model for bombing default models/emitters/explosion_mine)
// Key:#expscale Value: < float > ( optional explosion model scale set each node default 1 )
// Key:$bombthread Value: < thread > ( optional level.script thread to run after bomb explosion passes #set and #node to thread)
// Key:#guns Value: < boolean > ( optional value to start/stop guns fireing ( 1 on 0 off ))
// Key:#gunangle Value: < newangle > ( optional new gun pitch angle )
// Key:speed Value: < float > ( optional new speed setting at node default 1 or speed set in editor )
//
//
//---------------------------------------------------------------------------------------------------
// Level Nodes ( Keys can be changed by script see Keys above )
//---------------------------------------------------------------------------------------------------
//
// level.strafenode[set #][node #].origin ( node origin )
// level.strafenode[set #][node #].angles ( node angles )
// level.strafenode[set #][node #].<key> ( read from node each flight )
// level.startbomb[set #][node # ] ( Stored after node setup can be changed to delay )
// ( bombing or set #bomb Key to NIL to stop bombing )
//
// level.index[set #][node #] ( counter for #bombstart and #bomb key , 1 to )
// ( startbomb then 1 to #bomb )
//
//---------------------------------------------------------------------------------------------------
You can get it here
http://members.shaw.ca/B.Boddy/global_strafe.pk3
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
there is a small update to the script . I discovered that when you spawn info splinepath nodes the gun angle was off a bit . I fixed it . Thanks deadeye for beta testing it . I had no problem when used in the editor but it seems that it was nessesary to rotate the plane to ( 0 0 0 ) while attaching the guns then rotate it back into place again .
Well found a error in script I fixed it . You can download again or open the script and change the word gunfire to guns . Better to download again to make sure you have the last version of the script . Also it is possible to spawn info_splinepath nodes
local.org1 = spawn info_splinepath "targetname" "strafe_path" //<-Always name first one strafe_path
local.org1.origin = ( 0 5135 1630)
local.org1.angles = ( 0 270 0 )
local.org1.mdl = vehicles/fockwulffly.tik
local.org1.set = 1
local.org1 = spawn info_splinepath "targetname" "strafe_path" //<-Always name first one strafe_path
local.org1.origin = ( 0 5135 1630)
local.org1.angles = ( 0 270 0 )
local.org1.mdl = vehicles/fockwulffly.tik
local.org1.set = 1
-
omniscient
- Major General
- Posts: 694
- Joined: Tue Sep 16, 2003 12:02 am
It is just what it sounds like . You make a path of info_splinepath nodes and name the first node $strafe_path . Just like the global/bomber.scr . This plane will strafe and or drop bombs at any of the nodes . You can set a key at any of the nodes to have the plane bomb at that node . If you set the bomb key to 1 the plane will bomb at this node everytime it is spawned . If you set the key to 3 it will bomb at this node every 3rd time it is spawned . If you set the randombomb key it will bomb at random from 1 to the number you set . You can bomb a target from the plane by setting the bombtarget key . You can set when to start the bombing like wait 2 spawns then start bombing . You can turn off the guns at any node , You can restart the guns at any node . You can change the angle the guns are shooting at at any of the nodes . You can spawn info_splinepath nodes into a stock map and have a strafeing or bombing plane . You can change the scale of the plane at any of the nodes for example you can have it small at first and as it appoches you can increase its scale make it look like it is getting closer from far away . You can change the keys from script like speed for example speed 1 just like the bomber script is default or you can set .5 to fly at half speed only in my script you can use script to change the keys at will . Fly once then change the keys and fly again . The plane has death effects too smoke and fire . You can set the damage key that is the amount of damage the plane can take health in other words or you can make the plane indestructable .
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
I added killzones to the script and a debuging tool for the people who like to spawn things into stock maps . Kill zones will target players when they are touching the zone . If you do it in the editor make a trigger_multiple and give it a targetname stkillzone and have it target a node then in your level.script after exec global/strafe.scr do this
thread global.strafe.scr::killzone
example of spawned killzone
local.zone = spawn trigger_multiple targetname "stkillzone"
local.zone setsize ( -100 -100 -100)(100 100 100)
local.zone.origin = (1389.58 623.78 -94.88)
local.zone.target = level.strafenode[1][2]
local.zone2 = spawn trigger_multiple targetname "stkillzone"
local.zone2 setsize ( -100 -100 -100)(100 100 100)
local.zone2.origin = (2108.30 107.64 -94.88)
local.zone2.target = level.strafenode[3][4]
thread global/strafe.scr::killzone
for debug info output to the console and the new debug too set level.debug = 1 // any value will enable debug
here is a pic of the debug tool which will let you see the nodes and bomb paths ( bomb paths only show after a bomb ) not seen in the picture is white coronas on ground at killzone origins

thread global.strafe.scr::killzone
example of spawned killzone
local.zone = spawn trigger_multiple targetname "stkillzone"
local.zone setsize ( -100 -100 -100)(100 100 100)
local.zone.origin = (1389.58 623.78 -94.88)
local.zone.target = level.strafenode[1][2]
local.zone2 = spawn trigger_multiple targetname "stkillzone"
local.zone2 setsize ( -100 -100 -100)(100 100 100)
local.zone2.origin = (2108.30 107.64 -94.88)
local.zone2.target = level.strafenode[3][4]
thread global/strafe.scr::killzone
for debug info output to the console and the new debug too set level.debug = 1 // any value will enable debug
here is a pic of the debug tool which will let you see the nodes and bomb paths ( bomb paths only show after a bomb ) not seen in the picture is white coronas on ground at killzone origins

- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
-
theMechanic
- Lance Corporal
- Posts: 15
- Joined: Tue Jun 17, 2003 10:13 pm
- Location: Ohio, USA
- Contact:
Ok, I got this shiz working, but have some errors.
NOTE: I hashed out the "level waittill spawn" in the script to see what would happen, wrong I know, was just testing. Error is gone, mod still functioning.
Loading Plane strafe SCR ver 1.1
level waittill spawn (global/strafe.scr, 452)
level ^
^~^~^ Script Error: invalid waittill spawn for 'Level'
and
local.org15.strafe_path.speed = .9 (maps/dm/mohdm2.scr, 950)
local.org15.strafe_path^
^~^~^ Script Error: Cannot cast 'NIL' to listener
I have tried the fix that worked before about moving the exec/global/strafe script around but still get the errors. So...
This is at the END of the script and am wondering if it is the culprit and how to fix it if it is:
level.script = maps/dm/mohdm2.scr
exec global/strafe.scr
wait 4
while(1)
{
thread hints
wait 5
exec global/strafe.scr::strafe 1
wait 20
}
end
hints:
iprintlnbold "WARNING.. ENEMY PLANE SPOTTED IN THE CLOUDS.."
wait 2
iprintlnbold "SHOOT THE BASTARD DOWN.. SHOOT EM!!"
end
Thanks again!!
NOTE: I hashed out the "level waittill spawn" in the script to see what would happen, wrong I know, was just testing. Error is gone, mod still functioning.
Loading Plane strafe SCR ver 1.1
level waittill spawn (global/strafe.scr, 452)
level ^
^~^~^ Script Error: invalid waittill spawn for 'Level'
and
local.org15.strafe_path.speed = .9 (maps/dm/mohdm2.scr, 950)
local.org15.strafe_path^
^~^~^ Script Error: Cannot cast 'NIL' to listener
I have tried the fix that worked before about moving the exec/global/strafe script around but still get the errors. So...
This is at the END of the script and am wondering if it is the culprit and how to fix it if it is:
level.script = maps/dm/mohdm2.scr
exec global/strafe.scr
wait 4
while(1)
{
thread hints
wait 5
exec global/strafe.scr::strafe 1
wait 20
}
end
hints:
iprintlnbold "WARNING.. ENEMY PLANE SPOTTED IN THE CLOUDS.."
wait 2
iprintlnbold "SHOOT THE BASTARD DOWN.. SHOOT EM!!"
end
Thanks again!!



