• 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.

FS2004 Hints required: 3D push buttons, annunciator lights and gauge interaction (SOLVED)

Messages
1,451
Country
mexico
Hello everyone

I've been struggling to find a simpler way to tackle what follows:
I thought it was "smart" to map each and every single annunciator, push buttons, radio LEDS and much more in two textures: in general and when applies, one for any "OFF" state and the other corresponding to "ON".
Here are both textures:

H225_VCGauges_Off.jpg
H225_VCGauges_On.jpg


Approach # 1
The idea behind this, is that I wanted to have just two textures for all instances where a 3D annunciator, 3D push button, LED or anything else sharing the same shape could be "illuminated" or "not illuminated".
In this way, I can "play" with visibility conditions inside the makemdl.parts.xml file to show/or hide the pertinent 3D parts. Actually, I made that decision to mantain consistency with the technique I've learned from Bill Leaming to have beautiful night illumination in the cockpit gauges. Furthermore, I wouldn't have a ton of small images snapped into a single polygon face of each component mentioned before.

The main goal here was to only have two [Vcockpit] entries in the panel.cfg and that way, make the model work faster (if and only if my intuition is right).

Edit 1:
Disadvantages

a) All 3D parts featuring this visual effect, will double the amount of polygons; one for the illuminated and the other non lited.
b) It will drastically increase the number of entries in the makemdl.parts.xml file;
c) Also, the amount of code required to make any of this 3d objects, seems to be astronomically bigger than the one proposed on "Approach # 2".
d) What I assumed to be saving in "real estate" -regarding on textures-, I loose it due everything else described above.

"Advantages"
Maybe none... but the effect looks awesome!!!

Approach # 2
This other technique, would be to map the required polygon faces using same UVs layed out in the two textures shown above and work with them in the same way as any MDF or PFD screen and treat them as a 2D gauge. This second approach, could be simpler but won't deliver the same visual effect. I never managed to make them to work with proper illumination at dawn or night (hence Bill's technique I been using during years).

Drawing flags "Bright" and "Luminous" described in FS9's Panels SDK Overview, are not fully understood by me; perhaps I need to do more tests in this regard... What a conundrum :banghead::banghead::banghead:

As an example, is a simple push button with two different lights which will be illuminated depending on 4 possible states. The Inverter 1 push button with 2 annunciators:

