Page 1 of 2

Global strafeing and bombing script

Posted: Fri Jan 23, 2004 3:18 pm
by bdbodger
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

Posted: Sat Jan 24, 2004 9:43 am
by jv_map
Sounds cool 8-)

Posted: Sat Jan 24, 2004 1:28 pm
by small_sumo
I dl it, I will have a good look on tuesday. Thanks so much man.

Posted: Sat Jan 24, 2004 11:37 pm
by bdbodger
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 .

Posted: Mon Jan 26, 2004 10:28 am
by bdbodger
Script updated again I fixed the gun problem rotateing the plane is not needed any more and also fixed a problem with the sound playing after plane dies .

Posted: Thu Jan 29, 2004 10:28 pm
by bdbodger
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

Posted: Fri Jan 30, 2004 2:14 am
by ziptie2k2
OK time for me to sound stupid again. I take it this is a script for a plane to go rippin by shooting and bombing our a$$'s? If so it sounds like a nice addition to many maps. Could you do up a tut on it, and post it in with the rest? If this has nothing to do with what your doing, just ignore me :D

Posted: Fri Jan 30, 2004 3:12 am
by omniscient
dumb question - wtf is this?

Posted: Fri Jan 30, 2004 7:36 am
by bdbodger
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 .

Posted: Fri Jan 30, 2004 8:52 am
by small_sumo
Just download it and read his detailed "how to" in the script itself and give it a go. We do intend to make a copy paste style tut soon but dont stop from trying yourself its very easy to work with, and planes normally arnt.

:)

Posted: Fri Jan 30, 2004 2:21 pm
by bdbodger
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

Image

Posted: Sat Jan 31, 2004 3:44 am
by small_sumo
Wow how cool is that sheesh.

Posted: Tue May 04, 2004 8:48 am
by bdbodger
Just some new information it seems the #guns 0 key only works right if you start the script after level waittill spawn . I think is is because the nodes have not spawned yet so they can't save keys . So start the script like this

level waittill spawn

exec global/strafe.scr

Posted: Sat Aug 07, 2004 11:24 pm
by theMechanic
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!!

Posted: Sun Aug 08, 2004 8:41 am
by bdbodger
local.org15.strafe_path.speed = .9

info_splinepath nodes don't use strafe_path.speed and the global/strafe.scr does not either . You got a bad script . info_splinepath nodes use .speed

local.org15.speed = .9