Project Autopilot ScriptMFD by Thunder Chicken

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,552
Reaction score
3,454
Points
138
Location
Massachusetts
Short answer: Yes. Slightly longer answer: It depends on the cockpit implementation. So for the standard glass cockpit the answer is not, unless you count external mfds.
Keep in mind however that, somewhat counterintuitively, what we describe as an "MFD instance" here is merely its representation in the cockpit (drawing surface and input controls). MFD MODES only exist once per MFD. They're effectively singletons. That's why rendering the same MFD mode in two different MFDs is such a hassle (even if they're displayed in different vessels!).
Well, in theory this autopilot could be used in any vessel with typical atmospheric flight control surfaces (elevator, ailerons, rudder). So the cockpit implementation could be glass cockpit, virtual cockpit, etc.. I am not sure what you mean by "external" mfd. It would be convenient to be able to display different menu pages for the same autopilot on different displays, and if a setting is change that is reflected globally for that autopilot for that vessel in the different displays.

I'm somewhat baffled why my autopilot code is over 1000 lines while a full atmospheric jet addon that I am using only needs 100-200 lines of code. The autopilot works, mostly, but it seems very convoluted and inefficient and I am wondering how to simplify it / modularize it, because it is very difficult to see the interplay of some of the autopilot modes and that is making debugging challenging.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,552
Reaction score
3,454
Points
138
Location
Massachusetts
So as I see it, if I want to render a particular MFD page on a particular vessel for a particular instance (mode?), I need to define something like this:

page(hvessel, hmode) = i

where i is the page number for that particular vessel and mode instance. hvessel would have to be a unique identifier to the vessel in a simulation, and I think there are methods for that. I don't have any idea how to get/define hmode, but that somehow needs to be an identifier for an MFD instance opened in a particular vessel. For example, if I open the autopilot in the left MFD and another in the right MFD, the left MFD instance might be 1 and the right instance 2.

Any pointers on what I need to do this? I am not clear on how I can identify the MFD instance/mode.
 
Top