pilotjohn Posted March 2, 2013 Report Share Posted March 2, 2013 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 More sharing options...
Pete Dowson Posted March 3, 2013 Report Share Posted March 3, 2013 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 More sharing options...
pilotjohn Posted March 3, 2013 Author Report Share Posted March 3, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now