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

FS2004 Refresher, custom failures

Messages
10,163
Country
us-arizona
Hey guys,

If I want to have a custom failure, how would that be written in a string?

For instance, I have a Radar Altimeter, which has a 'power on' switch. Flip that on, and the RAD Alt comes to life.

There is no Radar Altimeter code for on/off for reading off the A: systems. I have created an L:Var.

How might one do this with an L:var that would cause the system to sleep or not function? I can do this with visibility, but it doesn't seem right. What if I wanted to have another gauge type needle to sleep (not function, remain at zero reading) with a custom L:var? Is this possible, or do I need to use Visibilities and switch out the working needle for a stationary needle?

I am using FS9 gauge code (in P3D V2).


EDIT:
This is a typical 'failures' section;

<Failures>
<GAUGE_TURN_COORDINATOR Action="Freeze" />
<SYSTEM_ELECTRICAL_PANELS Action="0" />
</Failures>

This is what I want to do;

<Failures>
(A:Electrical Master Battery, bool) 0 ==
(L:Radar_Altimeter_Active, bool) 0 ==
</Failures>





Many thanks,


Bill
 
Last edited:
Can one insert the above custom failures into a <Value> section as logic?

Another words;

Code:
<Rotate>
<Value>
(A:Electrical Master Battery, bool) 0 ==
(L:Radar_Altimeter_Active, bool) 0 ==
and
  if{ Minimum="0" Maximum="2500">(A:Radio height, feet) }
</Value>
         <Nonlinearity>
            <Item Value="0" Degrees="0"/>
            <Item Value="500" Degrees="180"/>
            <Item Value="2200" Degrees="270"/>
            <Item Value="2500" Degrees="290"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="90"/>
</Rotate>


EDIT: nope... Just tried it.
 
Failures and other conditions can be included in the Value (for 2D) or Code (for VC). This is an example of code for a typical military 2500ft/762m radar altimeter for FS9/FSX. For realism, pointer goes to -5 (hidden) when inactive, or to maximum if A:Plane Bank/Pitch is too large:
Code:
<Value>
(L:RA_Active,bool) 
(A:PARTIAL PANEL ELECTRICAL,enum) 0 == and 
(A:PARTIAL PANEL AVIONICS,enum) 0 == and 
if{ 
	0.45 5.83 (A:Plane bank degrees,radians) rng 
	(A:Plane pitch degrees,degrees) abs 25 > or 
	if{ 762 } (* max *) 
	els{ (A:Radio height,meters) } 
} 
els{ -5 } (* fail *) 
-5 max 762 min (* limits *) 
</Value>
Hth. :)
 
You're awesome, Luka. Thanks man.

I don't think I have ever written logic into a Value before. I was trying to figure out how it would be written in a surrounding Element, but thought, that cant work as it wouldn't be tied into the needle animation.
 
Another way is to have say a control with both the A:var and and L:var. Thus
having control over the L:var.
To control the L:var I use a random seed
Code:
<Macro Name="XMLRandom">(L:RandomSeed1,number) 0 == (L:RandomSeed2,number) 0 == ||
if{ (P:Absolute Time,seconds) abs d 2147483563 % (>L:RandomSeed1,number) sqrt d d * * abs 2147483599 % (>L:RandomSeed2,number) } (L:RandomSeed1,number) 40014 * 2147483563 % (>L:RandomSeed1,number) (L:RandomSeed2,number) 40692 * 2147483399 % (>L:RandomSeed2,number) (L:RandomSeed1,number) (L:RandomSeed2,number) - 2147483563 / s1 l1 0 &lt; if{ l1 ++ s1 } l1</Macro>

<Element>
      <Select>
         <Value>(L:switch_pos,bool) 1 == (L:ran,bool) 0 == and
if{ @XMLRandom (>L:RandomNumber,number) 1 (>L:ran,bool) }
els{ (L:switch_pos,bool) 0 == if{ 0 (>L:ran,bool) } }</Value>
      </Select>
   </Element>

