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

One more try!!

Messages
18
Country
us-washington
Ok, well no response to my last post, let's see if this question sparks any interest.

I'm also trying to get an animation to work via a gauge. The way I'm trying to set it up is, like this:

Button A triggers the animation, but only if Button B with a different condtion assigned to it is pressed first. If Button B isn't pressed first, then pushing Button A has no effect. Make sense?

Here is what I've got so far. Be nice and try not to laugh as I'm brand new to the whole XML thing.

Code:
<Element>
<Select>
<Value>(L:Var_A, bool)
           (L:Var_B, bool)
</Value>
<Case Value="0">
<Image Name="button_A_up.bmp"/>
</Case>
<Case Value="1">
<Image Name="button_A_down.bmp"/>
</Case>
</Select>
</Element>
<Mouse>
<Cursor Type="Hand"/>
<Click>>(L:Var_A, bool) if{ (L:Var_B, bool) =1 &gt; } els{ 0 (>L:Var_A,bool) }
</Click>
</Mouse>
</Gauge>

Any help would be greatly appreciated!!
tre88
 
Code:
<Gauge>
  <Element>
    <Select>
      <Value>
        (L:Var_A, bool)
        (L:Var_B, bool)
        and
      </Value>
      <Case Value="0">
        <Image Name="button_A_up.bmp"/>
      </Case>
      <Case Value="1">
        <Image Name="button_A_down.bmp"/>
      </Case>
    </Select>
  </Element>
  <Mouse>
    <Cursor Type="Hand"/>
    <Click>
      (L:Var_A, bool) if{ 1 (>L:Var_B, bool) } els{ 0 (>L:Var_A,bool) }
    </Click>
  </Mouse>
</Gauge>
 
Thank you for responding Sir, I applied your code and no luck!! Perhaps it's something with the other half of the equation. Here is the final draft of both sets of codes. I've tried deleting the "bool" for one or both and still no luck!!

Code:
<Gauge>
<Element>
<Select>
<Value>(L:Var_B, bool)</Value>
<Case Value="0">
<Image Name="button_b_up.bmp"/>
</Case>
<Case Value="1">
<Image Name="button_b_down.bmp"/>
</Case>
</Select>
</Element>
<Mouse>
<Cursor Type="Hand"/>
<Tooltip>Fire Round 01</Tooltip>
<Click> (L:Var_B, bool) ! (>L:Var_B, bool) </Click>
</Mouse>
</Gauge>


<Gauge>
  <Element>
    <Select>
      <Value>
        (L:Var_A, bool)
        (L:Var_B, bool)
        and
      </Value>
      <Case Value="0">
        <Image Name="Button_A_up.bmp"/>
      </Case>
      <Case Value="1">
        <Image Name="Button_A_down.bmp"/>
      </Case>
    </Select>
  </Element>
  <Mouse>
    <Cursor Type="Hand"/>
    <Click>
      (L:Var_A, bool) if{ 1 (>L:Var_B, bool) } els{ 0 (>L:Var_A, bool) }
    </Click>
  </Mouse>
</Gauge>
 
Well, the first thing that strikes me is that the '>' characters in your script should all be replaced with &gt; - don't forget > is the XML tag terminator. Try replacing them and seeing what happens.

I must admit that catches me a lot of the time, as I'm used to using the ACES editor, which does all that for you...

Bill, I'm surprised you didn't catch that...;)
 
Well, the first thing that strikes me is that the '>' characters in your script should all be replaced with &gt; - don't forget > is the XML tag terminator. Try replacing them and seeing what happens.

I must admit that catches me a lot of the time, as I'm used to using the ACES editor, which does all that for you...

Bill, I'm surprised you didn't catch that...;)

Um, because that's not strictly true! :D

While the < symbol will NOT work and must be entered as &lt;

The > symbol WILL work just fine, always... :teacher:

Now, having said that, the only place I use the > symbol is in the context of key_events, such as (>K:SomeCommand) as it makes it much more clear than (&gt;K:SomeCommand)...
 
Well fellas, I've tried every combination I could think of with this issue, and still no luck.

I originally started to build this gauge using the Aces editor and I didn't have any luck getting this to work using that either. Seems it was designed for only one expression to used in the scripts section.
 
In the script below, Button A will only become active if Button B is active, otherwise it remains OFF.

Code:
<Gauge>
  <Element Name="Button A">
    <Select>
      <Value>
        (L:Var_A, bool)
      </Value>
      <Case Value="0">
        <Image Name="button_A_up.bmp"/>
      </Case>
      <Case Value="1">
        <Image Name="button_A_down.bmp"/>
      </Case>
    </Select>
  </Element>
  <Mouse>
    <Cursor Type="Hand"/>
    <Click>
      (L:Var_B, bool) if{ 1 (>L:Var_A, bool) } els{ 0 (>L:Var_A,bool) }
    </Click>
  </Mouse>
</Gauge>
 
The > symbol WILL work just fine, always... :teacher:

If you say so...:wizard:

I guess that's because the parser would assume with < that you were trying to open a tag, but with >, it knows that it can't be becasue the last tag was closed and the next one hasn't been opened.

Still, I'll keep it like that for safety, if you don't mind...:)

----

Anyway - I know more than one expression can be put in the script boxes at once, I do it all the time. I'll just have a closer look at the code.
 
Posts crossed in midair...

Also, you used 'and' in the original code - which is suposed to be allowed but I find that && is more reliable for some reason.

But Bill probably has the best version there.
 
Ok, that last version of the code worked!!! Now if I can get it to work through the Aces editor I'm good to go!!

Thanks Bill!!!
 
Back
Top