Page 1 of 1
Strafe2.scr
Posted: Tue Jul 13, 2004 4:42 pm
by strafer
I have been trying to use strafe2.scr instead of bomber.scr and I am having a problem. I have got it to where the sound of the plane goes by, but I don't see a model of the plane and it doesn't drop a bomb and the guns don't turn on. Here's my script:
local.org1 = spawn info_splinepath "targetname" "node1"
local.org1.origin = ( 180 -519 1233 )
local.org1.angles = ( 53 90 0 )
local.org1.model = "vehicles/p47fly.tik"
local.org1.mdl = "vehicles/p47fly.tik"
local.org1.guns = 1
local.org1.gunangle = 53
local.org2 = spawn info_splinepath "targetname" "node2"
local.org2.origin = ( 167 191 743 )
local.org2.angles = ( 0 90 0 )
local.org2.model = "vehicles/p47fly.tik"
local.org2.mdl = "vehicles/p47fly.tik"
local.org2.randombomb = 1
local.org2.bomb = 1
local.org3 = spawn info_splinepath "targetname" "node3"
local.org3.origin = ( 216 991 1255 )
local.org3.angles = ( -26 90 0 )
local.org3.model = "vehicles/p47fly.tik"
local.org3.mdl = "vehicles/p47fly.tik"
local.org4 = spawn info_splinepath "targetname" "node4"
local.org4.origin = ( 372 4160 1703 )
local.org4.angles = ( 2 90 0 )
local.org4.model = "vehicles/p47fly.tik"
local.org4.mdl = "vehicles/p47fly.tik"
spawn script_object "targetname" "strafe_path" "classname" "info_splinepath"
$strafe_path.origin = ( 232 -2582 3172 )
$strafe_path.angles = ( 57 90 0 )
$strafe_path.model = "vehicles/p47fly.tik"
$strafe_path.mdl = "vehicles/p47fly.tik"
$strafe_path.set = 1
$strafe_path.speed = 1
$strafe_path.target = $node1
$strafe_path.guns = 1
$strafe_path.diebounce = 1
$strafe_path.bomb = 1
$strafe_path.destroyable = 1
// Plane 1 bomb
spawn script_origin "targetname" "p1b1o1" "classname" "info_splinepath"
$p1b1o1.origin = ( 154 298 775)
$p1b1o1.model = "ammo/us_bomb.tik"
spawn script_origin "targetname" "p1b1o2" "classname" "info_splinepath"
$p1b1o2.origin = ( 121 502 419)
$p1b1o2.model = "ammo/us_bomb.tik"
spawn script_object "targetname" "bomber" "classname" "info_splinepath" "origin" $node2.origin "#set" "1" "model" "ammo/us_bomb.tik" "$mdl" "ammo/us_bomb.tik" "target" $p1b1o1
$p1b1o1.target = $p1b1o2
// Set plane's paths
$node1.target = $node2
$node2.target = $node3
$node3.target = $node4
bombor1:
local.planewait = randomint (0) + 20
wait local.planewait
thread global/strafe2.scr::strafe 1
goto bombor1
Anyone know what's wrong?
Posted: Tue Jul 13, 2004 9:13 pm
by bdbodger
Try this out
local.org1 = spawn info_splinepath "targetname" "strafe_path"
local.org1.origin = ( 232 -2582 3172 )
local.org1.angles = ( 57 90 0 )
local.org1.mdl = "vehicles/p47fly.tik"
local.org1.set = 1
local.org1.speed = 1 // speed defaults to 1 you don't need to set it
local.org1.guns = 1 // guns start on you don't need to set this here
local.org1.diebounce = 1
local.org1.bomb = 1
local.org1.destroyable = 1
local.org2 = spawn info_splinepath "targetname" "node2"
local.org2.origin = ( 180 -519 1233 )
local.org2.angles = ( 53 90 0 )
local.org2.guns = 1
local.org2.gunangle = 53
local.org3 = spawn info_splinepath "targetname" "node3"
local.org3.origin = ( 167 191 743 )
local.org3.angles = ( 0 90 0 )
local.org3.randombomb = 1
local.org3.bomb = 1
local.org4 = spawn info_splinepath "targetname" "node4"
local.org4.origin = ( 216 991 1255 )
local.org4.angles = ( -26 90 0 )
local.org5 = spawn info_splinepath "targetname" "node5"
local.org5.origin = ( 372 4160 1703 )
local.org5.angles = ( 2 90 0 )
local.org1.target = local.org2
local.org2.target = local.org3
local.org3.target = local.org4
local.org4.target = local.org5
exec global/strafe2.scr // after spawning you need to run script to set it up
end
bombor1:
wait (randomint(20))
thread global/strafe2.scr::strafe 1
goto bombor1
end
Posted: Wed Jul 14, 2004 4:29 am
by strafer
Ok. The plane bombs and everything, but the plane sometimes doesn't have a model. It seems that if it is too high then it doesn't show any model for the plane, but the height worked before on the global/bomber.scr file. Is it a scripting error? Thanks for all of your help.
Posted: Wed Jul 14, 2004 12:03 pm
by bdbodger
It is not a scripting error your plane is probably outside of the sky box not all maps are good for planes . Also the default plane model is "vehicles/p47fly.tik" so you don't need the mdl key .
Posted: Wed Jul 14, 2004 6:13 pm
by strafer
Yeah, they are our of the skybox, but the planes worked on bomber.scr. I'll just lower them down.
Posted: Wed Jul 14, 2004 8:17 pm
by strafer
How do I make it bomb every run instead of just once the whole map?
Posted: Wed Jul 14, 2004 10:24 pm
by bdbodger
Read the top of the script if the key bombing is set then the plane bombs every that many spawns so if you set it to 2 then it bombs every second time it is spawned and if set to 1 then every time it is spawned .
// 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)
Posted: Wed Jul 14, 2004 11:58 pm
by strafer
so you would put something like:
local.org1.bomb = 1
If so, I have already tried that. I may be scripting it wrong though. The strafe2.scr file is new to me.
Posted: Thu Jul 15, 2004 9:32 am
by bdbodger
I recomend that you don't use the bomb key on the first node that is the node that the plane spawns at . I am not sure what the problem is the script is being used by many people and I have not had any other reports of it not working .
Posted: Thu Jul 15, 2004 6:03 pm
by strafer
I'm about to tear my hair out!
Can you see if I'm doing anything wrong? I can hear the bomb drop on the second run, there's just no model or explosion or sound of the explosion. There is also an error message in the console "Script error: level.index[self.set][local.nodenum] = 1"
Here's my script:
plane:
// Plane 1 p47 coming from west and bombing the axis bridge
local.org1 = spawn info_splinepath "targetname" "strafe_path"
local.org1.origin = ( 232 -2582 1188 )
local.org1.angles = ( 0 90 0 )
local.org1.model = "vehicles/p47fly.tik"
local.org1.mdl = "vehicles/p47fly.tik"
local.org1.set = 1
local.org1.speed = .5 // speed defaults to 1 you don't need to set it
local.org1.guns = 1 // guns start on you don't need to set this here
local.org1.diebounce = 1
local.org1.damage = 500
local.org2 = spawn info_splinepath "targetname" "node2"
local.org2.origin = ( 180 -519 1188 )
local.org2.angles = ( 53 90 0 )
local.org2.guns = 1
local.org2.gunangle = 40
local.org3 = spawn info_splinepath "targetname" "node3"
local.org3.origin = ( 167 191 743 )
local.org3.angles = ( 0 90 0 )
local.org3.bomb = 1
local.org3.bombradius = 500
local.org4 = spawn info_splinepath "targetname" "node4"
local.org4.origin = ( 216 991 1188 )
local.org4.angles = ( -26 90 0 )
local.org5 = spawn info_splinepath "targetname" "node5"
local.org5.origin = ( 372 4160 1188 )
local.org5.angles = ( 2 90 0 )
Posted: Thu Jul 15, 2004 10:05 pm
by bdbodger
After spawning all the info_splinepath nodes you run the global/strafe.scr to setup the nodes . Each node is numbered useing the order that the script finds them starting from the first node that has the targetname strafe_path
level.index[self.set][local.nodenum]
Is an index number for decideing when to bomb
Give all the node of the same path the same set number
local.org2.set = 1
local.org3.set = 1
local.org4.set = 1
local.org5.set = 1
I did put a line in the script to automatically do this if you didn't but for some reason I commented it out
//level.strafenode[local.set][local.nodes].set = local.set
Posted: Fri Jul 16, 2004 3:59 am
by strafer
Wow...I really missed that simple detail. Works just fine now. Thanks for all your help

.