Or I use other triggers like time of day

Code:
<!-- Cabin Pressure Events -->
   <Element>
      <Select>
         <Value>(E:ZULU DAY OF YEAR,enum) 85 == (E:ZULU TIME, hours) 12 > and
(A:Indicated Altitude,feet) 21450 &gt; and
if{ 1 (>L:tampon_req, bool) } els{ 0 (>L:tampon_req, bool) }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(E:ZULU DAY OF YEAR, enum) 142 == (E:ZULU TIME, hours) 12 > and
(A:Indicated Altitude,feet) 31000 &gt; and
if{ 1 (>L:2tampons_req, bool) } els{ 0 (>L:2tampons_req, bool) }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(E:ZULU DAY OF YEAR, enum) 285 == (E:ZULU TIME, hours) 12 &lt; and
(A:Indicated Altitude,feet) 38000 &gt; and
if{ 1 (>L:3tampons_req, bool) } els{ 0 (>L:3tampons_req, bool) }</Value>
      </Select>
   </Element>

Another example:-
Code:
<Element>
      <Select>
         <Value>(E:LOCAL DAY OF MONTH, enum) 21 == (E:ZULU TIME, hours) 12.44 > and
(A:AIRSPEED INDICATED,knots) (L:DM REF V1,number) > and (A:AIRSPEED INDICATED,knots) 0 &gt; and (L:DM REF V1,number) 0 &gt; and
(L:ENG2 FIRE EXT,bool) 0 == and
(L:FIRE HANDLE 2 PULLED,number) 0 == and
(L:isolated,bool) 0 == and
if{ 1 (>L:EF_2,number) 2 (>L:Sound_Fire,enum) }</Value>
      </Select>
   </Element>

vololiberista
 
That's pretty interesting, Volo. I never thought of how one might put in random failures. Pretty dang cool.


I dare not ask about the second block of code, .....required, lol..
 
That's pretty interesting, Volo. I never thought of how one might put in random failures. Pretty dang cool.


I dare not ask about the second block of code, .....required, lol..

:) The second code sets of the engine fire alarm 'At' V1. Just the point where you don't want to hear any warnings! If the rwy is dry and plenty of room left then you can think about stopping. Otherwise you have to continue to rotation.

Of course having a failure set off by date and or time is not exactly random. But it does come at you out of the blue. Almost random would be by using the random number generator. But that really only controls failure rate. I use the random number generator in conjunction with the standby horizon which can remain toppled about 10% of the time thereby needing the fast erect button.

Btw in the first code dealing with cabin pressurisation you may have noticed certain L:var names!! in deference to the famous VC10 depressurisation fix.http://www.vc10.net/Memories/testing_earlydays.html#VIPTampax

vololiberista
 
Last edited:
Man, you are always filled with tons of idea's for this plane panel of yours. Goodness man. Will the work ever end?
 
Man, you are always filled with tons of idea's for this plane panel of yours. Goodness man. Will the work ever end?

Probably not!:mad:
Example: Anti-Ice. Almost every sim model has a 'single' anti-ice switch. And, pretty much a single control variable. I have had to design an entire anti-ice panel with switches, magnetic indicators etc. The whole thing is also temperature controlled by two combined air flows with differing temperatures. I've had to work out the temperature of said flow using a heat specific equation. Then set up valves that open and close accordingly. If both the left engines are out then there has to be a crossfeed from the right engines to the left wing. Other aircraft functions also have an effect such as engine igniters (when it is wet and below ASA 15). It's a nightmare, but works 90% of the time. So far there are about 70 control elements.
Next is a full hydraulics panel and electric panel with KVs and KVARs :confused:
But on the 10 it's not so simple as it has a dual split electric and hydraulic system meaning that in the case of a failure some systems will work/not work or self centre. I'm having to design flow charts for every instrument and control surface in order to determine how it fails. (time for a cup of tea!)
vololiberista
 
Last edited:
Back
Top