plane follow path?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

plane follow path?

Post 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
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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:(
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

try flypath

Post 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.
Tom Trude,

Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

yesss

Post by Elgan »

i love u. no. whats ur number?. lol omg.yes.. yay. !!!!!!!!!!!!!!!! TY..btw it worked..hehehehehhehehe
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

wow

Post 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
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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..:(
Post Reply