Jump to content
The simFlight Network Forums

A2A P-51 LVARS via Lua


Recommended Posts

Hi All

Hope you all are well, ill get straight to it, im trying to build a P-51 sim using either Mobi Flight or Air Manager, ive mangaged to use FSUIPC to log some of the event id's that the A2A P-51 is throwing out, but not all of them show up. I found on here about using the find lvars.lua plugin to help find the missing attributes but I still cant see them in logging, they are quite important parts as well, for example the fuel selector valve, fuel cut-off lever, etc, etc.

Can anyone help me understand this ?

 

Many Thanks

Myles

Link to comment
Share on other sites

What FS and version of FSUIPC are you using? Presumably not MSFS with FUIPC7, as there is a specific sub-forum for that.
To list available lvars in FSUIPC4/5/6, you can use the provided lua plugin but it is easier to just assign a button or key to the FUIPC-added control List local panel variables
and use that.

John

Link to comment
Share on other sites

You would assign a button or key press to this as you would for assigning to any other control - open either the button or key assignment tab, press the button or key so that it is registered, then select the control List local panel variables from the drop-down menu, then click Ok to save the assignment. Then just press the assigned button or key, and the lvars will be listed in the FSUIPC6.log file.

2 hours ago, Myles_DJL said:

i only managed to work out logging using trial and error,

Why don't you try reading the documentation - this is all explained in the provided User guide, with further details in the Advanced User guide.

John

Link to comment
Share on other sites

Here are my user functions:


function P51D_Battery_On ()
ipc.writeLvar ("L:Battery1Switch", 1)
end

function P51D_Battery_Off ()
ipc.writeLvar ("L:Battery1Switch", 0)
end

function P51D_Engine_Start_On ()
ipc.writeLvar ("L:Eng1_StarterSwitch", "1")
end

function P51D_Engine_Start_Off ()
ipc.writeLvar ("L:Eng1_StarterSwitch", "0")
end

function P51_EnginePrime_On ()
ipc.writeLvar ("L:Eng1_PrimerSwitch", "1")
end

function P51_EnginePrime_Off ()
ipc.writeLvar ("L:Eng1_PrimerSwitch", "0")
end


function P51D_Emergency_LandingGearFairing_Closed ()
ipc.writeLvar ("L:EmergencyGearLever", "0")
--ipc.writeLvar ("L:LandingGearEmergencyHandle", "0")
--ipc.writeLvar ("L:LandingGearEmergencyHandlePast", "0")
end

function P51D_Emergency_LandingGearFairing_Open ()
ipc.writeLvar ("L:EmergencyGearLever", "1")
--ipc.writeLvar ("L:LandingGearEmergencyHandle", "1")
--ipc.writeLvar ("L:LandingGearEmergencyHandlePast", "1")
end

function P51D_FuelCutoffSwitch_On ()
ipc.writeLvar ("L:Eng1_FuelCutOffSwitch", "1")
end

function P51D_FuelCutoffSwitch_Off ()
ipc.writeLvar ("L:Eng1_FuelCutOffSwitch", "0")
end

function P51D_Fuel_Fuselage ()
ipc.writeLvar ("L:Eng1_FuelSelector", "1")
ipc.writeLvar ("L:FSelP51State", "0")
ipc.writeLvar ("L:FSelP51", "0")
end

function P51D_Fuel_LeftWing ()
ipc.writeLvar ("L:Eng1_FuelSelector", "2")
ipc.writeLvar ("L:FSelP51State", "1")
ipc.writeLvar ("L:FSelP51", "20")
end

function P51D_Fuel_RightWing ()
ipc.writeLvar ("L:Eng1_FuelSelector", "3")
ipc.writeLvar ("L:FSelP51State", "2")
ipc.writeLvar ("L:FSelP51", "80")
end

function P51D_Fuel_LeftDrop ()
ipc.writeLvar ("L:Eng1_FuelSelector", "4")
ipc.writeLvar ("L:FSelP51State", "3")
ipc.writeLvar ("L:FSelP51", "60")
end

function P51D_Fuel_RightDrop ()
ipc.writeLvar ("L:Eng1_FuelSelector", "5")
ipc.writeLvar ("L:FSelP51State", "4")
ipc.writeLvar ("L:FSelP51", "40")
end


function P51D_DropLeft_Tank ()
ipc.writeLvar ("L:DropTankLeftReleaseKey", "1")
ipc.sleep (2000)
ipc.writeLvar ("L:DropTankLeftReleaseKey", "0")
end

function P51D_DropRight_Tank ()
ipc.writeLvar ("L:DropTankRightReleaseKey", "1")
ipc.sleep (2000)
ipc.writeLvar ("L:DropTankRightReleaseKey", "0")
end
 

  • Like 1
Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.