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

Flashing text!

Messages
97
Country
sweden
Hello,

Can anyone show me some sample gaugestring code on how to make a text, "flash" using the, "BlinkCode" script command.
I need some text to flash in a gauge when I disconnect the autopilot.

Thanks,
multipilot
 
Messages
10,088
Country
us-arizona
Here is one of mine. You can adjust the blinking via the 3 & 1 > ! section.

Code:
<!--  ======================================================BLINKING LOW VOLTAGE WARNING  -->

           <Element>
              <Position X="0" Y="245"/>
                 <Visible>
                                    (A:FUEL TOTAL QUANTITY,percent) 5 &lt; (P:Absolute time,seconds) 3 % 1 > !
                                     and
                 </Visible>
                       <FormattedText X="1400" Y="200" Bright="Yes" Length="18" Font="Nasalization" FontSize="110" Color="#FF0000" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No" FixedWidth="Yes" Transparency="0.5">
                            <String>DANGER LOW VOLTAGE</String>
                       </FormattedText>
           </Element>
 
Last edited:
Messages
1,564
Country
thailand
You can also try the escape sequence \{blnk} and see if you like the way that looks (with the background color blinking). However, Bill's (lionheart) <Visible> method, above, might be the best for you and you can control the timing of the blinks.

Here's an example of {blnk}: <String>\{blnk}AP OFF</String>. \{blnk} is inserted in front of your text.

and a couple of links to the list of XML escape sequences (same list in both references):

Susan Ashcroft's (ex-MSFT FS Team) blog or FSD's Wiki (courtesy Bill Leaming)

Hope it helps,

Bob
 
Messages
10,088
Country
us-arizona
Is that 'Engauged's blog? That is brilliant. I didn't know you could do that many effects with text in gauges. Very good to know. Thanks for posting this.
 
Messages
1,564
Country
thailand
Is that 'Engauged's blog? That is brilliant. I didn't know you could do that many effects with text in gauges. Very good to know. Thanks for posting this.

Yes, that's Susan's "Engauged" blog. There are several good entries in the Archives. Last entry, Jan 2009.
 
Messages
1,564
Country
thailand
Messages
97
Country
sweden
Here is one of mine. You can adjust the blinking via the 3 & 1 > ! section.

Code:
<!--  ======================================================BLINKING LOW VOLTAGE WARNING  -->
 
           <Element>
              <Position X="0" Y="245"/>
                 <Visible>
                                    (A:FUEL TOTAL QUANTITY,percent) 5 &lt; (P:Absolute time,seconds) 3 % 1 > !
                                     and
                 </Visible>
                       <FormattedText X="1400" Y="200" Bright="Yes" Length="18" Font="Nasalization" FontSize="110" Color="#FF0000" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No" FixedWidth="Yes" Transparency="0.5">
                            <String>DANGER LOW VOLTAGE</String>
                       </FormattedText>
           </Element>



Is this code compatible with FSX or XML? I copied it and inserted it in my xml script but it does not seem to work. The gauge turned blank when I tested it in FSX. The only lines I made changes to was the <Position X="0" Y="245"/> and (A:FUEL TOTAL QUANTITY,percent) line and also the <String>. I changed the position to X="200" and Y="1" and also the (A:-----""------) to (A:Autopilot master, bool).
I changed the <String>DANGER LOW VOLTAGE</String> to <String>AP</String>

Regards,
multipilot
 
Messages
97
Country
sweden
You can also try the escape sequence \{blnk} and see if you like the way that looks (with the background color blinking). However, Bill's (lionheart) <Visible> method, above, might be the best for you and you can control the timing of the blinks.

Here's an example of {blnk}: <String>\{blnk}AP OFF</String>. \{blnk} is inserted in front of your text.

and a couple of links to the list of XML escape sequences (same list in both references):

Susan Ashcroft's (ex-MSFT FS Team) blog or FSD's Wiki (courtesy Bill Leaming)

Hope it helps,

Bob