a) The upper 3d part have two possible states "ON" (not illuminated") and "OFF" (illuminated in yellow). This indicator lamp will work when a FAILURE in the Inverter 1 occurs.
b) The lower 3d part, has the same properties: "ON" (not illuminated") and "OFF" (illuminated in white). This indicator lamp will tell the pilot if Inverter 1 is connected or disconnected.

As a side note, this annunciator follows the Airbus philosophy: If some annunciator, illuminating push button or something similar is NORMALLY LEFT "ON" - “LIGHTS ARE OUT” AND ITS FUNCTION WILL BE ENABLED, CLOSED, ENGAGED OR ACTIVE.
This might not be relevant to you, but very good for me to know...

Perhaps, an image will have more credit explaining than I did. I move two pertinent 3d component parts of the entire push button to the right just to show what I meant:
Inverter1_01.jpg


To even further make my point clear, another image where a single set of 3D parts are share exactly the same shape and properties:
Using_instances.jpg


See? Alternator 1, Alternator 2, TRU1 and TRU2 (Transformer Rectifier Units) are identical.

With no further ado, here is the code required in the makemdl.parts.xml file and actually works fine:
HTML:
        <!-- AVCS FWD (Inverter1) Switch Guard -->
        <part>
            <name>H225_Inverter1_Guard</name>
                <animation>
                    <parameter>
                        <code>
                            (L:H225_Inverter1_Guard,bool) 50 *
                        </code>
                        <lag>300</lag>
                    </parameter>
                </animation>
                <mouserect>
                    <cursor>Hand</cursor>
                    <tooltip_text>AVCS FWD Switch Guard</tooltip_text>
                    <callback_code>
                          (L:H225_Inverter1_Guard,bool) ! (>L:H225_Inverter1_Guard,bool)
                          <!-- Sound Effect -->
                          (L:H225_Inverter1_Guard,bool) !
                              if{ 1 (>L:H225_Guard_Click2,number) }
                          (L:H225_Inverter1_Guard,bool)
                              if{ 1 (>L:H225_Guard_Click,number) }
                    </callback_code>
                </mouserect>
        </part>
    <!-- AVCS FWD (Inverter1) (push button action)
             NOTE:No need to have a MouseRect section for H225_Inverter1 object, since it's covered either in the H225_Inv1_annun_ON or H225_Inv1_annun_OFF part's MouseRect.
             The H225_Inverter1 object was animated as follows: from key:0 to key25 (pushed in action) and from key:25 to key:50 (back action)
             -->
      <part>
          <name>H225_Inverter1</name>
              <animation>
                  <parameter>
                      <code>
                          (L:H225_Inverter1,bool) 50 *
                      </code>
                      <lag>300</lag>
                  </parameter>
              </animation>
      </part>
        <!-- AVCS FWD (Inverter1) annunciator ON (illuminated) -->
        <part>
            <name>H225_Inv1_annun_ON</name>
                <animation>
                    <parameter>
                        <code>
                            (L:H225_Inverter1,bool) 50 *
                        </code>
                        <lag>300</lag>
                    </parameter>
                </animation>
                <mouserect>
                    <cursor>Hand</cursor>
                    <tooltip_text>%((L:H225_Inverter1,bool) !)%{if}%('AVCS FWD: OFF')%!s!%{end}%((L:H225_Inverter1,bool))%{if}%('AVCS FWD: ON')%!s!%{end}</tooltip_text>
                    <callback_code>
                          (L:H225_Inverter1,bool) ! (>L:H225_Inverter1,bool)
                     
                          (L:H225_Inverter1,bool) ! (L:H225_Inverter1_Guard,bool) and
                              if{
                                0 (>L:Inverter1,bool)
                                <!-- Push Button Sound Effect -->
                                1 (>L:H225_Big_Push_button,number)
                                }
                          (L:H225_Inverter1,bool) (L:H225_Inverter1_Guard,bool) and
                              if{
                                1 (>L:Inverter1,bool)
                                <!-- Push Button Sound Effect -->
                                1 (>L:H225_Big_Push_button,number)
                                }
                    </callback_code>
                </mouserect>
                <visible_in_range>
                    <parameter>
                        <code>
                            (L:H225_Inverter1,bool) !
                                if{ 1 } els{ 0 }
                        </code>
                    </parameter>
                    <minvalue>1</minvalue>
                </visible_in_range>
        </part>
        <!-- AVCS FWD (Inverter1) annunciator OFF (Not illuminated)-->
        <part>
            <name>H225_Inv1_annun_OFF</name>
                <animation>
                    <parameter>
                        <code>
                            (L:H225_Inverter1,bool) 50 *
                        </code>
                        <lag>300</lag>
                    </parameter>
                </animation>
                <mouserect>
                    <cursor>Hand</cursor>
                    <tooltip_text>%((L:H225_Inverter1,bool) !)%{if}%('AVCS FWD: OFF')%!s!%{end}%((L:H225_Inverter1,bool))%{if}%('AVCS FWD: ON')%!s!%{end}</tooltip_text>
                    <callback_code>
                          (L:H225_Inverter1,bool) ! (>L:H225_Inverter1,bool)
                     
                          (L:H225_Inverter1,bool) ! (L:H225_Inverter1_Guard,bool) and
                              if{
                                0 (>L:Inverter1,bool)
                                <!-- Push Button Sound Effect -->
                                1 (>L:H225_Big_Push_button,number)
                                }
                          (L:H225_Inverter1,bool) (L:H225_Inverter1_Guard,bool) and
                              if{
                                1 (>L:Inverter1,bool)
                                <!-- Push Button Sound Effect -->
                                1 (>L:H225_Big_Push_button,number)
                                }
                    </callback_code>
                </mouserect>
                <visible_in_range>
                    <parameter>
                        <code>
                            (L:H225_Inverter1,bool) !
                                if{ 0 } els{ 1 }
                        </code>
                    </parameter>
                    <minvalue>1</minvalue>
                </visible_in_range>
        </part>

From this image, you will see why I used Bill teachings about night enviroments...
In_action.jpg


The problem I haven't contemplated when "I decided" to use Approach # 1, is the huuuuuggggeeeee code required to make the darn push button to work and... I HAVE a millon of those to go.
Another cute thing, is that sooner or later I will be running out of the number of possible animations I might include in the makemdl.parts.xml file (which I belive, it is 200 max).

This is remotely harder to achieve compared with a much simpler code using the "2D gauge" philosopy described on Approach # 2.

Summarizing:
  1. I need your thoughts on how to make this whole set of annunciators, push buttons and everything else requiring the illumination effects in the more efficent way possible (from simulator's speed and resource perspective).
  2. If I may, how would you do this?
In advance, thank you very much.
Sergio Kauffman.
 
Last edited:
Hi Sergio

As I'm not an XML/VC developer I can't really help with the overall question but maybe I can clear this up for you:-

> Drawing flags "Bright" and "Luminous" described in FS9's Panels SDK Overview, are not fully understood by me; perhaps I need to do more tests in this regard...

I agree that the SDK info is not too helpful and the screenshots of the gauge are pretty much useless. Those three flags only apply to a 2D panel/gauge as VC designers have access to dynamic lighting. This is from my B-314:

[Color]
Day=255,255,255
Night=16,16,16
Luminous=88,88,50

I have always considered those three entries to be filters that are applied over the top of the gauge bitmaps. 'Day' is also confusing in that it corresponds to the 'Bright' flag in a gauge macro. So, assuming that there are no illumination flags applied to a gauge bitmap, during the day the bitmap takes its filter colour from the 'Day' entry. As the sim moves into night, the 'Night' entry is applied to the bitmap. If you now apply the 'Bright' flag, the bitmap takes on the 'Day' filter again. Finallly, if you apply the 'Luminous' flag to the bitmap and remove any 'Bright' flag, the applied filter corresponds to the 'Luminous' entry in the panel.cfg file. The overall lighting effect can be further modified by switching bitmaps that have different colours, so you can have identical gauges that display different luminosity depending on the bitmap colour before the filter is applied.

In the case of the B-314 2D panel I get this:

filters.jpg


From left to right: Day, Night, Luminous flag applied, Bright flag applied. Note that for the Luminous flag the bitmap has also been changed to modify both the overall colour before the filter is applied and to indicate that the lighting is now coming from the candlestick (top right). In the case of the final screenshot, the bezel has been rotated to indicate that the lighting is coming from a direct overhead source. On the gauge face you can see the Bright flag's similarity with the normal Day gauge (far left).
 
Last edited:
Hi Sergio

As I'm not an XML/VC developer I can't really help with the overall question but maybe I can clear this up for you:-

> Drawing flags "Bright" and "Luminous" described in FS9's Panels SDK Overview, are not fully understood by me; perhaps I need to do more tests in this regard...

I agree that the SDK info is not too helpful and the screenshots of the gauge are pretty much useless. Those three flags only apply to a 2D panel/gauge as VC designers have access to dynamic lighting. This is from my B-314:

[Color]
Day=255,255,255
Night=16,16,16
Luminous=88,88,50

I have always considered those three entries to be filters that are applied over the top of the gauge bitmaps. 'Day' is also confusing in that it corresponds to the 'Bright' flag in a gauge macro. So, assuming that there are no illumination flags applied to a gauge bitmap, during the day the bitmap takes its filter colour from the 'Day' entry. As the sim moves into night, the 'Night' entry is applied to the bitmap. If you now apply the 'Bright' flag, the bitmap takes on the 'Day' filter again. Finallly, if you apply the 'Luminous' flag to the bitmap and remove any 'Bright' flag, the applied filter corresponds to the 'Luminous' entry in the panel.cfg file. The overall lighting effect can be further modified by switching bitmaps that have different colours, so you can have identical gauges that display different luminosity depending on the bitmap colour before the filter is applied.

In the case of the B-314 2D panel I get this:

View attachment 89259

From left to right: Day, Night, Luminous flag applied, Bright flag applied. Note that for the Luminous flag the bitmap has also been changed to modify both the overall colour before the filter is applied and to indicate that the lighting is now coming from the candlestick (top right). In the case of the final screenshot, the bezel has been rotated to indicate that the lighting is coming from a direct overhead source. On the gauge face you can see the Bright flag's similarity with the normal Day gauge (far left).

Hello Sir!
I will try to reconcile the ideas and try to figure out how I'm gonna proceed.

So far, I've crunched some numbers and definitively my Approach # 1 is not going to work at all; just won't cut it. Too complicated, resource hungry and not easy to maintain.

The thing is... I will need to relocate the UV's from the relevant polygons to another texture; in this case, I still have "real estate" in the original two textures where all LCD screens are layed out and treat them in the same way: Front faces will be controlled and handeled individually via "gauge logic"; not involving code inserted in the makemdl.parts.xml file -as I "succesefully did"-.

Remap the "offending parts"???, maybe; all remaining faces which are not included as an "indicator light". The nasty thing is that I have almost 250 items to "entartain myself" once again, export them from 3ds Max to Gmax, and try to make my way
into a plausible solution.

I will do a test with a single push button or any other indicator lamp (almost sure, the inverters or whatever I have already working).
If I like the result and have more patience -which is running low insanely fast till this point, by the way-, I will consider to take the new approach and make the pertinent changes.

In any event, thank you so much; appreciated indeed.
Kindest regards,
Sergio Kauffman.
 
Last edited:
Hello lovely people

Well, take a look at the pitot heat push buttons; the one on the left is lited and the right one is not (both do work as intended).
H225_using_2D_gauges.jpg


I did the test mentioned on thread #3; now both push buttons are mapped and working as a 2D gauge. The animation works fine though... you can see them "moving" with a mouse iteraction.
I must say that I am extremely disappointed with the results I achieved and all the hard work wil not shine at night. This is not gonna fly either as it is.

However... I will try a last thing and play a bit with TIME OF DAY stock variable. Will see...
Sergio.
 
Hello again...

I think I have a partial solution to this and definitively can live with it. It was really tricky for me to piece it together; but here we go with the results:

First image, shows the pitot push buttons either when is OFF (Pitot Heat Left) or ON (Pitot Heat Right, "Airbus Lights OFF philosophy", remember?). Nothing special right there... The lighting works as expected in day conditions.
Kinda_did_it_03.jpg


Now... at Night, Dawn or Dusk when the cockpit panel lights are ON. Here, it's the "nasty" bit of the solution. The entire push button is lited; however...
Kinda_did_it_02.jpg


IF I turn OFF the cockpit lights the result is the one I require:
Kinda_did_it_01.jpg


FINALLY!!! DEFINITELY I CAN LIVE WITH THAT and also, it works. :stirthepo

P.S. If anyone is interested in the solution, please let me know. Because it is a bit hard to redact a proper walk through with meaningful images, it'll take a while for me to do it.

Main reason, is because the "procedure" in this particular case, involves specific materials and their related textures, particular conditions on where and when the images involved in the 2D gauges will be seen (or not)
and a few conditions to keep in mind regarding animations. This is so weird... a "hybrid 2D gauge!!!"; which by the way is an animated 3D part (custom animation) and
at the same time a 2D gauge... o_O o_O o_O

NOTE:
DAI, thanks for everything; you made my brain to "click" on the right spot.

In any event, thank you kindly.
Sergio Kauffman.
 
Last edited:
Back
Top