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

Simple XML code that eludes me

Messages
208
Country
us-ohio
This really shouldn't be too hard but for reasons that i am not understanding, I can't get a code to work for this.

What I need is a simple visibility code for an AI model that will allow a dummy part to only show during that time between when the model enters it's "boarding" stage and it taxies and then the reverse, after it returns to park till the nav lights go out.

So the triggers should be simple for an AI model.

LIGHT_NAV and LIGHT_BEACON should do the trick. The idea is that the code uses a boolean output from each of these parameters to either show or hide the part.

Here's my feeble attempt at this code:

<part>
<name>Fake_Interior_LOD_100</name>
<visible_in_range>
<parameter>
<code>
(A:LIGHT NAV,bool)(A:LIGHT BEACON,bool) +
</code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>2</maxvalue>
</visible_in_range>
</part>

The idea is that the stack returns a 1 when the nav lights are on (preflight or postflight) and a 0 until the beacon light comes on. So the min value to trigger the part's visibility should be a 1.

If the code returns a 0 or 2, that part should not show.

So it should be simple enough, add the first bool to the second bool, anything other than a 1 would hide the part.

But for whatever reason, it's not working like I want.

Also notice I am using a per part LOD part. I'm really hoping that this doesn't have an adverse effect on the xml visibility coding.

Thoughts??
 
Try inserting a space between the two A:vars :-

(A:LIGHT NAV,bool) (A:LIGHT BEACON,bool) +

Ted
 
Thank Ted, yea I saw that and realized it needed a space.

Unfortunately that doesn't seem to be the problem.

I think it might have to do with the min/max value lines.

I will have to keep trying as this shouldn't be this hard.
 
This minor modification would have caused your logic to work as desired:

(A:LIGHT NAV,bool) (A:LIGHT BEACON,bool) 2 * +

This would evaluate to: 0 or 1 or 3... ;)

If the code returns a 0 or 2, that part should not show.

No, that would not work since you had defined the range of visibility to be 1 to 2. You would have to either use the modified script as above, or changed the <Max> value to less than 2, such as:

Code:
<minvalue>1</minvalue>
<maxvalue>1.5</maxvalue>
 
Last edited:
What was your solution?
When you ask a question in a forum and you manage to figure out the answer it would be helpful to share what the answer was. In the future someone might have the same issue, and when they search here for it they will get what they need. ;)
 
Back
Top