I will try this tomorrow....thanks.

Regards,
Multipilot
 
Messages
10,088
Country
us-arizona
Multipilot, this is in FS2004 XML. You can convert it to FSX XML by taking a similar script and putting in the key components from this script into the FSX version.
 
Messages
97
Country
sweden
Multipilot, this is in FS2004 XML. You can convert it to FSX XML by taking a similar script and putting in the key components from this script into the FSX version.

Okej, so maybe if I change the <formattedtext> and or <String> part as well and use <Gaugestring> instead it may work? I will try that....
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I keep this comment pasted at the top of my modeledef.xml file for ready reference:
Code:
<!--
With this universal code it's very simple to control not only the length of the cycle but the frequency of the
blink itself:
Pseudocode:<Visble>(P:Absolute time,seconds) "seed" % "blink lapse" > !</Visible>
The seed parameter is the total length of the blinking cycle. For example, if you want something to blink on every
second, you use 1, if you want it blink every half a second, use 0.5 , every two seconds, 2 ,etc.
 
For each seed, you can determine how long would be the duration of both the visible and invisible part.
Then:
(P:Absolute time,seconds) 1 % 0.5 > !
this will make the visible and invisible parts of half a second both.
(P:Absolute time,seconds) 1 % 0.7 > !
this will make the visible part 70% of the cycle (0.7 secs) and invisible parts of 30 % (0.3 secs).
(P:Absolute time,seconds) 0.5 % 0.25 > !
this will make the visible and invisible parts a quarter of second both.
You can invert the cycle by removing the "!" char.
-->
 
Messages
97
Country
sweden
:):)
I keep this comment pasted at the top of my modeledef.xml file for ready reference:
Code:
<!--
With this universal code it's very simple to control not only the length of the cycle but the frequency of the
blink itself:
Pseudocode:<Visble>(P:Absolute time,seconds) "seed" % "blink lapse" > !</Visible>
The seed parameter is the total length of the blinking cycle. For example, if you want something to blink on every
second, you use 1, if you want it blink every half a second, use 0.5 , every two seconds, 2 ,etc.
 
For each seed, you can determine how long would be the duration of both the visible and invisible part.
Then:
(P:Absolute time,seconds) 1 % 0.5 > !
this will make the visible and invisible parts of half a second both.
(P:Absolute time,seconds) 1 % 0.7 > !
this will make the visible part 70% of the cycle (0.7 secs) and invisible parts of 30 % (0.3 secs).
(P:Absolute time,seconds) 0.5 % 0.25 > !
this will make the visible and invisible parts a quarter of second both.
You can invert the cycle by removing the "!" char.
-->

Thank you, this worked! I was about to go crazy here trying to figure this one out.
 
Messages
97
Country
sweden
:)
You can also try the escape sequence \{blnk} and see if you like the way that looks (with the background color blinking). However, Bill's (lionheart) <Visible> method, above, might be the best for you and you can control the timing of the blinks.

Here's an example of {blnk}: <String>\{blnk}AP OFF</String>. \{blnk} is inserted in front of your text.

and a couple of links to the list of XML escape sequences (same list in both references):

Susan Ashcroft's (ex-MSFT FS Team) blog or FSD's Wiki (courtesy Bill Leaming)

Hope it helps,

Bob

Thank you for your help...The problem is now solved.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
This technique may be used many different ways. I use nested seed/blink-lapse conditions for example to drive a "double-flash" strobe light effect...
Code:
          <!-- STROBE LIGHT FLASHER -->
          (A:LIGHT STROBE,bool)
          (A:ELECTRICAL MASTER BATTERY,bool)
          and
             if{
                 (P:Absolute time,seconds) 2 % 0.4 > !
                   if{
                     (P:Absolute time,seconds) 0.2 % 0.1 > !
                        if{ 1 (>L:KA_350_Strobe,bool) }
                        els{ 0 (>L:KA_350_Strobe,bool) }
                     }
                }
 
Top