• 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 v4 Retractable Landing Lights

Messages
958
Country
us-northcarolina
The ST Spartan Model in Model Converter X shows that the landing lights are animated and retract when you slide the slider BUT they do NOT retract in the simulator but just go on and off with the landing light switch. Otherwise they are ok though they are very small in the middle of the landing lights which I heard was a problem in V4.5 and I don't know how to fix that either. So this is a two part help me please!
 
Messages
2,063
Country
us-ohio
The sim doesn't have any events for light retraction. That will have been handled by custom XML code built into the 3D model.
 

=rk=

Resource contributor
Messages
4,408
Country
us-washington
But he already has the model loaded into MCX. He simply has to write a new visibility code into his modeldef.xml, tick down the nodes in the Hierarchy Editor until he finds the landing gear and make that the attach point, compile and voila. Below is a link to a procedure to make 3d light cones in Blender and how to attach them to the model. It seems like it should be easy enough to transpose this technique from 3d models to light effects, FSX to P3D and Blender to MCX - unless you wanted to do the whole thing in Blender like a new model.

 
Messages
958
Country
us-northcarolina
I just looked at your link above. The lights are already there as is the animation of the landing lights in the modeI. don't understand if they are already IN the model why they do not extend and retract with the landing light switch or what code would be added in the <Click Event> to make it happen. Redesign in Blender is not an option. I've tried to use Blender and do not understand it though I have tried. If the only way is with Blender then they will just to not work. Here is the current code for the Left Landing Light (Right Landing Light is the same and they both work together. Just that the REAL aircraft has two switches I created two switches on the panel. I have had "tubeliners" that have/do this.
Code:
<Gauge Name="LandingLights" Version="1.0">
   <Element>
      <Select>
         <Value>(A:Light landing,bool)</Value>
         <Case Value="0">
            <Image Name="switch_off.bmp" ImageSizes="42,67"/>
         </Case>
         <Case Value="1">
            <Image Name="switch_on.bmp" ImageSizes="42,67"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Help ID="HELPID_GAUGE_LIGHT_SWITCH_LANDING"/>
      <Cursor Type="Hand"/>
      <Click Event="LANDING_LIGHTS_TOGGLE"/>
   </Mouse>
</Gauge>

Thank you both for taking the time to read this and help.
 
Messages
958
Country
us-northcarolina
I found this in another post here. Will this work and where do I add it in the above code:
Code:
<PartInfo>
    <Name>T38_LandingLight</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:LIGHT NAV,bool) (A:GEAR HANDLE POSITION,percent) 100 == (A:ELECTRICAL MASTER BATTERY,bool) 1 == and and
          100 *
        </Code>
      <Lag>20</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

I know I need to change the Name to Spartan_Landing_Light .
 

=rk=

Resource contributor
Messages
4,408
Country
us-washington
I just looked at your link above. The lights are already there as is the animation of the landing lights in the modeI. don't understand if they are already IN the model why they do not extend and retract with the landing light switch or what code would be added in the <Click Event> to make it happen. Redesign in Blender is not an option.
Redesign in Blender is not required. These are very clear steps to follow
But he already has the model loaded into MCX.
He simply has to write a new visibility code into his modeldef.xml
This step is only required if you add a new light. Using the default landing light effect does not need a new visibility condition.
tick down the nodes in the Hierarchy Editor until he finds the landing gear and make that the attach point
compile and voila.
If each of those steps are too difficult to perform, the project may be too ambitious.

The lights are already there as is the animation of the landing lights in the modeI. don't understand if they are already IN the model why they do not extend and retract with the landing light switch or what code would be added in the <Click Event> to make it happen.
Ed has already explained the simulator code has no provision for retracting lights. They will never retract based on code, or switches, they will only retract when they are attached to something else that retracts. It is important to understand the difference between attach points, visibility conditions, gauges, animation triggers, etc. They are all written in XML, but they do not work the same and they cannot be swapped and transposed, beyond certain limits. You can take a code snippet for a term and place it into a different type of XML file, but you cannot transpose a gauge xml for a visibility condition.

Gauges aren't going to help here, visibility conditions might, animation triggers are definitely out, because you do not intend to edit the model. The tutorial I linked had been intended to show what was possible, with the expectation that the process could be adapted to MCX. It is not intended as a direct guide in this circumstance. The only part of that tutorial that requires Blender, is the creation of the 3d light cones, which could be done in Sketchup, FSDS, or entirely left out, the default landing light effect should be adequate for your needs, if it could just get itself linked up.

