• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v2 Local Variable Display

Messages
53
Country
us-hawaii
Gents,

I'm a C++ and C# programmer but I've messed around with XML gauges when I first started. My plan is to methodically go through the CaptainSim C-130 to capture variables and events to reprogram them. Is there a way I can create a simple gauge to display the Local Variables and Events when I move a switch? Basically I'd just like a simple window to Display (Variable Name : Value)

-Matt
 
Gents,

I'm a C++ and C# programmer but I've messed around with XML gauges when I first started. My plan is to methodically go through the CaptainSim C-130 to capture variables and events to reprogram them. Is there a way I can create a simple gauge to display the Local Variables and Events when I move a switch? Basically I'd just like a simple window to Display (Variable Name : Value)

-Matt

There are several XML logic debugging tools already out there designed for your need. Try one of these:

BlackBox3 (if a 2D gauge) - Robbie McElrath

LocalVars (if 2D or 3D gauge) - Tom Aguilo

xml vars (if 2D, I believe) - Doug Dawson

Bob

The CaptainSim C-130 has an XML cockpit?
 
Last edited:
Bob,

Thanks for the quick response! It has an xml and C++ cockpit, I just want to capture the L Variables so I can get rid of all the modules and drive the switches and engines myself. I'm a RW Herc pilot and I am building this up for training to make it a better trainer. My basic hope is that I can walk through every switch in the cockpit, get the associated Variables and Events, delete all of their underlying code and redo it. If I had a 3D modeller I'd just completely do my own but unfortunately I haven't gotten that far. Its one of the most iconic planes out there, it needs payware quality programming and I can get close (it helps I have access to the plane everyday).

I'm going to redo the cockpit textures as well... we'll see how that goes.

-Matt
 
Hi,

In your case, where names of the LVars are probably ignored and you also need to capture and display on screen the events associated to each button/switch, XMLTools is the way to go.
With LocalVarsLogger utility you'll be able to detect which LVar changes its state when a certain switch is moved, and with XMLEVents utility you'll be able to detect also the event(s) fired, if any.

Tom
 
Tom,

Thank you so much, there are so many excellent resources here and I have learned a ton! Unfortunately my task might be harder than just writing something from the ground up, but thats how things go!

Cheers!

-Matt
 
Loading the VC model into ModelConverterX and taking a look at the ModelDef.xml that MCX generates for the model worked for me in the past as well.
 
Unfortunately, only a small number of the CS C-130's gauges are XML. I have gone through it with Doug's Gauges and found very few LVars. Since a compiled C++ Gauge isn't editable, I don't see how you plan to redo the code.
 
Simple. He extracts the gauge bitmaps from the C++ gauge files or paints his own and them uses them to make his own gauges in XML or C++. The variables for the switches can be read with the tools that Bob suggested, so all that's needed there are new gauges to control them.

Doing cockpit stuff this way is actually more fun as you don't have (slightly boring) complete freedom of action and thus need to try to push the envelope here and there. :D
 
Heretic is completely correct, the only reason I need any of their variables is to interact with their switches, I'm going to completely remove all of their DLLs including the sound (I've been recording a new soundest on my recent flights). I am going to use DirectX and Prepar3Ds render to texture engine to update the glass panel display and the navigators table. I'll use SimConnect to drive more sophisticated systems and I am going to use the tech manuals and my hours in the airplane to build more responsive system. I am going to log my progress and detail my developments. I appreciate all the great responses so far.

I am also redoing the cockpit textures to make them higher res using images from the aircraft. I will let you know when I make good progress.

Heretic - Thanks for the model converter tip! I've got a big spreadsheet going right now and I am picking through them, unfortunately removing their dll's keeps the throttles and flight controls from moving so I haven't quite gotten the aircraft to the skeleton I want it to be to start rebuilding.
 
Ahh, I think I get it. I once tried to do that with the PMDG B1900C to fill in the missing systems, but I never really focused on it and eventually stopped working on it.

I'm excited to see where this goes, as I enjoy the CS C-130 quite a bit and could always go for more realism.
 
Heretic - Thanks for the model converter tip! I've got a big spreadsheet going right now and I am picking through them, unfortunately removing their dll's keeps the throttles and flight controls from moving so I haven't quite gotten the aircraft to the skeleton I want it to be to start rebuilding.

Cross-reference the variables found via MCX with those found via XMLTools' Localvars (and their initial values after loading a flight). Since the C-130 is payware, I assume that it has some XML-based copy protection measures.
 
Alright Gents,

I'm plugging along but not with much success. I successfully compiled a Render-To-Texture Test Gauge (Hoping a texture would remain on top of the 3D model so I could crudely make it look similiar to our configuration, but with no luck there), the results can be seen in the following image. The LocalVarsLogger has also registered 0 local variables. I am at a loss with this plane, I wish I could or had a 3D modeler to start fresh so I could use my already working aircraft logic.

I was hoping with that large flat area I could use DirectX to render on top to mimic our Electronic Instrument Displays.

HercLocalVars.png
 
I'm just noticing that you're using P3Dv2. The P3D version of XMLTools are for v2.2, so they might not really work in v2.5. Hence the unusable L: vars output.
 
Back
Top