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

FSX How do I create custom tooltips?

Messages
40
Country
unitedstates
Hello:

I need some extra tooltips for my gauges, and I would like to know if somebody around here knows how to do it.

I know in the mouse area I should write something like this:

<Tooltip id="Tooltip">
<DefaultId>TOOLTIPTEXT_B737_HYD_ENG2_SWITCH</DefaultId>
</Tooltip>

Where TOOLTIPTEXT_B737_HYD_ENG2_SWITCH maps to a number ID in a dll, where the localized text is.

In this case I need tooltips for ENG3 and ENG4, since I have 4 engines, but FSX has these tooltips defined only for 2-engine aircrafts.

However, I don't know how to add new ID's, maybe I need to create a new dll

Any idea?
Thanks
 
You don't need to add IDs, just use this format;

<Tooltip>This is my tooltip for Eng1</Tooltip>
 
Not quite, for custom text it should be as below.

Code:
<TooltipText>Bombbay Door</TooltipText>

There's a bit in the SDK for adding variables such as engine RPM etc to the tooltips.
 
Not quite, for custom text it should be as below.

Code:
<TooltipText>Bombbay Door</TooltipText>

There's a bit in the SDK for adding variables such as engine RPM etc to the tooltips.

Nope, didn't work:

Code:
<MouseArea id="HYD Eng 3">
   ...
   <Tooltip id="Tooltip">
       <TooltipText>HYD Switch Engine 3</TooltipText>
    </Tooltip>
</MouseArea>

FSX fails saying there is an error in this gauge. Aces Resource editor specifies ACEXML Parser Error: TooltipText
 
If you are using ACE tool you can just insert any text you want in the
"DefaultSript" field of the TOOLTIP. Just be aware, this works NOT !! in SP1.

Dietmar
 
You really MUST specify which version of XML you are using:

FS9 XML schema - gauge script
FS9 XML schema - makemdl.parts.xml script

FSX XML schema - gauge script
FSX XML schema - modeldef.xml script

There are some similarities between the four, but there are also some very critical differences!

Based on your answers so far, I'm guessing that you are working on an XML "gauge" script.

It doesn't help a bit that the FSX SDK is -to be kind- confusing either! The entire "Creating XML Gauges" document for example has only one example for the Beech Baron Left Fuel Flow Indicator...

...and it's written in FS9 XML schema for heaven's sake!!! :eek:

In any case, this should work for you:
Code:
<MouseArea id="HYD Eng 3">
   ...
   <Tooltip id="Tooltip">
       <DefaultScript>Engine 3 HYD Switch</DefaultScript>
    </Tooltip>
</MouseArea>
 
You really MUST specify which version of XML you are using:

FS9 XML schema - gauge script
FS9 XML schema - makemdl.parts.xml script

FSX XML schema - gauge script
FSX XML schema - modeldef.xml script

There are some similarities between the four, but there are also some very critical differences!

Based on your answers so far, I'm guessing that you are working on an XML "gauge" script.

Sorry, I didn't understand that... I wrote the upper panel for an A340, file is
\panel\Airbus_A340\popup_overhead.xml

These are the first lines of the file and the contents outline:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document Type="AceXML" version="1,0">
    <Descr>AceXML Document</Descr>
    <Filename>popup_overhead.xml</Filename>
    <SimGauge.Gauge id="popup_overhead" ArtDirectory=".">
         <Element>        
           ...
         </Element>        
        <MouseArea>
           ...
        </MouseArea>
    </SimGauge.Gauge>
</SimBase.Document>
Is this the xml version you mean?

In any case, this should work for you:
Code:
<MouseArea id="HYD Eng 3">
   ...
   <Tooltip id="Tooltip">
       <DefaultScript>Engine 3 HYD Switch</DefaultScript>
    </Tooltip>
</MouseArea>


No, again error: FSX/Aces do not admit "DefaultScript"
 
These are the first lines of the file and the contents outline:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document Type="AceXML" version="1,0">
Is this the xml version you mean?

Yes. That tells everyone that you are working on an XML "gauge" script, using the FSX Schema. This is critical because there are differences between FS9 and FSX, as well as "gauges" versus XML scripted into the model itself! ;)

No, again error: FSX/Aces do not admit "DefaultScript"

Well, that's a surprise, since it's listed that way in the FSX SDK!!! :eek:
 
Not quite, for custom text it should be as below.

