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

FSXA Light Landing Visibility condition code not working

Messages
130
Country
unitedkingdom
Hi

I have been using the default Light_Landing_vis visibility condition in a converted model. Its code is;
Code:
  <PartInfo>
    <Name>light_landing_vis</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:LIGHT LANDING,bool)
          (A:ELECTRICAL MASTER BATTERY,bool)
          and
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

I use it to have a spot light in the front wheel when the aircraft taxis into the RWY, BUT NOT WHILE TAXING. So far so good... but once the AI aircraft is airborne, I want it to disappear once the gear retracts, so I coded it as follows:
Code:
  <PartInfo>
    <Name>light_landing_vis_II</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:LIGHT LANDING,bool)
          (A:ELECTRICAL MASTER BATTERY,bool)
          (A:GEAR TOTAL PCT EXTENDED,percent) 100
          and and
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

It doesn't work: the spot light shows up right after pushback (as if I was using Light_Taxi_vis), and does not disappear when the landing gear retracts.

Is the code wrong?

Thank you for your help.

Antonio
 
As Ted pointed out, you need to evaluate the the gear extension percentage.
Personally, I prefer to leave a bit of a margin for (rounding) errors when evaluating conditons, so I'd use:
Code:
(A:GEAR TOTAL PCT EXTENDED, percent) 99 &gt;
 
I've tried both and it doesn't work... Is the rest of my code correct?

One thing I am going to try is to select no vis cond at all, export, close MCX and reload. Then I will apply the vis cond again and see what happens. Why?
Because it catch my eye the fact that I change the vis cond and nothing happens...

More advice is also very much appreciated.

Cheers

a
 
Hi try
Code:
    <PartInfo>
        <Name>land_lightvis</Name>
        <Visibility>
     <Parameter>
        <Code>
         (A:LIGHT LANDING,number) 1 == (A:ELECTRICAL MASTER BATTERY,number) 1 == (A:GEAR TOTAL PCT EXTENDED, percent) 99 &gt;
         and and if{ 1 } els{ 0 }
        </Code>
     </Parameter>
        </Visibility>
    </PartInfo>
 
As used on my Sikorsky S76 and will work, adjust as required

Code:
<PartInfo>
    <Name>S76_light_taxi_vis</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:GEAR LEFT POSITION, position) 0.75 &gt;
          (A:GEAR RIGHT POSITION, position) 0.75 &gt; or
          (A:LIGHT TAXI,bool) and
          (A:ELECTRICAL MAIN BUS VOLTAGE, volts) 5 &gt; and
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

Thanks to @Heretic for the code
 
Don't know if it's still available ....
But FS9 had a part tag called c_gearlight , maybe still in FSX???

Anything attached to it 'disappears' when the gear starts to retract.
 
... I am ashamed and I'm back to apologize... I'm sorry to have wasted your time just because I am useless... My code at the beginning of the thread works like a charm, as some other suggestions that came after do .
The problem was that the night textures where playing a trick on me. The light remaining on I was seeing was actually the night texture that in FSX does not disappear (like the logo light or the reflections on the fuselage). I am so embarrass...

At least I know I can write very simple code and that is possible because of your continuous help. I beg you please do not take my clumsiness to much into consideration when I ask again... Sorry and thank you very very much for your patience

Antonio
 
Don't beat yourself up too much...I'd say that everyone here has done something like that way more than once! :confused:
 
About 60% of my created threads are monologues with a stupidly simple solution. Dig around if you want to cheer yourself up.
 
Back
Top