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

Button Light Come On!

Messages
97
Country
sweden
Hello again fellow simmers....a noob need some help here.
I wonder if anyone can explain how to turn on and off a light on a button/sighn when a switch is placed in the on or off position.

Should I put two different, "light" buttons on top of eachother, one that is lit and one that is not and assign different variables to them, how do I make the connection between the switch and the button? Is this information contained in the aircraft model file, if so; how do I open that file and what program do I use to edit that file?

Please post a sample code snippet so that I can check it out. I need it for FSX.

I use fs design studio.

Regards,
John Stewart :)
 
John - Try this which is pretty much standard.
Code:
<Gauge Name="Alternator fail LP Eng1" Version="1.0" Author="Edward Cook">
<!-- e-mail : tedcook@btinternet.com : This gauge is freeware.  -->
<!-- Image Sizes: LPs = 31,31 px. -->

  <Element>
    <Select>
      <Value>(A:General eng generator active:1,bool)</Value>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action="1" />
      </Failures>
      <Case Value="0">
        <Image Name="alt_LP_on.bmp" Bright="Yes" />
      </Case>
      <Case Value="1">
        <Image Name="alt_LP_off.bmp" />
      </Case>
    </Select>
  </Element>

  <Mouse>
    <Tooltip>Alternator warning</Tooltip>
    <Cursor Type="Normal" />
  </Mouse>
  
</Gauge>

Regards, Ted.
 
John, from your post it sounds as though you are trying to modify how an already compiled model works.

That really is not possible, since all of the XML controlling "code" is compiled in the model itself, along with all custom variable names, and the FSX Materials (lighted and unlighted).

FS Panel Studio will not work for this task.
 
Last edited:
Thanks for your replies,

TED - Should this code be inserted in the model file for the airplane?

I am building an airplane from scratch and what I am trying to do is to model a couple of switches that turn on and off the the non-smoking and fasten seatbelt sighns among other things. There is a finished code/command in the, "Standard Part Names" list for, "Switch_fasten_seatbelts; (frames 50)" and; "switch_non_smoking; (frames 50)" in FSD Studio. I have no problem animating the switches but I want something to happen when I switch the switches on and off. Where do I enter the code for this?

Regards,
John
 
Okay, the way your phrased your question was confusing. Since you've now made it clear that you are in fact building your own model, it's easier to answer your question.

The example Ted gave is for a 2d XML gauge script. It has no relationship to a model's XML scripting at all, since the syntax is totally different.

For a 3d model, you will need two copies of your "lighted object", each using a different FSX Material. Let's suppose that your "light" has a plastic lens that's a dark green when "off" and a bright green when "on."

The "unlighted" lens will have an FSX Material with only a Diffuse Color texture assigned. The "lighted" lens will have an FSX Material with Diffuse Color texture assigned, and a copy of the same texture dropped into the Self-Illumination slot. If you set the properties of the "lighted" FSX Material to "Additive," then it will be lighted even during the daytime.

Now, in your modeldef.xml file (which you can edit with Notepad.exe), you will need to create two script entries with which you'll later tag in GMax/Max using the Attachpoint Tool's "Visibility" function:

Code:
  <PartInfo>
    <Name>light_logo_ON</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:LIGHT LOGO,bool)
          (A:ELECTRICAL MASTER BATTERY,bool)
          and
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>light_logo_OFF</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:LIGHT LOGO,bool) !
          (A:ELECTRICAL MASTER BATTERY,bool) !
          or
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

Note that the "...ON" condition includes the battery switch so that the light will be on only if both the switch for logo lights and the battery are ON.

The "...OFF" condition requires that the logo lights switch be OFF or the battery switch be OFF.

The above examples can be easily modified to control anything you want by simply changing the <Name> entries, and the control variable which is (A:LIGHT LOGO,bool) in the examples.
 
Last edited:
Okej, thank you both for your help....I think I can solve it now with some help from the SDK as well. I guess I have to make some test gauges and see how things work. The code that both of you have provided will be very useful. My exterior airplane model is almost complete and I am now working on filling the virtual cockpit with buttons and so on....this is alot of fun :D

Oh, and one more thing....is it possible to make any money from the models that are created for FSX or is it just flight sim enthusiasts left here having fun building for own enjoyment?

Regards,
John
 
Back
Top