Code:
<TooltipText>Bombbay Door</TooltipText>

There's a bit in the SDK for adding variables such as engine RPM etc to the tooltips.

FSX ACC

Code:
<Gauge Name="Toggle_Dummy07">
  <Image Name="toggle1_off.bmp" ImageSizes="35,35"/>

<Element>
  <Select>
    <Value>(G:Var1) == 0 if{ 0 (&gt;G:Var1) els{ 1 (&gt;G:Var1) }}</Value>
      <Case Value="0">
         <Image Name="toggle1_on.bmp" ImageSizes="35,35"/>
      </Case>
      <Case Value="1">
         <Image Name="toggle1_off.bmp" ImageSizes="35,35"/>
       </Case>
  </Select>
</Element>
  
<Mouse>
  <Tooltip>Toggle_Dummy07</Tooltip>
  <Cursor Type="Hand"/>
    <Click>(G:Var1) ! (&gt;G:Var1)</Click>
</Mouse>

</Gauge>
 

Attachments

  • tooltip.jpg
    tooltip.jpg
    47.5 KB · Views: 729
Chris, that is perfectly correct for those using the FS9 XML Schema for 2d gauges...

It is however not correct for those (few) who are using the FSX XML Schema for 2d gauges, which is what this thread's question is about. ;)
 
Hello again:

I discovered that all tooltips are mapped to a string in language.dll fsx library. For example, if you use:

<Tooltip id="Tooltip">
<DefaultId>TOOLTIPTEXT_GAUGE_ECAMS</DefaultId>
</Tooltip>

then FSX will look at language.dll for the text corresponding to TOOLTIPTEXT_GAUGE_ECAMS.

However for retrieving the text, it does not search "TOOLTIPTEXT_GAUGE_ECAMS", but an associated ID. In this case, the ID for TOOLTIPTEXT_GAUGE_ECAMS is 13440, so the string #13440 in language.dll is the text displayed for this tooltip.

Now, 13440 is hex 0x3480, this number is the same used in gauges.h header file (used for writting gauges in C++).

Since there are many gaps in language.dll, I could insert in them my customized tooltips. However, I need a way to associate them from my xml. If I insert a custom tooltip for ID 123456 (assuming this ID is not used in language.dll), I could try this:

<Tooltip id="Tooltip">
<DefaultId>123456</DefaultId>
</Tooltip>

However it doesn't work. So TOOLTIPTEXT_XXX in XML gauges are not like those C++ #define macros. There should be another way FSX translates them into integer IDs.

My question is if somebody here worked developing FSX - or knows somebody who did for asking how FSX associates TOOLTIPTEXT_XXXX to a number. I searched into all my FSX folder files for any file containing a kind of table or list of TOOLTIPTEXT_XXX strings, but I found none.

Thanks.
 
My question is if somebody here worked developing FSX - or knows somebody who did for asking how FSX associates TOOLTIPTEXT_XXXX to a number. I searched into all my FSX folder files for any file containing a kind of table or list of TOOLTIPTEXT_XXX strings, but I found none.

Thanks.

No one has bothered hacking the .dll because it isn't necessary. Already in this thread the correct (and easy) way for XML "custom tooltips" are allowed to be created, so why reinvent the wheel?

What is time better spent, is discovering why the FSX XML Schema's <DefaultScript> isn't working for you. :o

Completely aside from which, you shouldn't distribute a "hacked language.dll" anyway.

I invested a few minutes to investigate this and test it out in FSX using the FSX XML Scnema. This absolutely DOES work! Note carefully that the <Tooltip...> must be anywhere within the <MouseArea>...</MouseArea> tags:

Code:
    <MouseArea id="MouseArea">
      <FloatPosition>0.000,0.000</FloatPosition>
      <Size>520,1058</Size>
      <CursorType>None</CursorType>
      <MouseArea id="Rev">
        <FloatPosition>477.000,123.000</FloatPosition>
        <Size>28,49</Size>
        <CursorType>Hand</CursorType>
        <Tooltip id="Tooltip">
          <DefaultScript>Engine 3 HYD Switch</DefaultScript>
        </Tooltip>
        <MouseClick id="MouseClick">
          <ClickType>LeftSingle</ClickType>
          <MouseWheelFlip>false</MouseWheelFlip>
          <ClickRepeat>false</ClickRepeat>
        </MouseClick>
      </MouseArea>
    </MouseArea>
 

