Jump to content
The simFlight Network Forums

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

Link to comment
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

Link to comment
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.

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.