Vectors

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:

Vectors

Post by Elgan »

i want to move somehting to a origin but above
it..so 1 of the values has to be changed..somehow:S


$plane moveto parm.ent +=(0 999 0)
$plane speed 1000
$plane waitmove

wrong?.. i cant get this vector thing?:(

i tried this and it didnt work also "$player.origin += (5 6 7) // offset the player's origin by (5 6 7).2. thats a pure example:(...so lost:(
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

local.org = $plane.origin + (0 0 128)
$plane moveto local.org
$plane speed 1000
$plane waitmove
:D

by the way this has nothing to do with vectoring ;)
hope this helps, prob not cos it's all foreign 2 me :-/
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

:(

Post by Elgan »

the plane didnt go anywhere..


local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * level.scout_sight_max) 0
local.newvector = spawn script_origin origin local.hit_location
local.org = local.newvector + (0 600 0)
$plane moveto local.org
$plane speed 1000
$plane waitmove

ALSO: http://www.modtheater.com/forum/showthr ... post128676
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Why not spawn info_splinepath nodes and make the plane follow a path like I did for my global/strafe.scr that I made to spawn a strafeing plane .

local.path1 = spawn info_splinepath
local.path1.origin = ( ?? ?? ?? )
local.path1.angles = ( ?? ?? ?? )

local.path2 = spawn info_splinepath
local.path2.origin = ( ?? ?? ?? )
local.path2.angles = ( ?? ?? ?? )

local.path3 = spawn info_splinepath
local.path3.origin = ( ?? ?? ?? )
local.path3.angles = ( ?? ?? ?? )

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

local.plane = spawn script_model model vehicles/p47fly.tik
local.plane followpath local.path1
local.plane waitmove // or move

you can also set a speed at the nodes too

local.path1.speed .5 // normal speed is 1 adjust if that is too fast or too slow
Image
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

hehe nm. i got it working



local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * level.scout_sight_max) 0
local.org = spawn script_origin "targetname" "place"
local.org.origin = local.hit_location
local.newvector = $place.origin
local.newvector[0] = local.newvector[0]
local.newvector[1] = 688 //local.newvector[1] +
local.newvector[2] = local.newvector[2]

$plane moveto local.newvector
$plane speed 1000
$plane waitmove



and im not using a path because i want to be able to spot a place with binocs then the plane flys above it.,.,drops teh bombs then flys away..it works.ty
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

ok

Post by Elgan »

ok..now i need a path for the plane to crsh 2. i tried what u put above and it didnt work:(... can u double check it.hehe
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

i should post what i did before i critisise:$

Post by Elgan »

plane_crash_path:

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

local.path2 = spawn info_splinepath
local.path2.origin = ( -92 308 117 )
local.path2.angles = ( 18 -11 0 )
local.path2.speed = .5

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

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

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 local.path1
local.plane waitmove // or move

end
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well it does work we just have to find out what is wrong . Try putting

iprintln " this thread is running "

at the top of the thread to make sure the thread is starting ok . Check the console for any errors . Do you see the plane spawn ?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

targetname

Post by tltrude »

Wouldn't it be better to give the path a name.

local.path1 = spawn info_splinepath targetname "path1"

And then have the plane follow that.

local.plane followpath $path1
Tom Trude,

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

Post by Elgan »

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
Post Reply