Page 1 of 1
Flying Planes
Posted: Thu Jan 08, 2009 5:35 pm
by 1lynx1
Hi i hope this is in the right place
but i have addded planes in my map with waypoints but when im in game my plane is on the floor :S
Hope you can help me,
Lynx
Re: Flying Planes
Posted: Thu Jan 08, 2009 8:27 pm
by Aprop
1lynx1 wrote:with waypoints
Lynx
They should be with splinepaths, buddy.
ok
Posted: Fri Jan 09, 2009 4:15 pm
by 1lynx1
ohhh well thanks alot illl go and see if it works
Cheers,
Lynx
ok...
Posted: Fri Jan 09, 2009 5:38 pm
by 1lynx1
ok it doesnt work and ive done that
here is my scr,
Code: Select all
main:
exec global/ai.scr
exec global/loadout.scr
exec gloal/friendly.scr
level waittill prespawn
exec global/ambient.scr
level waittill spawn
level.script = "maps DM Farm.scr"
thread p1
end
p1:
$p1 drive $w1p1
$w1p1 drive $w2p1
$w2p1 drive $w3p1
$w3p1 drive $w4p1
$w4p1 drive $w5p1
end
hope this helps,
Cheers,
Lynx
Posted: Fri Jan 09, 2009 7:24 pm
by Aprop
O god.. drive is for tanks, and should be used with speed, acc etc... look at the global/bomber.scr - you'll find here instruction
There are also some another errors in your code:
should be
should be
btw i dont know for what the hell you exec ai and friendly in dm??
Code: Select all
$w1p1 drive $w2p1
$w2p1 drive $w3p1
$w3p1 drive $w4p1
$w4p1 drive $w5p1
What should it do? What have those targetnames ?? PAth cant drive path...
lol
Posted: Fri Jan 09, 2009 10:29 pm
by 1lynx1
i dont know i aint much of a good scripet as you can tell
Cheers,
Lynx
Posted: Sat Jan 10, 2009 8:15 am
by Aprop
Well.... so download .map file o V2 rocket facility, open it and find splinepaths... open v2 scripts too. You'll see how it work... and here is tutorial copied fropm bomber.scr
// Plane/bombing system created by Mackey McCandlish.
//
// Before level waittill spawn "exec global/bomber.scr".
//
// Used in m3l3, m4l0, m5l1a, m5l1b, m5l3, m3l3, training, and maybe someplace else, who can say? (One of the DM levels too).
//
// Created a info_splinepath and click model and choose the plane you want to use. Choose one that ends with fly.tik.
//
// Copy the info_splinepath into a big line of them, of where you want the plane to fly through space.
//
// Link them all together.
//
// Give the first one a targetname of "bomberpath"
//
// Set this one's $mdl value to be equal to its model value.
//
// Rotate each individual info_splinepath. The way its rotated will determine what position the plane will be in when it flies
// through that point in space.
//
// You can set the "speed" key to multiplicably values. This defaults to 1. If you think 1 is too fast, set all the splines
// to a .speed of 0.5. Or set half of them to 0.5, and for that half the plane will fly at half speed.
//
// You can make the planes drop bombs by setting up similar paths using the model "ammo/us_bomb.tik", and the first spline
// on the path has targetname "bomber".
//
// Both the "bomber" and the "bomberpath" entities are given the same #set value, to associate them. You can give the bombers
// a $setthread value to make them run a thread in the level.script upon impact. They automatically do an explosion when they
// reach the end of their path.
//
// You can make triggers for the bombers with "trigger_multiple"s that have a targetname "bombertrigger" and the same #set
// number as the bomberpath, or you can do "thread global/bomber.scr::bomb #" where # is the #set number in question.
So all what you need it some splinepath, first group for first plane with #set 1, secon with #set 2 etc.... every splienpath link to next, CTRL + K... first must have targetname bomberpath
In map scripts when you want to call plane thread global/bomber.scr::bomb 1 (or 2, 3 100 etc) - its number of set of path (#set 1)
If you still have problem, try copy ALL about bombers from v2 script and map, and compile it under another name.....
I hope you'll got it, good luck
Posted: Tue Jan 13, 2009 7:37 pm
by $oldier Of Ra
Aprop wrote:try copy ALL about bombers from v2 script and map, and compile it under another name.....
Yeah I'm sure that'll work...
Lynx: Well those targetnames... do those entities exist? If so, make sure they are splinepaths! And also why should path X "drive" to the next path and so on? Shouldn't, you know, like a plane
fly those paths?
I use my own tools to generate splinepaths. It can be time consuming manually. This is how I get the job done. Aren't arrays and for statements handy?

Ofc, you do not have to do it so complicated, spawn them in radiant or with local vars in script, doesn't matter.
Code: Select all
// ---------------------------------------------
// Path 1 starting from the railway line
// ---------------------------------------------
level.pl[1] = spawn info_splinepath
level.pl[1].origin = ( -6688.546 -4066.648 1759.336 )
level.pl[1].angles = ( 0.000 11.135 0.000 )
level.pl[2] = spawn info_splinepath
level.pl[2].origin = ( -1598.079 -3088.307 1759.336 )
level.pl[2].angles = ( 0.000 28.993 0.000 )
level.pl[3] = spawn info_splinepath
level.pl[3].origin = ( -950.367 -2686.572 1759.336 )
level.pl[3].angles = ( 0.000 45.747 0.000 )
level.pl[4] = spawn info_splinepath
level.pl[4].origin = ( -444.396 -2033.868 1759.336 )
level.pl[4].angles = ( 0.000 66.929 0.000 )
level.pl[5] = spawn info_splinepath
level.pl[5].origin = ( -165.854 -333.093 1759.336 )
level.pl[5].angles = ( 0.000 82.991 0.000 )
level.pl[6] = spawn info_splinepath
level.pl[6].origin = ( 142.919 1085.946 1759.336 )
level.pl[6].angles = ( 0.000 67.758 0.000 )
level.pl[7] = spawn info_splinepath
level.pl[7].origin = ( 1123.328 3751.507 1759.336 )
level.pl[7].angles = ( 0.000 73.438 0.000 )
level.pl[8] = spawn info_splinepath
level.pl[8].origin = ( 1543.310 5498.362 1461.033 )
level.pl[8].angles = ( 0.000 75.932 0.000 )
level.pl[9] = spawn info_splinepath
level.pl[9].origin = ( 1946.042 7550.250 1351.406 )
level.pl[9].angles = ( 0.000 151.804 0.000 )
for (local.c = 1; local.c < level.pl.size; local.c++)
{
level.pl[local.c].target = level.pl[(local.c + 1)]
}
Make sure
all paths are
connected. I used a for statement since I used arrays to spawn those splinepaths, since you're a newbie, you'll need to do it manually:
Code: Select all
$path1.target = $path2
$path2.target = $path3
and so on. But I doubt you can do this in radiant so make sure these paths have targetnames when you create in radiant so you can connect them in your script.
To make a plane fly these paths. Spawn a planemodel with "fly" at the end of it's modelname.
Then simply:
<your_plane> flypath <1st_path> <speed> <acceleration>
translated in script that would be:
Code: Select all
$myplane flypath $path1 850 360
waitmove //!!!!
The plane'll automatically fly the entire path with the speed and acceleration specified (if you connected all of them ofc, with the target thing) and automatically adjust it's angles to the angles of the splinepath it flies over. It'll also pitch up if the next path is higher than the plane's current location and vice versa. It'll stop at the last node. You might want to hide or delete the plane then, I always do so I can't really remember if he disappears himself or just stays there. (Do this after waitmove. Waitmove starts the flying and pauses the script until the plane has done the entire path!)