Jump to content
The simFlight Network Forums

Lua file not being triggered


Recommended Posts

So, I have a lua file that presses the brakes progressively under certain conditions (a/c on ground, IAS<60 kts and parking brake off).

In P3D I set this up against the elevator axis in axes assignments, It works perfectly in P3D.

But it doesn't work in any aircraft in MSFS. I just can't work out why. I can see the axis events occuring in the console log. I can't see the lua event being triggered though, and need some help to work out why this would be the case? Any differences in that respect between how lua works between P3D and MSFS?

Thanks

Screenshot 2024-05-13 120757.png

Link to comment
Share on other sites

On 5/13/2024 at 4:10 AM, jonathanfe said:

Any differences in that respect between how lua works between P3D and MSFS?

There shouldn't be...

Is the lua script running? Can you please show me/attach your FSUIPC7.log and FSUIPC7.ini files. the latter with Lua Plugin logging activated.

Link to comment
Share on other sites

Your ini file shows that you have assigned to the Lua control and not the LuaValue control:

Quote

1=AY,256,F,65762,L2:R,0,0    -{ TO SIM: AXIS_ELEVATOR_SET, Lua mev2 }-

This is also confirmed by your log file, which shows the lua script continually being restarted (which is what using the Lua control will do):

Quote

 ...
  595281 LUA.8: Waiting for an event in "C:\FSUIPC7\mev2.lua"
   613343 LUA.9: beginning "C:\FSUIPC7\mev2.lua"
   613421 LUA.10: beginning "C:\FSUIPC7\mev2.lua"
   613656 LUA.13: beginning "C:\FSUIPC7\mev2.lua"
   614140 LUA.19: beginning "C:\FSUIPC7\mev2.lua"
   614234 LUA.20: beginning "C:\FSUIPC7\mev2.lua"
   615171 LUA.24: beginning "C:\FSUIPC7\mev2.lua"
   615250 LUA.25: beginning "C:\FSUIPC7\mev2.lua"
   615515 LUA.28: beginning "C:\FSUIPC7\mev2.lua"
   615515 LUA.28: C:\FSUIPC7\mev2.lua:42
   615531 LUA.28: Global: ipcPARAM = 1472
   615546 LUA.28: C:\FSUIPC7\mev2.lua:10
   615796 LUA.29: beginning "C:\FSUIPC7\mev2.lua"
...

Not sure why as the image you attached shows LuaValue - can you please check again. Your assignment should look like this:

Quote

1=AY,256,F,65762,L2:V,0,0    -{ TO SIM: AXIS_ELEVATOR_SET, LuaValue mev2 }-

 

4 hours ago, jonathanfe said:

It looks like the lua file is running

It is only running as it is being started/re-started each time the axis valuer changes. As well as changing the assignment from using Lua to LuaValue, you also need to have the lua auto-started. To do this, you need to add an [Auto] section, i.e.

Quote

[Auto]
1=Lua mev2

John

 

Link to comment
Share on other sites

14 hours ago, John Dowson said:

It is only running as it is being started/re-started each time the axis valuer changes. As well as changing the assignment from using Lua to LuaValue, you also need to have the lua auto-started. To do this, you need to add an [Auto] section, i.e.

Thanks - it was this that I had overlooked in the ini file, all working now. Thanks so much for your help.

Jonathan

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.