Page 1 of 1
Airplane dropping bombs
Posted: Tue Dec 14, 2004 1:37 am
by Grosskopf
Ok, now that I got my problem with Holland taken care of, I thought I'd post a tougher one here.
I've got many mods on my maps. I've integrated them all into one mod file instead of having multiple mods. Therefore, I've lost track as to who wrote this mod: In Brest, there's a plane that flies through, dropping bombs. I've looked at the code and it seems pretty much straightforward. You plot out the points on the map for the plane to fly and it does it. I would like to adapt this piece of code for use in Flughafen. I tried adjusting the code with coordinates appropriate to Flughafen, but it didn't seem to work right. The bombs were dropped in the right places, but the plane flashed around the screen and I didn't really get a good look at the path it was taking.
Perhaps someone can look at the original code from Brest and the code that I modified for Flughafen and offer some suggestions or even work it out so it'll follow a path, bombing as it goes. I tried to get it to go from the Allied area (near the Quansit Huts) to the Flak gun, then down to the Axis "HQ" type building (2 story bldg with the MG42 on the balcony). Here are the files:
http://www.flotserver.net/downloads/pla ... tplane.scr
http://www.flotserver.net/downloads/pla ... nplane.scr
Posted: Tue Dec 14, 2004 1:48 am
by lizardkid
it looks right... i didnt check for mispellings but i assume you copy/pasted so it should work.
how did you get new coords? fly in spec and use coord?
Posted: Tue Dec 14, 2004 3:26 am
by Grosskopf
lizardkid wrote:it looks right... i didnt check for mispellings but i assume you copy/pasted so it should work.
how did you get new coords? fly in spec and use coord?
I started up SH on my computer and loaded the map, the walked around the map. I am a bit confused about the coordinates though. In Brest, there are apparently 12 points that make up the path. How is it determined how many points you should have? How does it fly to the next point? How high should the plane be? I'm hoping someone that has experience with that particular piece of script will chime in with some advice. Maybe someone with more scripting experience than me will be able to clean up the code, plotting the proper points for me..
In any case, I will probably spend lots of time just plotting out the points and fine tuning it since it's a slow process. The other thing to consider is the angles at which the plane flies, but that could be cleaned up once the path is laid and the plane flies it.
Posted: Tue Dec 14, 2004 4:55 am
by lizardkid
i see, the planes should be about.. oh... above roof level for ease of flying (no tricky corners) and the bombs need to be dropped in arcs toward the ground and you should finish directly on the ground.
it doesnt matter how many nodes you have, but i think one of the reasons for the flickering is you have it spawning a plane each node with that /mdl value...
ok so replace the pathnodes with
Code: Select all
spawn script_object "targetname" "bomberpath" "classname" "info_splinepath"
$bomberpath.origin = ( 3500 2062 150)
$bomberpath.angles = ( 30 145 5)
$bomberpath.mdl = "vehicles/stuka_wing_d2.tik"
$bomberpath.set = 1
$bomberpath.speed = .8
$bomberpath.target = $pl1
spawn script_object "targetname" "pl1" "classname" "info_splinepath"
$pl1.origin = ( 1757 3000 150 )
$pl1.angles = ( 45 153 10)
$pl1.model = "vehicles/stuka_wing_d2.tik"
spawn script_origin "targetname" "pl2" "classname" "info_splinepath"
$pl2.origin = ( 3124 1453 150)
$pl2.angles = ( 25 -106 55)
$pl2.model = "vehicles/stuka_wing_d2.tik"
spawn script_origin "targetname" "pl3" "classname" "info_splinepath"
$pl3.origin = ( 280 -109 150 )
$pl3.angles = ( 0 -149 70)
$pl3.model = "vehicles/stuka_wing_d2.tik"
spawn script_origin "targetname" "pl4" "classname" "info_splinepath"
$pl4.origin = ( -3728 -789 150)
$pl4.angles = ( 0 150 55)
$pl4.model = "vehicles/stuka_wing_d2.tik"
with this..
Code: Select all
spawn script_object "targetname" "bomberpath" "classname" "info_splinepath"
$bomberpath.origin = ( 3500 2062 150)
$bomberpath.angles = ( 30 145 5)
$bomberpath.model = "vehicles/stuka_wing_d2.tik" //fockwulffly.tik
$bomberpath.mdl = "vehicles/stuka_wing_d2.tik"
$bomberpath.set = 1
$bomberpath.speed = .8
$bomberpath.target = $pl1
spawn script_object "targetname" "pl1" "classname" "info_splinepath"
$pl1.origin = ( 1757 3000 150 )
$pl1.angles = ( 45 153 10)
spawn script_origin "targetname" "pl2" "classname" "info_splinepath"
$pl2.origin = ( 3124 1453 150)
$pl2.angles = ( 25 -106 55)
spawn script_origin "targetname" "pl3" "classname" "info_splinepath"
$pl3.origin = ( 280 -109 150 )
$pl3.angles = ( 0 -149 70)
spawn script_origin "targetname" "pl4" "classname" "info_splinepath"
$pl4.origin = ( -3728 -789 150)
$pl4.angles = ( 0 150 55)
i got rid of the double modelk values too
try that and see if it works.
Posted: Wed Dec 15, 2004 2:13 pm
by Grosskopf
Thanks for the help so far. I've been thinking about it and I want to take a different approach. I remembered that in Berlin, if you are playing OBJ, you can flick a switch to call in allied air strikes. I have previously modded Berlin to allow players to use the air strike, artillery and radar switches in TDM mode (actually, because of my sloppy coding, you can use the switches in FFA mode too, but I'm planing on cleaning that up).
I figured I could do the same with Flughafen, using much of the same code from Berlin. I modded Flughafen so when you turn on the runway lights, you also call in an airstrike. Only the Allied can turn on the lights and only the axis can turn them off, just like in Flughafen's OBJ mode. However, when I modded it, I can't seem to get it so the runway lights are off when the map starts. I am sure it's a simple oversight on my part, but I just can't pin it down.
Here's a link to my script. Maybe one of you experts can look it over and see where I may have gone wrong?
http://www.flotserver.net/downloads/pla ... en_TOW.scr
Posted: Tue Jan 25, 2005 6:01 am
by Green Beret
try to put this below level waittill prespawn
$run_lights_01 hide
$run_lights_02 hide
$run_lights_03 hide
$run_lights_04 hide
$run_lights_05 hide
$run_lights_06 hide
$run_lights_07 hide
$run_lights_08 hide
$run_lights_09 hide
$run_lights_10 hide
$run_lights_11 hide
$run_lights_12 hide
So itll look similar to this.
Code: Select all
main:
level waittill prespwn
$run_lights_01 hide
$run_lights_02 hide
$run_lights_03 hide
$run_lights_04 hide
$run_lights_05 hide
$run_lights_06 hide
$run_lights_07 hide
$run_lights_08 hide
$run_lights_09 hide
$run_lights_10 hide
$run_lights_11 hide
$run_lights_12 hide
level waittill spawn
*********rest of code here***********
see if the lights stay off with it like that.
Posted: Tue Jan 25, 2005 7:49 am
by DeViL
hey do you gusy no the way to do it on the hunt

thankz

DeViL

Posted: Tue Jan 25, 2005 7:50 am
by DeViL
opps soz clicked twice