Jump to content
The simFlight Network Forums

Lua script not working... console indicates lua script is being killed


Recommended Posts

Hi,

Working with P3dv5 and FSUIPC6 (registered version)

I am trying to get a lua script working... it is one from the internet that is supposed to work with the Aerosoft A3xxx Professional for P3Dv4/v5. I have set the script to Autoload using Auto.profile and the script appears to autoload ok. I have assigned it to a joystick button... the joystick is recognised by P3Dv5 and FSUIPC6. However when I use the button I receive a message in the console window that:

 541688 LUA: "d:\FSUIPC6\A3xx_MyActions.lua": killed

As far as I can tell the lua script is correct but I am not a familiar user of lua so that may be the problem... but I am not sure what reasons would result in the message I receive.

 

Appreciate any help

 

cheers

Michael

 

A3xx_MyActions.log A3xx_MyActions.lua FSUIPC6.ini FSUIPC6.log

Link to comment
Share on other sites

1 hour ago, mwh1952 said:

I have set the script to Autoload using Auto.profile and the script appears to autoload ok. I have assigned it to a joystick button... the joystick is recognised by P3Dv5 and FSUIPC6. However when I use the button I receive a message in the console window that:

 541688 LUA: "d:\FSUIPC6\A3xx_MyActions.lua": killed

I need to see your ini file for your AsoftA3xx profile, but it looks like you have assigned a button to start the lua script. As the script is already running, this will just kill the script and run it again.
Looking at te script, it looks like you need to assign to set a flag in the script, so you need to assign to LuaSet (not Lua) for the script, and with a parameter of either 1 (for AB_EXT_ExtPwrGPU_toggle) or 2 (for AB_EXT_ExtPwr_toggle).

John

 

Link to comment
Share on other sites

Your profile lua is not being started. When using profiles-in-separate files, the [Auto] section for the profile goes in the profile ini file, not in the main ini file.
Remove this from your FSUIPC6.ini file:

Quote

[Auto.AsoftA3xx]
1=Lua A3xx_MyActions
2=Lua A3xx_Actions

and add this to your AsoftA3xx.ini file:

Quote

[Auto]
1=Lua A3xx_MyActions
2=Lua A3xx_Actions

And this assignment in your AsoftA3xx.ini file is wrong as it will just restart the lua script:

Quote

3=P1,4,CL2:R,2     -{Lua A3xx_MyActions}-

Change this (via the UI) to use LuaSet and not Lua. This will then set the flag 2 in the already running lua script to call AB_EXT_ExtPwr_toggle when you press the button.

 

Link to comment
Share on other sites

11 hours ago, mwh1952 said:

all working as expected with your change

Ah, ok... Looking at the lua again, if using a momentary button you should really assign to LuaToggle, not LuaSet. If using a switch or sticky button, then assign to LuaSet on press and LuaClear on release, with all assignments using a parameter of 2.

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.