Ultimately, you are not required to edit the model in 3d software to get retractable lights, you are required to recompile the model using MCX, because you have to edit the Hierarchy nodes to move the light to the landing gear and that change will need to be saved.
 
Messages
958
Country
us-northcarolina
Then I will just leave them extended and just turn them on and off. If the designer made them a retractable animation then he obviously intended them to be retractable but since he has not nor intends to do anything more with flight simulator then I'll just use them as they are. Thanks to you all for taking the time to explain this in detail. I am IMO a fairly qualified repainter as well as scenery designer but xml code beyond click spots for popup windows or on and off switches goes beyond me but I am trying to learn and poring for hours trying to digest the xml tutorials by Nick and others. Such as the new post I will be doing for a carb heat gauge in a few moments.
 

=rk=

Resource contributor
Messages
4,408
Country
us-washington
I know what you mean. I never graduated college, never took a single class in graphics, 3d, or animation, but I do build my own computers. Until this one.
 

rotorhub

Resource contributor
Messages
122
Country
norway
I used retractable landing lights in my Falcon 20E. The animation is triggered by "light on states". I could not see any special code in my interior model. Just the Landing light switch.

In the P3D SDK landing lights are flagged as #4.

LIGHT ON STATES Bit mask:
0x0001: Nav
0x0002: Beacon
0x0004: Landing
0x0008: Taxi
0x0010: Strobe
0x0020: Panel
0x0040: Recognition
0x0080: Wing
0x0100: Logo
0x0200: Cabin Mask N -

LIGHT STATES Same as LIGHT ON STATES Mask N All aircraft

I do not have P3D or FSX installed, but I checked my old model using MCX. I don't remember if this was in my modeldef, or something I added later.

Code:
<Animation name="landing_light" guid="43347383-cff4-479c-a651-9b9cd33e4f04" length="100" type="Sim" typeParam2="landing_light" typeParam="AutoPlay" />
<Animation name="R_landing_light" guid="ab55cc15-5ca5-4f1f-89c0-ecb7c73ab6f6" length="100" type="Sim" typeParam2="R_landing_light" typeParam="AutoPlay" />

  <PartInfo>
    <Name>landing_light</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
                (A:ELECTRICAL MAIN BUS VOLTAGE, volts) 0 &gt; if{
                (A:LIGHT STATES, flags) 4 &amp; 0 ==
                if{ 0 } els{ 100 }
                d (&gt;L:LastLandingLightPosition,percent)
                }
                els{ (L:LastLandingLightPosition,percent) }
                </Code>
        <Lag>50</Lag>
      </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
    <Name>general_light</Name>
    <AnimLength>100</AnimLength>
    <Visibility>
      <Parameter>
        <Sim>
          <Variable>LIGHT LANDING</Variable>
          <Units>bool</Units>
        </Sim>
      </Parameter>
    </Visibility>
  </PartInfo>
  <PartInfo>
    <Name>R_landing_light</Name>
    <Copy>landing_light</Copy>
    <AnimLength>200</AnimLength>
    <Animation>
      <Parameter>
        <Code>
                (A:ELECTRICAL MAIN BUS VOLTAGE, volts) 0 &gt; if{
                (A:LIGHT STATES, flags) 4 &amp; 0 ==
                if{ 0 } els{ 100 }
                d (&gt;L:LastLandingLightPosition,percent)
                }
                els{ (L:LastLandingLightPosition,percent) }
                </Code>
        <Lag>50</Lag>
      </Parameter>
    </Animation>
  </PartInfo>
 

rotorhub

Resource contributor
Messages
122
Country
norway
You will need to attach the landing lights effect to the animated object. I think this can be done with the editor in MCX.
Falcon 20E.png
 
Last edited:
Messages
958
Country
us-northcarolina
I don't need to do anything. I had a divine inspiration as I was falling asleep last night that solves this and can close the thread solved. The landing light retraction is coupled in the model with the retraction of the landing gear. Just tried it out and that is it! Thank you all for all your suggestions. I DID also learn from ya'all that it can't be activated with an xml code so something was learned.
 

tgibson

Resource contributor
Messages
11,300
Country
us-california
If they are already retracting in MCX, then what animation tag is being used? Use the Hierarchy Editor to find them (Highlight box checked, they will turn red when selected), and look at the Animation section on the right to see what tag they are using. If a custom tag you can open the modeldef.xml file in MCX and examine the code. This should tell you what animation is being used and thus how to trigger them.
 
Top