Jump to content
The simFlight Network Forums
cr2130

Help with lua not working.

Recommended Posts

Hi all, I have been following a post on the Aerosoft forum(https://forum.aerosoft.com/index.php?/topic/140328-as-a320-key-mapping-with-fsuipc/) on how to use FSUIPC and lua files to operate controls in the A320. I have followed it to the best of my abilities and have had intermittent results. I am using FSUIPC4, and have added the:

[Auto]
1=A320Engine

[LuaFiles]
1=A320Engine

Sections to my .ini file (A320Engine.lua is the file name)

The lua file is in the same directory and i am have a mixed bag of results. Some times it works but 90% of the time nothing happens. I have tied my best to try and understand the lua Documentation that comes with FSUIPC but I am struggling a tad. If someone is able to give me some guidance on this it would be greatly appreciated !

Edited by cr2130

Share this post


Link to post
Share on other sites
3 hours ago, cr2130 said:

I am using FSUIPC4, and have added the:

[Auto]
1=A320Engine

[LuaFiles]
1=A320Engine

Sections to my .ini file (A320Engine.lua is the file name)

Two things wrong there:

1. The [Auto] section is for complete commands, not a list of files.  It is for Macros,as well, not just loading Lua files. If fact any control you can assign can be executed automatically as well.

So the entry should be 1=Lua A320Engine

The documentation does explain this, with examples!

 

2. You do NOT add entries to the [LuaFiles] section at all. That is where FSUIPC keeps track of which Lua files you've added. Please do NOT edit it!

Pete

 

Share this post


Link to post
Share on other sites

My apologies if what I have done has frustrated you, I am completely new to this and was only doing what I believed others had done as shown in the Aerosoft forum as I was and still am struggling to  get to grips with this. Thanks for the help.

Share this post


Link to post
Share on other sites
2 hours ago, cr2130 said:

My apologies if what I have done has frustrated you

No, nothing's frustrated me. I was just pointing out the errors.

With the Lua not being loaded, it obviously cannot work. Does it work after you corrected the entry in [Auto] as i showed?

Pete

 

Share this post


Link to post
Share on other sites

Thanks for the reply, i have managed to get it working with your help, When in FSX it does not run on its own I have to trigger it to start (if that's the phrase to use) then the commands run fine, Is this normal behaviour ? Thanks for the help so far !

Share this post


Link to post
Share on other sites
31 minutes ago, cr2130 said:

When in FSX it does not run on its own I have to trigger it to start (if that's the phrase to use) then the commands run fine, Is this normal behaviour ?

I don't know what you mean by "trigger". It should load and execute automatically if loaded via the [Auto] method. There are other ways of loading it. Could you describe what you mean by "trigger"?

Pete

 

Share this post


Link to post
Share on other sites

Thanks for replying. when I first made the changes you described above it didn't appear to work so I assigned a button to "Lua A320Engine" in a random attempt to get it to work after pressing this button in the sim all the commands started to work. I have loaded FSX several times since and it is working first time, every time now without pressing the "Lua A320Engine" button which did nothing to start with by the sounds & look of it. Thank you for your help.

Share this post


Link to post
Share on other sites
3 hours ago, cr2130 said:

when I first made the changes you described above it didn't appear to work so I assigned a button to "Lua A320Engine" in a random attempt to get it to work after pressing this button in the sim all the commands started to work.

Okay. then please show me your INI file, because the [Auto] section with the same entry should most certainly do the same thing as that button!

3 hours ago, cr2130 said:

I have loaded FSX several times since and it is working first time, every time now without pressing the "Lua A320Engine" button

Ah, So, that sounds like you changed the [Auto] section and assumed it would somehow work without you restarting the sim?

The [Auto] section is actioned when the system loads. If you use profiles you can have separate profile-dependent Auto sections, by [Auto.<profile name>], and those would be actioned on a change of aircraft which then caused a different profile to be loaded.

Also you can reload button, key and axis settings using facilities in their own Option Tabs,  but otherwise the settings are only loaded when you start the sim.

Pete

 

Share this post


Link to post
Share on other sites

Hi, sorry about the delay ! I feel like i'm sending you around in circles here as today it has stopped working again. Nothing has been changed and nothing has been unplugged. I have set a profile for the aircraft and have been trying to use the Lua with this profile. I have attached my ini file. Many Thanks !

FSUIPC4.ini

Share this post


Link to post
Share on other sites
5 hours ago, cr2130 said:

I have set a profile for the aircraft and have been trying to use the Lua with this profile. I have attached my ini file.

The Lua will start when you start the Sim. It isn't specific to any Profile. If you want it to be then you have to change the section name from 

[Auto]

to

[Auto.Aerosoft A320]

However, it will be running in any case -- unless it has an error in it or it didn't work properly in the first place. It currently has nothing to do with whether you are using a Profile or not.

You should check in the Log to see if an error is registered for your Lua plug-in.

I can't really help further. I've not seen your plug-n and know nothing at all about it. 

Pete

 

Share this post


Link to post
Share on other sites

Thanks  for replying and all the help, I think have enough information to have a look into the Lua and see if something is wrong in there. Thanks !

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.