Jump to content

Question. How can I randomize the response of my .xml gauge?


Recommended Posts

:D Hi,

it's been long since I did a gauge. Just had an idea, but don't know where to start searching, (and feeling a bit lazy and sleepy too to be honest) so I thought I'd just ask.



I made a gauge a while ago. That gauge works fine. I now want to improve it a little.

The gauge is of the type:

If condition A is met, show smoke effects on aircraft.

And works.

The gauge is written in XML



I now want to Randomize the effect shown.


As in:

If condition A is met

in 50 % of cases show effect 1

in other 50% of cases, show effect 2


Is there an easy way, in .XML, to do this?




Link to comment
Share on other sites

I'm sure you want to know more about the code I used.

I should really look up to make sure.

As I said, it's been a while, so looking up may take long.


from memory:


gauge syntax is similar to:


(A:altitude) smaller then 1000 feet AND (L:ABCDE) = 1

if: 1 &gt (K:SMOKE_ON) AND 2 &gt (K:SMOKE_ON) AND 0 &gt (L:ABCDE)


or in words:

If Altitude smaller then 1000 feet AND (L:ABCDE) was previously set to 1


switch on smoke 1, smoke 2, and set (L:ABCDE) back to value 0 (zero).



I would like to change this in such a way that half the time smoke 1 comes on in that condition, and half the time smoke 2.

(or at least some randomisation, does not have to be 50-50. 60-40 is good enoug.;)



(and don't worry too much about the L:ABCDE. It's not the end of the world if this becomes a runaway.)




Sorry for not posting the full code.

I tried to combine this gauge with another. And got really stuck.

It may take me some time to untangle and find the working simple version again. So for now this is the best I can do.



Link to comment
Share on other sites

You could try using Doug Dawson's Random Number Gauge, dsd_random_number.zip from the Avsim library. The code would look something like this:


(A:Indicated Altitude, feet) 1000 (K:SMOKE_ON) } els{ 2 > (K:SMOKE_ON) }


Having not used Doug Dawson's Random Number Gauge myself, I think this code is something you can work with.

Link to comment
Share on other sites


I can not find that file on Avsim.com

(Not in Library. Did find link in Avsim forum but clicking gives "file no longer available" message.)


I did however find on FlyAwaySimulation.com an aircraft that has the gauge itself in it. - dsd_random_number.gau

(I assume that is the file that would be in: "dsd_random_number.zip"

as well.)



With among it's files:

dsd_random_number.gau 07.22.07 51.71 kB

dsd_random_number_readme.txt 08.29.08 1.90 kB


both in folder:

..\fsx_mcdonnell_fh1phantom_updated\FSX_McDonnell FH1Phantom_updated\gauges\AERIT-F104S-ASA-Gauges\





(Haven't had time to look at the files yet. -- Just file info posted in case someone else was looking for the gauge as well.)

Edited by il88pp
Link to comment
Share on other sites

yes, found now, thank you!


Had looked direct in Google, normally that finds files in Avsim Library. But now no results.


Searching in the Library itself I now found dsd_random_number.zip. Thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...