Attachments

  • T-38A_Alpha4000007.jpg
    T-38A_Alpha4000007.jpg
    30.3 KB · Views: 635
Last edited:
No one has bothered hacking the .dll because it isn't necessary.

Actually I haacked it because there was an error in my language: they dropped a ( from a string script and thus it was displayed incorrectly.

What is time better spent, is discovering why the FSX XML Schema's <DefaultScript> isn't working for you. :o

I invested a few minutes to investigate this and test it out in FSX using the FSX XML Scnema. This absolutely DOES work! Note carefully that the <Tooltip...> must be anywhere within the <MouseArea>...</MouseArea> tags:

Absolutely agree, that's the point: why DefaultScript does not work. I copy-pasted your code in a new empty gauge (only a mouse area), and it did not work. (BTW you missed the closing mousearea tag, and I set float position from 477,123 to 0,0 for testing a defined tooltip) .This is how I tested:

First I backed up autopilot.xml from FSX's A321
Then I replaced it with:

Code:
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">
    <Descr>AceXML Document</Descr>
    <Filename>autopilot.xml</Filename>
    <SimGauge.Gauge id="autopilot empty test" ArtDirectory=".">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>339,150</Size>        
        <Image id="Image" Name="autopilot_background.bmp">
            <Transparent>True</Transparent>
        </Image>
        
        <MouseArea id="MouseArea">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Size>520,1058</Size>
            <CursorType>None</CursorType>
            <MouseArea id="Rev">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Size>28,49</Size>
                <CursorType>Hand</CursorType>
                <Tooltip id="Tooltip">
                     <DefaultId>TOOLTIPTEXT_AUTOPILOT_AUTOTHROTTLE</DefaultId>
                </Tooltip>
                <MouseClick id="MouseClick">
                    <ClickType>LeftSingle</ClickType>
                    <MouseWheelFlip>false</MouseWheelFlip>
                    <ClickRepeat>false</ClickRepeat>
                </MouseClick>
            </MouseArea>
        </MouseArea>
        
    </SimGauge.Gauge>
</SimBase.Document>

Reloaded aircraft. This worked, as expected: Only showed autopilot_background.bmp and a tooltip in the left-top corner.

Then I replaced:
<DefaultId>TOOLTIPTEXT_AUTOPILOT_AUTOTHROTTLE</DefaultId>
with:
<DefaultScript>Engine 3 HYD Switch</DefaultScript>

I Reloaded aircraft and got:

Panel or Gauge error.
Gauge: autopilot
Error: Error reading gauge file in folder Airbus_A321

Now autopilot section is not displayed (you can see airbus_a321_panel_background.bmp instead), and also there is not any tooltip.

As you said, the key is why DefaultScript does not work, but I don't have any more ideas about how to find it out :confused:

Thanks again...
 
Now autopilot section is not displayed (you can see airbus_a321_panel_background.bmp instead), and also there is not any tooltip.

As you said, the key is why DefaultScript does not work, but I don't have any more ideas about how to find it out :confused:

Thanks again...

Well, I suspect something in your FSX is amiss, because as you can see from the screenshot I posted, it absolutely DOES work on my stock FSX (english language) here. In fact, I tested the same gauge on three other test computers here at the office. ;)

BTW, the closing </MouseArea> tag was in the script, I just missed copying it to paste in my
Code:
 box.

I have no idea [U]which[/U] resource file in FSX is being checked for XML support...
 
Well, I suspect something in your FSX is amiss, because as you can see from the screenshot I posted, it absolutely DOES work on my stock FSX (english language) here.

I have no idea which resource file in FSX is being checked for XML support...


Hey!!! I think I have a clue: I checked my installed sdk docs and DefaultScript is not defined. However it does on microsoft's site. So maybe it's an update issue. Seems I need FSX SP2 and/or SDK SP1. I will try it...

Thanks!!!
 
Hey!!! I think I have a clue: I checked my installed sdk docs and DefaultScript is not defined. However it does on microsoft's site. So maybe it's an update issue. Seems I need FSX SP2 and/or SDK SP1. I will try it...

Thanks!!!

Ah, that would explain a lot then, as the SDK updates did fix a number of missing things. I highly recommend updating all the way to SP2 (or Acceleration if you have it).

This way you're set to build for all versions!
 
Last edited:
Back
Top