Author |
Message |
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Lua errors, but script working?
Use self.RightTimer:Reset() and self.RightTimer:ElapsedSimS instead of numbers. Timers don't work like that.
|
Mon Feb 28, 2011 6:03 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Lua errors, but script working?
Yes. That translates as "if it has been more than 10 seconds".
You can also use MS for milliseconds, should you need it.
|
Mon Feb 28, 2011 6:33 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Lua errors, but script working?
Sorry, ElapsedSimTimeMS.
|
Mon Feb 28, 2011 6:50 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Lua errors, but script working?
Sorry, I'm off form today. It's self.RightTimer.ElapsedSimTimeMS
|
Mon Feb 28, 2011 7:10 pm |
|
|
zoidberg
Joined: Fri Feb 25, 2011 3:52 pm Posts: 39
|
Re: Lua errors, but script working?
GlobalAccS*c*alar should work)
|
Tue Mar 01, 2011 2:13 pm |
|
|
Abdul Alhazred
DRL Developer
Joined: Tue Aug 11, 2009 5:09 am Posts: 395
|
Re: Lua errors, but script working?
Nonsequitorian wrote: Thanks man. Code: self.Vel.Y = self.Vel.Y - (SceneMan.GlobalAccSalar * TimerMan.DeltaTimeSecs); The key to figuring out Lua scripting for CC is reading the documentation.The correct use in this case would be SceneMan.GlobalAcc.Y
|
Tue Mar 01, 2011 8:22 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Lua errors, but script working?
Velocity isn't a scalar, but a vector. You'd need to do something like Self.Velocity:SetMagnitude(Self.Velocity.Magnitude - 0.1) or whatever the actual syntax is.
|
Wed Mar 02, 2011 5:36 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Lua errors, but script working?
You have to type out "0.9". Otherwise, it thinks you're trying to access an object's member.
|
Thu Mar 03, 2011 12:16 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Lua errors, but script working?
It happens in the order that you've written it out. The velocity will be multiplied by 0.9, then its y-component will be decreased by the value of gravity times the delta time.
|
Thu Mar 03, 2011 1:10 am |
|
|
|