Author |
Message |
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Lua Error
What does this mean? Thanks The script is applies for particles
|
Thu Jun 11, 2009 1:49 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Lua Error
I believe you're trying to put Vel (which is a Vector) into a function, when the function or whatever wants a number.
|
Thu Jun 11, 2009 1:52 am |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Lua Error
Wierd thing is it works for actors, but not particles.
|
Thu Jun 11, 2009 1:53 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Lua Error
You need to add either a .X or a .Y to choose which velocity you want.
|
Thu Jun 11, 2009 1:56 am |
|
|
robolee
Joined: Fri May 11, 2007 4:30 pm Posts: 1040 Location: England
|
Re: Lua Error
Duh got it the wrong way round, you've put "Actor.Vel(number)" but it needs a vector, so "Actor.Vel(number, angle)" is what you need.
What you can do is "Actor.Vel.Magnitude = number"... I think, though I'm not sure if you can just directly alter the magnitude like that without setting the angle, try it, if it doesn't work then you need to do "Actor.Vel(number, Actor.RotAngle)".
|
Thu Jun 11, 2009 4:20 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Lua Error
robolee wrote: Actor.Vel(number, angle) Oh, Cortex vectors are (length, angle)? I thought they were (X, Y)...
|
Thu Jun 11, 2009 4:29 pm |
|
|
piipu
Joined: Mon Jun 30, 2008 9:13 pm Posts: 499 Location: Finland
|
Re: Lua Error
They are (X,Y). Roboblee is wrong in everything he said. You probably need to use actor.Vel:SetMagnitude(insert magnitude here). Or actor.Vel = Vector(X,Y).
|
Thu Jun 11, 2009 5:41 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Lua Error
Confusion about polar coordinates versus cartesian.
But CC uses cartesian anyways.
|
Thu Jun 11, 2009 7:22 pm |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Lua Error
But im using particles, and it gives me that error, but with actors, it doesnt. Mail said it worked fine for him, so ill just try and save it into a new lua file
|
Thu Jun 11, 2009 8:04 pm |
|
|
robolee
Joined: Fri May 11, 2007 4:30 pm Posts: 1040 Location: England
|
Re: Lua Error
Yeah, sorry guys I wasn't thinking right, it's Actor.Vel(X velocity, Y velocity) it's not just X,Y though as that would be a position and not a velocity. I was thinking in "real" physics terms (in which a velocity is given as the velocity and direction and not the components) and not game terms. I don't know ALL the lua functions and I was just guessing that "Actor.Vel.Magnitude = number" might work, though I did doubt it.
if I didn't get the variables for the funtion mixed up I would have basically said what piipu said, minus the correct function for setting magnitude.
|
Sun Jun 14, 2009 3:46 pm |
|
|
|