Jump to content
The simFlight Network Forums
pilotjohn

Killing [Auto] Started Lua from a [Auto.XXX] Lua

Recommended Posts

Pete,

I have several GF devices for which I developed logic to control "generic" aircraft. This is loaded in the [Auto] section.

It's made to be extensible (e.g. override functions) so for specific aircraft (DukeT, JS41, ERJ) I develop a new Lua that "requires" the base logic, and simply overrides some functions as needed (for example a ToggleIgnition function for a DukeT).

The problem I'm running into is that the "default" logic is loaded for all planes, AND the specific is loaded for the custom aircraft. That is, they are BOTH loaded.

Is there a way to auto-load a Lua when something doesn't match rather than match?

Or, is there a way to kill the "default" Lua loaded in the [Auto] section, from within a Lua loaded from within an [Auto.XXX] section?

Or, is there some other logic/mechanism that can accomplish this?

Thanks,

John

Share this post


Link to post
Share on other sites

Is there a way to auto-load a Lua when something doesn't match rather than match?

You can have a Lua which loads Luas by whatever criteria you need to apply. Or simply have the other Luas set some Global variable which the unwanted one tests for and terminates, or just goes quiescent.

But best is to not use a generic [Auto] section at all and simply load whatever you want for every Profile -- just always have a Profile, even if "default". It doesn't need to have all the other things in it, like buttons, calibrations, etc.

Pete

Share this post


Link to post
Share on other sites

You can have a Lua which loads Luas by whatever criteria you need to apply. Or simply have the other Luas set some Global variable which the unwanted one tests for and terminates, or just goes quiescent.

But best is to not use a generic [Auto] section at all and simply load whatever you want for every Profile -- just always have a Profile, even if "default". It doesn't need to have all the other things in it, like buttons, calibrations, etc.

Pete

I went to global [Auto] route and my "default" Lua was testing wether to include the others, but I'll check out the profiles.

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.