plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

SWS-AlexVletsas avatar image
SWS-AlexVletsas asked Boris_ commented

Defining a default parameter in more than one component causes conflict

While working on a model's interior.xml I noticed that a potentiometer would be stuck at 55% no matter what I would change in my code.

In the end I found out that two separate <Component> entities had the same potentiometer defined. Only one entity had a potentiometer knob in it though and the splitting was done on purpose to keep my code more organised.

<Behaviors>
   <Component ID="Component1">
          <Parameters Type="Default">
               <POTENTIOMETER>3</POTENTIOMETER>
          </Parameters>
          ....................
   </Component>


   <Component ID="Component2">
          <Parameters Type="Default">
               <POTENTIOMETER>3</POTENTIOMETER>
          </Parameters>
          .....................
   </Component>
</Behaviors>

Can anyone explain why an A:var parameter will not work correctly if it is shared across two components?

aircraftgauges
2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Boris_ avatar image Boris_ ♦ commented ·

Hello @SWS-AlexVletsas ,

To help us understand this behavior, can you send us the xml file of your interior xml as well as the custom template files if you are using some?
See 3) Provide private content

Thanks,

Regards,
Boris

0 Likes 0 ·
Boris_ avatar image Boris_ ♦ Boris_ ♦ commented ·

Which package are you referring to when you say 'interior.xml'?

As we never keep previously sent packages, can you send us yours please ?

See 3) Provide private content


Regards,

Boris

0 Likes 0 ·

1 Answer

·
SWS-AlexVletsas avatar image
SWS-AlexVletsas answered Boris_ commented

It seems the file didn't make it through. Here is the offending code, isolated.

You see that under <Behaviors> I have two separate components, one called Pilot_Panel and the other one Lighting_Pilot.

Both have a Default Parameter that specifies potentiometer 3 as its default. The bug is that all the meshes that use potentiometer 3 will be stuck at 55% brightness.

If I remove <POTENTIOMETER>3</POTENTIOMETER> from the Default Parameters of one component, then it will work correctly.

    <Behaviors>
   <Component ID="Pilot_Panel">
            <Parameters Type="Default">
                <IS_EMISSIVE>True</IS_EMISSIVE>
                <SIMVAR_LIGHT>LIGHT PANEL ON:3</SIMVAR_LIGHT>
                <POTENTIOMETER>3</POTENTIOMETER>
                <DONT_OVERRIDE_BASE_EMISSIVE>False</DONT_OVERRIDE_BASE_EMISSIVE>
            </Parameters>
            <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                <NODE_ID>LIGHTING_Emissive_PANEL_Pilot</NODE_ID>
            </UseTemplate>
       .....................code,code,code.........................
    </Component>
    <Component ID="Lighting_Pilot">
            <Parameters Type="Override">
                <ID>3</ID>
                <POTENTIOMETER>3</POTENTIOMETER>
                <SIMVAR_LIGHT>LIGHT PANEL ON:3</SIMVAR_LIGHT>
                <LIGHT_TYPE_2/>
                <DONT_OVERRIDE_BASE_EMISSIVE>False</DONT_OVERRIDE_BASE_EMISSIVE>
            </Parameters>
            <Component ID="Lighting_Knobs_Pilot">
                <UseTemplate Name="ASOBO_LIGHTING_Knob_Panel_Template">
                    <NODE_ID>LIGHTING_Knob_PILOT</NODE_ID>
                    <ANIM_NAME>LIGHTING_Knob_PILOT</ANIM_NAME>
                    <LIGHT_TYPE_2/>
                    <!--
                    <TOOLTIP_TITLE/>
                    <TOOLTIPID>Pilot instrument lighting %( (A:LIGHT POTENTIOMETER:#POTENTIOMETER#, Percent) )%!f!%%</TOOLTIPID>
                    -->
                </UseTemplate>
            </Component>
            <Component ID="Lighting_Emissives_Pilot">
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>LIGHTING_Emissive_PANEL_Pilot</NODE_ID>
                </UseTemplate>
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>INSTRUMENT_Needle_Airspeed_1</NODE_ID>
                </UseTemplate>
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>INSTRUMENT_Needle_Airspeed_Barberpole_1</NODE_ID>
                </UseTemplate>
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>INSTRUMENT_Drum_Altimeter_10_1</NODE_ID>
                </UseTemplate>
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>INSTRUMENT_Needle_Altimeter_100_1</NODE_ID>
                </UseTemplate>
                <UseTemplate Name="ASOBO_LIGHTING_Panel_Emissive_Template">
                    <NODE_ID>INSTRUMENT_Needle_VerticalSpeed_1</NODE_ID>
                </UseTemplate>
            </Component>
        </Component>
    </Behaviors>


1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Boris_ avatar image Boris_ ♦ commented ·

@SWS-AlexVletsas ,

I wasn't able to reproduce this behavior using your code.
Could it be the "code,code,code" part that triggers the problem? Did you test it without this part? What's in it?

Regards,
Boris



0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.