Jump to content

Help with FSUIPC Lua


Recommended Posts

I've been messing round with the FSUIPC and Lua files for the Aerosoft A320. I have got some functions to work but the majority aren't working, I am doing the same for each but have hit a road block as to why some aren't working and some are. I know that the toggle functions are a bit inconsistent in working so have been using the "On", "Off" functions and the "Set" option for the Lua within FSUIPC but even this is not working for additional Lua at this point.

 

This is the link to the file I have been using to create the lua file(s): https://www.avsim.com/forums/topic/539164-aerosoft-airbus-a3xx-professional-v18-23-jan-20/

 

And have followed this process: https://forum.aerosoft.com/index.php?/topic/140328-as-a320-key-mapping-with-fsuipc/

 

Any help please folks ! Thanks !

ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
Link to comment
Share on other sites

 

Are you using LINDA? Your description and those links suggest you may be taking a LINDA file and trying to use parts of it in Lua scripts invoked directly FSUIPC. This probably won't work for all sorts of reasons. You need to decide whether you want to use LINDA or Lua programs invoked from FSUIPC button mappings. You probably can adapt some of what's in that Airbus file to use without LINDA but you need to know what you're doing.

MarkH

 

C0TtlQd.jpg

Link to comment
Share on other sites

  • 7 months later...
Are you using LINDA? Your description and those links suggest you may be taking a LINDA file and trying to use parts of it in Lua scripts invoked directly FSUIPC. This probably won't work for all sorts of reasons. You need to decide whether you want to use LINDA or Lua programs invoked from FSUIPC button mappings. You probably can adapt some of what's in that Airbus file to use without LINDA but you need to know what you're doing.

 

The files I believe are LINDA but following the post about the LUA scripts. I have got 90% of the functions I need working. I am only struggling with ones that state "Both". such as the ones for the Batteries:

 

function Battery_BOTH_on ()

Battery1_on ()

_sleep(100,200)

Battery2_on ()

end

 

function Battery_BOTH_off ()

Battery1_off ()

_sleep(100,200)

Battery2_off ()

end

 

this only sets battery 1 to on not 1&2.

 

Any advice ?

ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
Link to comment
Share on other sites

The files I believe are LINDA but following the post about the LUA scripts. I have got 90% of the functions I need working. I am only struggling with ones that state "Both". such as the ones for the Batteries:

 

function Battery_BOTH_on ()

Battery1_on ()

_sleep(100,200)

Battery2_on ()

end

 

function Battery_BOTH_off ()

Battery1_off ()

_sleep(100,200)

Battery2_off ()

end

 

this only sets battery 1 to on not 1&2.

 

Any advice ?

 

_sleep() looks like a LINDA macro function so maybe your program is bailing out at that line. Try replacing it with ipc.sleep(200), which calls an FSUIPC Lua library function,

MarkH

 

C0TtlQd.jpg

Link to comment
Share on other sites

Thanks for replying, I have replaced the "_sleep()" with "ipc.sleep(200)" but this still does not work. Thanks for your help!
ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
Link to comment
Share on other sites

Any better when you remove the "sleep" lines completely?

 

Also, do yo have the option of using something like:

battery_on

or

battery_both_on

 

To switch them both on together?

(Just a suggestion. I don't know if such-named functions actually exist. And I can't access that .zip file that lists them at the moment. )

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I have tried taking out the sleep line and it still only runs the "Battery_1_On" command not both. There is nothing in the LUA I have taken the functions from to do with both betteries only the "Battery_BOTH_on" command, which only runs the first half of the command.

 

Thanks!

ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
Link to comment
Share on other sites

243547 LUA: "A320_Electrical.lua": Flag 23 set

 

243547 LUA.9: Lua Flag event: calling "Battery_BOTH_on" in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\A320_Electrical.lua"

 

243594 *** LUA Error: ...osoft Flight Simulator X\Modules\A320_Electrical.lua:4: attempt to call global 'SmallOverheadPushButtons' (a nil value)

 

243594 LUA.9: Waiting for an event in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\A320_Electrical.lua"

 

 

Is what I'm getting from the log. But I'm not really sure how to use the logging functions in FSUIPC.

Thanks!

Edited by c.r36156636
ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
Link to comment
Share on other sites

>> 243594 *** LUA Error: ...osoft Flight Simulator X\Modules\A320_Electrical.lua:4: attempt to call global 'SmallOverheadPushButtons' (a nil value)

 

That seems like your error. You're trying to call a non-existent function.

 

Cheers!

 

Luke

Link to comment
Share on other sites

I have taken the line out and run a log again and found that "DspShow" present in the "Battery1_on" and "Battery2_on" functions was also causing an error. I have taken this out as well and it is working fine now !

 

Thank you all for your help !

Edited by c.r36156636
ASUS ROG STRIX B550-F Motherboard, AMD Ryzen 5 3600X 3.8-4.4GHz, 16GB Corsair Vengeance LPX 3000MHz RAM, 1TB Kingston NV1 SSD, 1TB Seagate BarraCuda HDD, 240GB Maxtor Z1 2.5" SSD, MSI Radeon RX 5600 XT.
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...