PDA

View Full Version : Need some XLM programming help



OBIO
June 21st, 2009, 23:39
I am working on some gauges for the freeware Alpha Sim A-4s, F-4s, F-8s and others. I am using the F-4N as my test mule.

I basing my work on xlm gauges that came with various other freeware Alpha Sim jets....mainly from the F-105 package. I have a gauge modified to place a blue burner effect when the engine RPMs hit roughly 30%, another to place a second blue burner effect when the engine RPMs hit roughly 60%, and a third to place an after burner effect at roughly 90%.

The problem: The second blue burner effect and the after burner effect will not shut off when RPMs drop below the RPM percentage set in the gauges. And it kind of looks odd having an after burner effect in action when your jet is in cruise settings at 70% RPMs.

How can I get the effects to shut off when the RPMs drop below those listed in the XLM coding?

I am going to copy and paste the contents of the two gauges here for those who actually know what they are doing to look at.

This is the gauge coding that places the secondary blue burn effect:

<Gauge Name="Burner_SMOKE">
<Comment>
</Comment>
<Update Frequency="7"/>
<Element>
<Select>
<Value> (A:ENG1 COMBUSTION,number) 0 &gt;
(A:ENG1 N1 RPM,percent) 40 &gt; &amp;&amp; if{ (A:SMOKE ENABLE,bool) ! if{ (>K:SMOKE_ON) } } els{ (A:SMOKE ENABLE,bool) if{ (>K:SMOKE_OFF) } }
</Value>
</Select>
</Element>
</Gauge>

This is the gauge coding that places the after burner effect:

<Gauge Name="AB_LOGO">
<Element>
<Select>
<Value>
(A:LIGHT LOGO,number) 0 == ; (A:ENG1 N1 RPM,percent) 75 &gt; &amp;&amp; if{ (&gt;K:TOGGLE_LOGO_LIGHTS) }
</Value>
</Select>
</Element>
</Gauge>


OBIO

Moparmike
June 23rd, 2009, 08:24
For your second gauge (the afterburner/logo_light), you have a condition to toggle the afterburner if it is off but not one to toggle it once it is on.
Your other gauge is is using an if->else condition to turn your smoke on/off

That TOGGLE_LOGO_LIGHTS key you're using is a "one-shot" type action that flip-flops the LIGHT LOGO token. You could probably also use an if->else calc in a single element like in your first gauge to get the same toggling action. But the less RPN math I have to do the happier my brain is, so I opted for doing it with two separate elements!


Added highlighted code will turn the afterburner effect off if it is on and N1 RPM is less than 75%


<Gauge Name="AB_LOGO">
<Element>
<Select>
<Value>
(A:LIGHT LOGO,number) 0 == ; (A:ENG1 N1 RPM,percent) 75 &gt; &amp;&amp; if{ (&gt;K:TOGGLE_LOGO_LIGHTS) }
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(A:LIGHT LOGO,number) 1 == ; (A:ENG1 N1 RPM,percent) 75 &lt; &amp;&amp; if{ (&gt;K:TOGGLE_LOGO_LIGHTS) }
</Value>
</Select>
</Element>
</Gauge>

OBIO
June 23rd, 2009, 16:46
Mike

Thank you on two levels. The first for fixing the gauge so that it will work. Secondly for giving me a bit more understanding of XLM gauge coding. I have been trying to figure out what the &gt and &lt than meant...now I know that they stand for "and greater than" and "and less than". One step closer to being able to program gauges!

OBIO