• 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 Very simple question about XML syntax

Messages
45
Country
france
Hi everybody,

We have some problems with an helicopter, I think the code is not correct.

In multiples areas in the XML code, we see this kind of code writing :

Code:
(L:SwvalveEng1, bool) 1 == || (L:FuelcutE1,bool) 1 == || if{ 0 (>L:MvalveEng1,bool) } els{ 1 (>L:MvalveEng1,bool) }

Is that syntax works ???

This code should be write :

Code:
(L:SwvalveEng1, bool) 1 == (L:FuelcutE1,bool) 1 == || if{ 0 (>L:MvalveEng1,bool) } els{ 1 (>L:MvalveEng1,bool) }

Without || between the two comparisons ?

Thanks for helping.

Laurent.
 
The second code is correct.

2 conditions , one ||
3 conditions , two || and so on..

Same with &&

And starting after the second condition.

example

Code:
      (A:RADIO HEIGHT,feet) 10000 >
      (A:AIRSPEED INDICATED,knots) (A:AUTOPILOT AIRSPEED HOLD VAR,knots) 5 - >
      ||
      (A:VERTICAL SPEED,feet/minute) -20 <
      ||
      (L:AUTOTHROTTLE_TakeOff,number) 0 >
      &&
      if{
        (>K:AP_AIRSPEED_ON)
        0 (>L:AUTOTHROTTLE_TakeOff,number)
        }

Edi
 
Thanks for the answer.

In the code of this helicopter, there are many many samples of code like this error...

Code:
(L:SwvalveEng1, bool) 1 == || (L:FuelcutE1,bool) 1 == ||

Another sample...

Code:
(L:Gpu_door, percent) || if{ 1 (>L:ExternalPower, bool) } els{ 0 (>L:ExternalPower, bool) }

CeraSim Bell 222 FYI


Thanks again.
 
Last edited:
Thanks for the answer.

In the code of this helicopter, there are many many samples of code like this error...

Code:
(L:SwvalveEng1, bool) 1 == || (L:FuelcutE1,bool) 1 == ||

Another sample...

Code:
(L:Gpu_door, percent) || if{ 1 (>L:ExternalPower, bool) } els{ 0 (>L:ExternalPower, bool) }

CeraSim Bell 222 FYI


Thanks again.

Actually those are not errors but weirdness in the way of coding.
For example (pseudocode):

<Script>(LVar,bool) 1 == ||<Script> is the same as <Script>(LVar,bool)</Script> , which is obviously more clear to read.

and

<Script>(L:Gpu_door, percent) ||</Script> is true (1) as long as the door is 1+ % open. I would prefer to write <Script>(L:Gpu_door, percent) 0 ></Script>

Tom
 
Yes ! I understand.

By the way, another little question about the syntax,

See the following code below : There is a problem with the if{ no ?

Code:
(L:MasterDcBus,bool) if{ (L:RPM N1 E1,percent) 55 &lt; || (L:sw_masterc_test, bool) 1 == || (L:cautest, bool) || } if{ 1 (&gt;L:ENG1OUT, bool) } els{ 0 (&gt;L:ENG1OUT, bool) }
		(L:MasterDcBus,bool) if{ (L:RPM N1 E2,percent) 55 &lt; || (L:sw_masterc_test, bool) 1 == || (L:cautest, bool) || } if{ 1 (&gt;L:ENG2OUT, bool) } els{ 0 (&gt;L:ENG2OUT, bool) }
		(L:MasterDcBus,bool) if{ (A:Rotor RPM PCT:1, percent) 90 &lt; || (L:cautest, bool) || } if{ 1 (&gt;L:RPM, bool) } els{ 0 (&gt;L:RPM, bool) }
		(A:Rotor RPM PCT:1, percent) 90 &gt; if{ 0 (&gt;L:Sw_Rpm_mute, bool) } 		
		(L:MasterDcBus,bool) 1 == (L:Sw_Rpm_mute, bool) 0 == &amp;&amp; (A:Rotor RPM PCT:1, percent) 90 &lt;= &amp;&amp; (L:ViewSystemStatus, number) 2 == &amp;&amp; if{ 2 (&gt;L:low_rpm, enum) } els{ 0 (&gt;L:low_rpm, enum) }
 
Honestly I can't see anything wrong on that code, in a quick scan.
What do you mean by a "problem with the if{" ?

Tom
 
Back
Top