Running_Wild
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by Running_Wild
-
-
Hi, i'm trying to create a lua script to control the switches of the a2a cessna 172, and so far all works except the window defrost control.
Monitoring the lua vars i've found that 3 vars are associated with that funcion (they change when i turn on/off the defrost via the mini-control panel of the aircraft) and they are:
WindowDefrosterControl1
WindowDefrosterControl2
WindowDefrosterControlKnob
I've wrote the code for toggling it on/off, but as i press the key associated with the lua script parameter it switches on/off for but immediately return to the previous state...
Here's my script:
-- Windshield Defroster Toggleif ipcPARAM == 4 thenLVar1Set = "L:WindowDefrosterControl1"val1 = 0if ipc.readLvar(LVar1Set) == 0 thenval1 = 25endLVar1Set = "L:WindowDefrosterControl2"val2 = 0if ipc.readLvar(LVar2Set) == 0 thenval2 = 25endLVar3Set = "L:WindowDefrosterControlKnob"val3 = 0if ipc.readLvar(LVar3Set) == 0 thenval3 = 100endipc.writeLvar(LVar1Set, val1)ipc.writeLvar(LVar2Set, val2)ipc.writeLvar(LVar3Set, val3)endSomething wrong with it? Monitoring lua I've found that it works in a very strange way, sometimes the knob value doesn't change at all, sometimes it sets at 50 instead of 100... the control1 and 2 seem to switch to 1 for a while but turning back to 0 immediately...any clues? thank you! -
nevermind, think i've found something to study eheh http://forum.simflight.com/topic/63146-tutorial-how-to-get-lua-vars-or-commands-out-of-fs/ :mrgreen:
-
Thank you for your reply Pete! So even if they're not operated by key is still there some way to control them in the ways you've suggested? Or cosmetic buttons just can't be controlled? Thanks again
-
Hi, i'm logging some Prepar3d v2 addon aircrafts events to assign keys to them, but the FSUIPC log doesn't show all the events that i need, like cabin heat, cabin vent, panel lights, just to name some of them. I've tried with various aircraft but there's always some events that won't show in the log window... any suggestions? thank you so much!
Strange LVar Behaviour
in FSUIPC Support Pete Dowson Modules
Posted
Thx Pete, yes that was a typing error, i'll try to experiment with different lvar order, thank you again