FS9 XML; use ToolTips? or HelpID's?

#1
Hey guys,

Yesterday, while starting out on my autopilot gauge, and putting in the first buttons, I had written them with TooltipID's. However, in testing it in the sim, the names were totally different from what I had entered. Almost hilarious what some of them were.

So, my question is this.. What 'should' I normally be using, and why didnt the names show properly in the buttons 'mouse overs'?

It was my understanding that you can write what you wish in Tooltip ID's..



Bill
 

taguilo

Resource contributor
#2
Yes you can write custom Tooltips in FS9 and in FSX SP2/Acceleration.
Maybe you could post an example of your code so we can give a better help :)

Tom
 
#3
This should be the heading selectors, left and right dial directions (inc and dec). But the tooltips read;
* Prop Pitch Lever
* Engine Radiator Temp (-480*)

...lol..

Here is the code for them.


Code:
      <Area Left="424" Right="474" Top="68" Bottom="120">
       <Tooltip ID="TOOLTIPTEXT_SET_HEADING_LEFT"/>
         <Cursor Type="DownArrow"/>
         <Click Event="HEADING_BUG_DEC" Repeat="Yes"/>
      </Area>
      <Area Left="475" Right="530" Top="68" Bottom="120">
       <Tooltip ID="TOOLTIPTEXT_SET_HEADING_RIGHT"/>
         <Cursor Type="UpArrow"/>
         <Click Event="HEADING_BUG_INC" Repeat="Yes"/>
      </Area>

Kind of odd..


Bill
 

n4gix

Resource contributor
#4
Bill all of the "Tooltip ID" entries are pre-set by ACES. You need to refer to the list in the SDK if you wish to use them...

...you can NOT simply make up your own names for them... :eek:

However, you CAN use the following style:

<Tooltip>View Chart 5</Tooltip>

Just put what you want the tip to say between the two tags.
 
#5
Ahhhhh....

Dommo Arrigatto, gozi-mashtah!


Thank you for that. I was wondering what was going on. I had this happen on some basic steam gauges in my Junkers and couldnt figure out why that happened.

Thanks again,

Bill
LHC
 

taguilo

Resource contributor
#6
However, you CAN use the following style:

<Tooltip>View Chart 5</Tooltip>

Just put what you want the tip to say between the two tags.
Adding to Bill's example, you can also use values from variables in your tooltips.

For example:
<Tooltip>View Chart %((L:Chart,number))%!d!</Tooltip>


Tom
 

n4gix

Resource contributor
#8
It's important to keep in mind that like most symbols in XML, the %( is used in pairs...

...thus the prototype for this operator is

%((condition to evaluate))

Note that the same applies to the "%!" symbol wrapping around the format instruction: %!d!
 
Last edited:

taguilo

Resource contributor
#9
It's important to keep in mind that like most symbols in XML, the %( is used in pairs...

...thus the prototype for this operator is

%((condition to evaluate))%

Note that the same applies to the "!" symbol wrapping around the format instruction: !d!

In these cases, the %( sign actually indicates that following characters are part of a script, which is going to end where the last ) char is found. There is no need for a % after that ).

The same happens with %!, which means a formatting condition is expected and will end after the next !.

That's the reason we always see constructions like this:

%((L:MyVar,enum))%!d!

where the last % is in fact a part of the following ! and not the previous ).

So for example, this kind of script would be valid:

<ToolTip>Engine 1 %((L:MyEng1,rpm)) total RPM = %!3.2f!<Tooltip>

giving Engine 1 total RPM = 95.3

A trivial clarification for an common misunderstood behavior of the scripting system in XML gauges :)

Tom
 
#10
Thanks Tom and Fr. Bill,

That tutorial is priceless. I had noticed that !4d! was used for say 4 digits in a readout. Great information.

Tom, when you say XML scripts, I thought that only FSX uses scripts, that FS9 doesnt. I must have heard wrong.

Thanks again for the tutorial. I am copying these to Notepad files for backup and learning.



Bill
LHC
 

n4gix

Resource contributor
#11
Last edited:
#12
Bill, I suspect that Tom -like myself- simply refuses to promote XML to the "exhalted dignity" of being called "code...."

N4gix

LOL... Roger that.

Before I got into all of this, it was 'jibberish'.. Then code. Now scripts. I am adapting.


I guess it paid off being a code freak (secret codes) when I was growing up. Helping me to comprehend/read these...


Bill
LHC
 

taguilo

Resource contributor
#13
LOL... Roger that.

Before I got into all of this, it was 'jibberish'.. Then code. Now scripts. I am adapting.

LHC
Actually XML files are not "real" code like we are used to speak of when talking about structured languages -C/C++/VB,etc.- but rather a template of organized tokens and scripts that facilitates the "inner" actions to be made by executable code that interpretes them.

Almost all XML command/structures support a scripting area (ie within <Value>) whose exclusive function is to process expressions and return an unique value to the current token.

These lose low level C functions that interprete the scrips are embedded in FS executables/main libraries, and are probably such simple and fast thanks to the RPN style of using math/string/trig operators.

Just a basic explanation of FS's XML wonder :D

Tom
 
Top