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

FS2004 Text warnings - howto

Messages
181
Country
czechrepublic
Hello,
I wonder how can I make strings to include letters, not numbers. I am creating warning system that will show actual failures etc, but my code:

Code:
<!-- text ENG1 fail--><Element>
	<Visible>(A:ENG1 FAILED, Enum) 1 ==</Visible>
	<Position X="400" Y="660"/>
	<Text X="400" Y="40" Bright="Yes" Length="16" Font="Arial" Color="red" Adjust="Left" VerticalAdjust="Center">
	<String>%( "ENGINE 1 FAILURE" )%!16s!</String>
	</Text>
	</Element>
if engine fails returns only "1" as far as it is the only number included. Letters dont appear. I tried experimenting with formating nubmers, but still the same.
///////////////////
And one more - how can I make <visible> to depend on some number, e. g. fuel ammount?
Code:
<Element>
	<Visible>(A:FUEL TOTAL QUANTITY WEIGHT,pounds) 500 <</Visible>
	<Position X="400" Y="660"/>
	<Text X="400" Y="40" Bright="Yes" Length="16" Font="Arial" Color="red" Adjust="Left" VerticalAdjust="Center">
	<String>%( "LOW FUEL" )%!16s!</String>
	</Text>
	</Element>
doesnt work, for some reason (should appear when less than 500lb of fuel is on board...
 
Last edited:
Correct formatting is critical:

Code:
<String>%ENGINE 1 FAILURE%!s!</String>

The !s! format doesn't take a length number; it's just plain old !s! regardless of the number of characters.

The "text argument" is simply plain text, whatever is between the % and % will be displayed.

The < character is illegal in XML when used as a conditional... You must use &lt;

Code:
<Visible>(A:FUEL TOTAL QUANTITY WEIGHT,pounds) 500 &lt;</Visible>
 
Last edited:
A cool thing I have seen on PFD's that Dwight had also placed on our PFD screens is a warning that pops up on a timer, so it appears, then disappears, but will also locate on a list popup window as well, which is hidden till you check it.


What were you trying to do with the 16s? Was that to change font size? What does the s so?

Sorry for being nosey.
 
Thanks Bill, I hope I will remember it...

And ENGINE 1 FAILURE = 16 characters... I only forgot to change this number for the other warning messages :)
 
What were you trying to do with the 16s? Was that to change font size? What does the s so?

Sorry for being nosey.

"s" means "string data."

It does NOT need a number in front, nor in fact should anyone put a number in front. Leave it as "unlimited."
 
Thanks Bill, I hope I will remember it...

And ENGINE 1 FAILURE = 16 characters... I only forgot to change this number for the other warning messages :)

That is the point. You shouldn't PUT a number in front of the !s! at all. Leave it as "unlimited" (any number of characters)!
 
Back
Top