Animate
3 posters
RigidChips :: Rigid-Chips :: Tutorials :: Request a Tutorial
Page 1 of 1
Animate
So this is actually a two-fold call for help:
1. I keep seeing the animate function in other people's lua. I am assuming that this changes the value of a variable step by step. Only problem is I have no idea how to use it and it doesn't appear in a any documentation. Any help would be welcomed.
2. I can't seem to get lua to recognize my key inputs. I am using RCD and when I put an if _keydown statement in the OnFrame function nothing happens what so ever. Once again help is appreciated.
Thanks in advance
-Munchkin9
1. I keep seeing the animate function in other people's lua. I am assuming that this changes the value of a variable step by step. Only problem is I have no idea how to use it and it doesn't appear in a any documentation. Any help would be welcomed.
2. I can't seem to get lua to recognize my key inputs. I am using RCD and when I put an if _keydown statement in the OnFrame function nothing happens what so ever. Once again help is appreciated.
Thanks in advance
-Munchkin9
Last edited by Munchkin9 on Sun May 29, 2011 3:21 pm; edited 2 times in total (Reason for editing : I failed)
Munchkin9- Cube
- Posts : 3
Join date : 2011-05-29
Re: Animate
1- foo = animate(foo,bar,baz)
2- the RC standard library lua functions need to be called with all letters capital.
this means you need to use _KEYDOWN(foo) instead of _keydown(foo)
2- the RC standard library lua functions need to be called with all letters capital.
this means you need to use _KEYDOWN(foo) instead of _keydown(foo)
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Animate
1. I literally have no idea what you just said.
2. I do use capitals. I was summing it up. I have actually since found that it does work. Only animate isn't working.
EDIT: What am I doing wrong:
The goal is: pressing 'V' will toggle a value between 1 and 0. If it is 1 then the air brakes deploy, if it is 0 then the air brakes retract. At the moment the air brakes aren't moving at all. The air brakes variables are set as the angles of two different chips (this works if I use keys normally but that requires two keys).
2. I do use capitals. I was summing it up. I have actually since found that it does work. Only animate isn't working.
EDIT: What am I doing wrong:
- Code:
if _KEYDOWN(10) > 0 then
if SWITCH == 0 then
SWITCH = 1
else
SWITCH = 0
end
end
if SWITCH == 1 then
AIRBRAKES = AIRBRAKES - 10
AIRBRAKES2 = AIRBRAKES2 + 10
else
AIRBRAKES = AIRBRAKES + 10
AIRBRAKES2 = AIRBRAKES2 - 10
end
The goal is: pressing 'V' will toggle a value between 1 and 0. If it is 1 then the air brakes deploy, if it is 0 then the air brakes retract. At the moment the air brakes aren't moving at all. The air brakes variables are set as the angles of two different chips (this works if I use keys normally but that requires two keys).
Last edited by Munchkin9 on Sun May 29, 2011 6:18 pm; edited 1 time in total (Reason for editing : Update)
Munchkin9- Cube
- Posts : 3
Join date : 2011-05-29
Re: Animate
The animate function is in my Lua library. In essence, a Lua library is a file that stores functions so that you don't have to copy the same set of common functions into each of your models. My library can be found here: https://rigidchips.forumotion.com/t54-bwansy-s-library
Re: Animate
You know I was thinking it might be only from your library. Since I'm pretty much learning all my programming by studying your stuff.
Mind explaining to me how it works? Looks useful.
Mind explaining to me how it works? Looks useful.
Munchkin9- Cube
- Posts : 3
Join date : 2011-05-29
RigidChips :: Rigid-Chips :: Tutorials :: Request a Tutorial
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum