Lua help, and RC english documentation
2 posters
Page 1 of 1
Lua help, and RC english documentation
If I remember correctly, mouse button 3 (the mouse wheel) could be used as an input via Lua. How would you check if it is pressed? I'm pretty sure it was mentioned somewhere in the RC English documentation, but that was lost along with the Old/New/Dead forums. That, and is there a way to check if a button was pressed, but for it to continue executing a line of script even after it is released? I could do something like this:
- Code:
if _KEY(5)=1 then
SWITCH1 = 1
end
if SWITCH1 > 0 then
CHIPANGLE = CHIPANGLE + 1
end
Point.Blank- Car
- Posts : 24
Join date : 2010-08-11
Age : 30
Location : Ontario, Canada
Re: Lua help, and RC english documentation
- Code:
if _KEY(5)==1 then
SWITCH1 = 1
end
It depends on what you want exactly. If you are looking for the equivalent of a _KEY(<keynum>) function, then you're after _ML(), _MM(), and _MR(), which are the mouse left, middle, and right.
If you're after the _KEYDOWN and _KEYUP functions, that's a little trickier.
Last edited by JHaskly on Fri Aug 20, 2010 12:58 am; edited 1 time in total
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua help, and RC english documentation
The first question was just asking for the code for checking if the middle button was pressed, and the second question was basically asking if you could check if a button was ever pressed. They were not related to each other, but I got an answer that satisfies me, so thank you.
Point.Blank- Car
- Posts : 24
Join date : 2010-08-11
Age : 30
Location : Ontario, Canada
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua help, and RC english documentation
Ok, new question: I know it is fairly simple to have something with auto-pilot(i.e. maintain heading), but I would like to know how to do this using a point or reference instead of heading and altitude. I was planning to use this for a squadron model with multiple (2-4) planes following the leader, so I need to have the other planes automatically follow a position relative to the core, attached to the leader. The position should also be changeable, so you can change formation.
Point.Blank- Car
- Posts : 24
Join date : 2010-08-11
Age : 30
Location : Ontario, Canada
Re: Lua help, and RC english documentation
It depends on what you want exactly. Do you want a way to get the required heading and altitude, the _EX and _EY values of the target to you, or the local pitch and yaw to the target?
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua help, and RC english documentation
Basically, the X,Y and Z coordinates of a point relative to the core, which the leader plane mounts. One point per wing man, and they follow their assigned point. This way, you should be able to have squadron flight. I was hoping to make it in time for the RC promo video, but it will likely not come to pass. On the other hand, does anyone have a model with squadron flight that I can shamelessly rip code from?
Point.Blank- Car
- Posts : 24
Join date : 2010-08-11
Age : 30
Location : Ontario, Canada
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum