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

3D gauge tooltips?

Messages
52
Country
unitedstates
I'm replacing my xml gauges with 3d gauges. However after my initial test the gauge annimation works fine but no tooltip. Sooooo, I looked into the AttachPointTool for tool tips finding only Part_ddi_tooltip and part_hud_tooltip. No luck with either one. How do I create tool tips for 3D gauges. Any help is appreciated.
 
For 3d gauges, the "Tooltips" must be provided in the modeldef.xml script for them:

For example:

Code:
  <PartInfo>
    <Name>switch_adi</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>RECIP ENG ANTIDETONATION TANK VALVE:1</Variable>
          <Units>Bool</Units>
          <Scale>50</Scale>
        </Sim>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipID>TOOLTIPTEXT_ANTIDETONATION_FLUID_SWITCH</TooltipID>
      <EventID>ANTIDETONATION_TANK_VALVE_TOGGLE</EventID>
    </MouseRect>
  </PartInfo>
 
I'm using stock animations. Like this one.

<PartInfo>
<Name>knob_kohlsman</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>(A:KOHLSMAN SETTING MB, inHg) 28 - 300 * dnor</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>hand</Cursor>
<HelpID>HELPID_GAUGE_KOHLSMAN_KNOB</HelpID>
<TooltipID>TOOLTIPTEXT_ALTIMETER_KOHLSMAN_INHG_OR_MBAR</TooltipID>
<MouseFlags>WheelUp+WheelDown+LeftDrag+LeftSingle+MoveRepeat</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmi 0 == if{ (M:X) (&gt;L:ClickStart) }
(M:Event) 'WheelUp' scmi 0 == if{ (&gt;K:KOHLSMAN_INC) }
(M:Event) 'WheelDown' scmi 0 == if{ (&gt;K:KOHLSMAN_DEC) }
(M:Event) 'LeftDrag' scmi 0 == if{ (M:X) (L:ClickStart) - 0 &lt;
if{ (&gt;K:KOHLSMAN_INC) }
els{ (&gt;K:KOHLSMAN_DEC) } }
</CallbackCode>
</MouseRect>
</PartInfo>

I don't see an event ID here. Could that be part of the problem? Aside from the fact that I know very little about code which is the biggest problem.
 
Last edited:
The only <Tag> of importance to tooltips is this:

Code:
<TooltipID>TOOLTIPTEXT_ALTIMETER_KOHLSMAN_INHG_OR_ MBAR</TooltipID>

The list of stock <TooltipID> are in the FSX SDK: Panels and Gauges SDK/Tooltips.

You can also create "custom" Tooltips using the <TooltipText> syntax. This is useful if you only need to identify something with a "name."

Code:
<TooltipText>Open Door</TooltipText>

Although most of the "dynamic tooltips" are available from the stock list of <TooltipID> entries, you can also create your own, again using the <TooltipText> syntax:

Code:
<TooltipText>%((A:KOHLSMAN SETTING HG:1, mbar))%!d! HPa</TooltipText>
 
You are a bit off course. You don't 'attach' a tooltip like that. They are usually found in code that includes a 'mouse rect' section. What you need to do is attach the mouse rect that does the action you want.
 
Thanks for the responses. Sorry for the late reply, I've been out of town.
So if I understand correctly the code that I've shown should at least give me text when I hover my mouse over the part in game right? However the animation won't work until I add a 'mouse rect'. Or neither will work until I add the 'mouse rect'. I'll work on that and see what happens.

Thank you both.
 
Ok, this is strange. I attached a 'mouse rect' for Kholsman knob and I'm using the above kholsman annimation attachment. After attaching the 'mouse rect' both the annimation and tool tips are working but the tool tip is stating that the master switch is on/off and nothing about my altimeter setting. I don't see master switch in the tooltip definition anywhere. I'm confused :confused: but encouraged:scratchch.
 
Did you check the list of pre-set "TooltipIDs?"

There are only four choices, none of which are the one you've used:

Code:
TOOLTIPTEXT_ALTIMETER_KOHLSMAN_INHG  "Altimeter Calibration Knob (%((A:KOHLSMAN SETTING HG, inHg))%!1.2f! in Hg)" 
 
TOOLTIPTEXT_ALTIMETER_KOHLSMAN_MBAR  "Altimeter Calibration Knob (%((A:KOHLSMAN SETTING HG, mbar))%!d! mbar)"  

TOOLTIPTEXT_BACKUP_ALTIMETER_KOHLSMAN_INHG  "Altimeter Calibration Knob (%((A:KOHLSMAN SETTING HG:2, inHg))%!1.2f! in Hg)"
  
TOOLTIPTEXT_BACKUP_ALTIMETER_KOHLSMAN_MBAR  "Altimeter Calibration Knob (%((A:KOHLSMAN SETTING HG:2, mbar))%!d! mbar)"

Because of your error, the sim will display some "random tootip" instead of the one you want.
 
Thank you n4gix. Again the code I posted is a stock code out of the modeldef. Taking your advice I removed the _OR_ MBAR from the stock code
and now it works fine. Now I know what to do next time the stock animation attachments are incorrect or non exsistant. I have gone through the tooltip ids and help ids and so on in the SDK. There are so many it's mind bending but I think I'm on the right track now.
 
I'm not sure where that "_OR_ MBAR" actually came from then!

I've triple-checked an original modeldef.xml file (from SP1, SP2, and Acceleration SDKs), and haven't found it anywhere in them... :confused:

In any case, I'm happy you have it working now. :D
 
Back
Top