View unanswered posts | View active topics It is currently Tue Jun 04, 2024 8:37 pm



Reply to topic  [ 10 posts ] 
 Lua Error 
Author Message
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1359
Location: USA
Reply with quote
Post Lua Error
What does this mean?

Image

Thanks :) The script is applies for particles


Thu Jun 11, 2009 1:49 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1359
Location: USA
Reply with quote
Post Re: Lua Error
Wierd thing is it works for actors, but not particles.


Thu Jun 11, 2009 1:53 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post 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
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Lua Error
Confusion about polar coordinates versus cartesian.

But CC uses cartesian anyways.


Thu Jun 11, 2009 7:22 pm
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1359
Location: USA
Reply with quote
Post 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
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.020s | 12 Queries | GZIP : Off ]