XML gauge help

MaddogK

Sim Junkie
Can someone help me understand the structure of XML a little bit more ? Specifically, in the IF / ELS structure can you have another IF / ELS structure within it ? It seems like you can't have an ELS within a larger IF / ELS construct, but I'm thinking you can have multiple and if statement within one.

Also when it comes to the command (S0:, etc) 'subroutines', is there an equivalent 'return' command once the subroutine finishes, or is it automatically returned back to the original routine just after the S0: command was run ? Does it return at all ?
 
Those are English words but they don't make since to me in that order. I, eh :dizzy: Maybe someone over on FSDeveloper can help?
 
MANY cobwebs here, but I recall something with regards to the "S0" commands.

They basically "store" the information, if I recall correctly. You can have up to 10 commands or data instructions (S0 - S9) which can then be "recalled" by using the "L0" script.

The "S" is for "store" while the "L" is for "Load" in the case of these xml gauges. Just remember that in many cases it's written as "s0" and "l0" where the letters are lower-case.

Let's say you run a multiplier like 2 x 4 = 8 in your script. You could then write the s0 command after it to store the answer. Then, when you needed the answer in a further line down the road, you'd place l0 at the beginning of that line where you needed the answer to be used. If you needed it to be used further down the line, then you would just place the l0 further down the equation.

My syntax probably stinks, but here goes:

* 2 4 s0

That should "store" the number 8 in your xml. When you're ready to use the answer you could write:

/ 16 l0

which would give you an answer of "2" in the end.

At least I think that's the way to do it, anyway.

The "store" and "load" are well suited for the "logic" stuff since they can help you compare numbers/values by calling up the answer to a previous equation. Nice for performance, if you have failures, navigation information, etc.

As for the "logic" statements, well, that's another story. I did some work with folks to put out a LORAN gauge for FS9 a while back, but my work was mostly the manual and the graphics. The gist I remember for the "if/else" statements and lines is that "if" is followed by what you want to test (i.e. whether a station is in range of the aircraft). The "else" is what you would like if the value isn't what you want in the "if" statement (i.e. if the aircraft is within 500 nm then the station is in range, else it is not and you don't have a signal).

If I remember correctly, you can "store" the answer of one if/else statement and then "load" it down the line with another if/else statement to have a sort of "compound" statement. Just can't really remember the how.

Again, I'm VERY, VERY rusty on this since it's been a while. With stuff going on at home I barely have time to contribute any more, but thought I'd try to help with what little I remember.

Like Allen said, you're better off trying to see if FSDeveloper folks can help on this since this is right down their alley.

Good luck! :encouragement:

Jorge
Miami, FL
 
Can someone help me understand the structure of XML a little bit more ? Specifically, in the IF / ELS structure can you have another IF / ELS structure within it ? It seems like you can't have an ELS within a larger IF / ELS construct, but I'm thinking you can have multiple and if statement within one.

Also when it comes to the command (S0:, etc) 'subroutines', is there an equivalent 'return' command once the subroutine finishes, or is it automatically returned back to the original routine just after the S0: command was run ? Does it return at all ?

Maddog, 2 masters of xml who i can think of are Hiroshi Igami, and Edward Cox. Theyre your best bet. Hiroshi can be a bit diffcult to understand sometimes due to his native language, but once you know what hes talking about it all makes sense.

Ed will give out advice, but only if youre willing to listen and learn, he also doesnt reply as often as H does. You can contact them both via Facebook.
 
Thanks guys, I do appreciate the help. I have never attempted something as complex as what I'm trying to do, so 'stacking' these commands is a bit tricky for me, and I've started to learn what works and what doesn't. Basically I'm taking the state of two variables (on/off from 2 switches) to control 3 sound sequences, and my second sound sequence triggers a counter that once expires triggers the third sequence. What I discovered is:
1. the entire sequence has to be contained in 1 element
2. If{ bla bla bla) starts the sequence.
3. An and if{ bla bla bla} following the If{} only seems to trigger the first argument in the 'and if{}' statement
4. an Els{bla bla bla} MUST be the last statement in the sequence
5. Then the entire element starts over again which many times resets the second sound thats currently playing back to the first sound that already played.
Truth be told, I'm not a coder but I was pretty good with basic back in the day and I'm hesitant about asking at FSDeveloper and showing I'm a complete noob (or worse, an idiot).
 
Back
Top