Page 1 of 1

plane follow path?

Posted: Fri Apr 16, 2004 7:01 pm
by Elgan
hey im trying to get a plane to follow a path in a stock map....but i cnat get it to work..?↕


plane_crash_path:

local.path1 = spawn info_splinepath targetname "path1"
local.path1.origin = $plane.origin
local.path1.angles = ( 0 0 0 )
local.path1.speed = .5

iprintln "done with path 1"

local.path2 = spawn info_splinepath
local.path2.origin = ( 800 -151 383 )
local.path2.angles = ( 0 0 0 )
local.path2.speed = .5

iprintln "done with path 2"

local.path3 = spawn info_splinepath
local.path3.origin = ( 800 -151 383 )
local.path3.angles = ( 0 0 0 )
local.path3.speed = .5

iprintln "done with path 3"

local.path4 = spawn info_splinepath
local.path4.origin = ( 1260 -350 284 )
local.path4.angles = ( 0 0 0 )
local.path4.speed = .5

iprintln "done with path 4"

local.path1.target = local.path2
local.path2.target = local.path3
local.path3.target = local.path4

local.plane = spawn script_model model vehicles/p47fly.tik
local.plane followpath $path1

local.plane waitmove // or move

end


it says it's done wiht all the paths..also the plane spawns at the first path...$plane.origin

Posted: Fri Apr 16, 2004 7:19 pm
by lizardkid
dunno if this will help but tag this "target" "path1" on to the end of
local.plane = spawn script_model model vehicles/p47fly.tik

anyway, i dunno if it will help. it's worth a shot anyway.

sorry if this is a weird question, but why are your splinepaths going at .5 speed?

and i don't know if you should spawn your plane as a local.xxx, isn't that a variable?


sorry if im a traditionalist, but here's the line i'd use.

spawn models/vehiclesp47fly.tik "$targetname" "plane"

etc.


none of this might help, but they're all things i'd try to do. if none of them work i am completely embarrassed. :wink:

Posted: Fri Apr 16, 2004 7:35 pm
by Elgan
and i don't know if you should spawn your plane as a local.xxx, isn't that a variable?

its a origin of a exsisting plane i have. and none of the rest of the things helped:(

try flypath

Posted: Fri Apr 16, 2004 8:52 pm
by tltrude
Try this:

local.plane = spawn script_model model "vehicles/p47fly.tik"
local.plane.origin = $path1.origin
local.plane speed 150
local.plane flypath $path1
local.plane waitmove // or move

Also, two of your pathnodes are in the same spot, and the speed should be set higher between nodes. If you want it to hit the ground, the last node should have a coordinate that is on the ground. You can then "remove" the local.plane and spawn a destroyed version of it, along with an explosion.

yesss

Posted: Fri Apr 16, 2004 8:58 pm
by Elgan
i love u. no. whats ur number?. lol omg.yes.. yay. !!!!!!!!!!!!!!!! TY..btw it worked..hehehehehhehehe

Posted: Sat Apr 17, 2004 10:17 am
by bdbodger
speed settings for flypath and followpath are a lot differnt . For followpath normal speed is 1 . For flypath the speed is set like this

level.plane[local.set] flypath level.strafenode[local.set][1] 1500 200 256

which is speed 1500 acceleration 200 and lookahead 256

lookahead makes the path smoother but does not fly exactly on the path but smooths out the turns that can miss a node if there is any reason for the plane to need to fly to the node . In my script the nodes think so I need the plane to fly on the path .

level.plane[local.set] followpath level.strafenode[local.set][1]

The speed for followpath is set on the info_splinepath nodes not by script so that is why I said to use .5 on the node that is not too fast and not too slow . My script does let you set the speed at any of the nodes useing script as well . Also with flypath the speed is set thoughout the flight unless you use modifyflypath from script with follow path like I said the plane gets it's speed from the nodes so if 1 node is speed 1 and another node is speed 2 then the plane gets to the second node it will start to fly twice as fast until it hits a node that has a new speed set . If you don't set a new speed at another node it keeps the same speed .

wow

Posted: Sat Apr 17, 2004 4:58 pm
by Elgan
cheers man. hows ya guess my plane was slow?.lol.hehe, ty maybe i can get it playing fast now:P.

but yay the airstrike works:P

Posted: Sat Apr 17, 2004 5:42 pm
by Elgan
cool. cheers. plane flys fast. and when yta shoot it.,..lots of fire.hehe. and the pilot falls out...but my ai is dead..:(