Jump to content
Sign in to follow this  
Mickeyj

Who tells a switch how it operates

Recommended Posts

Hello folks,

 

i just fell over LINDA and LUA. Im into chopper flying on FSX/P3D and found out i can operate switches via HOTAS and LINDA ;) For ex i have the module for the ND Skycrane and now i can operate the snorkle, yeah :D

 

Im using the TM Warthog HOTAS.

 

Now i wanted to program a module for Ceras UH60. My first switch i wanted to operate was the Force Trim Release on the stick. I found the Lvar trimrel. It toggles when i use the Tracer. I was able to program the switch sound but unfortunately the switch itself is not operating.

 

I progamed the button via a toggle on/off. It is a standard push button. 

 

I already checked the Skycrane module for hints and i tried some codes but nothing was working despite the klick sound :(

 

So which command tells the button that it is a push button?

 

Many thanks.

 

YOu guys did a great job on LINDA!!!


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

 

 


So which command tells the button that it is a push button?

 

Hello,

 

there isn't a standard "do that and it works". Eveything is about investigating and trying.

Every addon behaves completely different, even from the same developer.

 

One have very clearly named LUA variables, like "L:Landing_Linght", others use just cryptic numbers, like "L:88765", others use FSUIPC controls and/or offsets. Some use the standard FSX controls, but the switch sounds are toggled with an extra variable.

 

All you can do is: use the tracer and try what happens ...

 

Sorry to give not a more specific help here


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Very likely there is a separate LVar for the switch animation.

Share this post


Link to post
Share on other sites

Many thanks for your replies. I will go ahead and try further options. I mean i was happy to hear the sound so there might be a way to see the animation or the action of the button. Within the sim the button is operated by the mouse. I can see the hand and the action.

 

Anyway i wil post the two line packages i programmend so you guys could have a llok at it or maybe test it if you have the cera UH60 


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Hello,

 

i got managed to control the landing lights and the search lights :) Just had to do some copy and paste stuff and checking the Lvars.


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Ok guys,

 

major success wrote my first ever Linda/Lua module :)) I finally got that force trim switch to actuate the animation is visible but the the function is missing. Nevermind the module for the H-60 has a bit more than just a non functional switch. I can open the doors and switching on/off lots of lights. ver. 1 would be ready for upload but how. Any suggestions?

 

 

Merry x mas to ya


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Oh i have another question about negativ values. In the Cera Bell212/412 is the engine start switch which is operated to the left for left engine start and to right for the right one. Now i got it to program the left engine start cycle like ipc.writeLvar("L:starteng" , 1) now the tracer tells me that for the right engine start cycle the value would be -1 to flip the switch to the right. The editor tells me that the syntax ipc.writeLvar("L:starteng" , -1) is correct but the switch does not move to the right.

 

Is there a different way to program such switch behaviour. As i said in tracer entering 0 toggle -1 operates the switch to the right.

 

Thanks MJ 


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Hello,

 

great you're doing a module

 

AS I understand it:

 

one switch is

Lvar -1 "on"

Lvar 0 "off"

 

the other switch

Lvar 0 "off"

Lvar 1 "on"

 

isn't that working?


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Hallo Guenther,

 

actually it is one switch with 3 functions Lvar=1 (engine 1 start) Lvar=0 (starter off) Lvar=-1(engine 2 start)


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Hello again,

 

i will try another attemp to program that switch. I think i know the problem. As the switch knows 3 functions 1 0 -1 do i have to sett the order of the switch position?


Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Hallo Guenter,

 

these are the lua lines i added

 

--- ## Engines ##########
 
function Engine_One_Start_On ()
    ipc.writeLvar("L:starteng", 1)
end
 
function Engine_One_Start_Off ()
    ipc.writeLvar("L:starteng", 0)
end
 
function Engine_One_Start_Toggle ()
if _t("starteng") then
    Engine_One_Start_On ()
else
      Engine_One_Start_Off ()
end
 
function Engine_Two_Start_Off ()
    ipc.writeLvar("L:starteng", 0)
end
function Engine_Two_Start_On ()
    ipc.writeLvar("L:starteng", - 1)
end
 
function Engine_Two_Start_Toggle ()
if _t("starteng") then
    Engine_Two_Start_On ()
else
      Engine_Two_Start_Off ()
end
end
 
 
Now the engine one starts but engine two refuses to start. For engine two you should have -1 

Greetz


MJ


 


My youtube blog________________________Prepar3D v2.5/v3


youtubefooter.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...