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

VC tooltips

DragonflightDesign

Resource contributor
Messages
1,371
Country
northernireland
I really have no idea where to put this thread, so here seems as good a place as any.

I've been told by one modeller that it isn't possible to add dynamic tooltips to a VC clickspot, but I'm also being told by a user that he has seen them. So if this is the modeldef code for the rudder trim (yes Roman - you have seen this before! 😁)
Code:
<PartInfo>
        <Name>RudderWheel</Name>
        <AnimLength>360</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                     (L:RudderWheel, number) 225 + 45 % 8 * 0 max 360 min
                </Code>
            </Parameter>
        </Animation>
        <MouseRect>
          <Cursor>Hand</Cursor>
            <MouseFlags>LeftSingle+LeftDrag</MouseFlags>
            <CallbackCode>
                            -20 20 (L:RudderTrimPos, number) rng (M:Event) 'LeftSingle' scmp 0 == and
                            if{
                                (M:X) (&gt;L:MouseX32, number)
                                (M:Y) (&gt;L:MouseY32, number)
                                (L:RudderWheel, number) 0.1111111 * -20 max 20 min (&gt;L:RudderTrimPos, number)
                            }

                            -20 20 (L:RudderTrimPos, number) rng (M:Event) 'LeftDrag' scmp 0 == and
                            if{
                                (L:RudderWheel, number) (M:X) (L:MouseX32, number) - 0.05 * + -180 max 180 min (&gt;L:RudderWheel, number) (M:X) (&gt;L:MouseX32, number)
                                (L:RudderWheel, number) (M:Y) (L:MouseY32, number) - 0.05 * + -180 max 180 min (&gt;L:RudderWheel, number) (M:Y) (&gt;L:MouseY32, number)
                                (L:RudderWheel, number) 0.1111111 * -20 max 20 min (&gt;L:RudderTrimPos, number)
                            }
             </CallbackCode>
         <TooltipText>Rudder Trim Wheel</TooltipText>
        </MouseRect>
    </PartInfo>
- how do I add L:RudderTrimPos to the tooltip? And no, I have almost no idea what I'm doing when it comes to programming the modeldef.
 
Very, very familiar! heh :p
You could try -
XML:
<TooltipText>Rudder Trim (%((L:RudderWheel, number) s0)%{if}%(l0 0.555555556 * abs)%!d!%% %(l0 0 &gt;)%{if}right%{else}left%{end}%{else}straight%{end})</TooltipText>
Depending on the rest of code ( IE how the trim wheel is implemented into the trim tab ), you may have to swap the "left" & "right"
If it works, the same code could be used for aileron & elevator by changing the L:Var, the beginning text and again either : swapping "left" for "right" & swapping "left" / "right" for "up" / "down".
This is because it is based on the raw +/- 180 limits, which is the same in all 3 versions, not the calculated position of the indicator.
 
Last edited:
Very, very familiar! heh :p
You could try -
XML:
<TooltipText>Rudder Trim (%((L:RudderWheel, number) s0)%{if}%(l0 0.555555556 * abs)%!d!%% %(l0 0 &gt;)%{if}right%{else}left%{end}%{else}straight%{end})</TooltipText>
Depending on the rest of code ( IE how the trim wheel is implemented into the trim tab ), you may have to swap the "left" & "right"
If it works, the same code could be used for aileron & elevator by changing the L:Var, the beginning text and again either : swapping "left" for "right" & swapping "left" / "right" for "up" / "down".
This is because it is based on the raw +/- 180 limits, which is the same in all 3 versions, not the calculated position of the indicator.
Yuyp that would be it :)
 
Dai... L:RudderWheel, number was put into s0... and l0 was used to extract it... and then that value was multiplied by 0.55555556 and the resulting value was resolved to a positive value and then... well, it goes on and on... LOL I don't know what the 0.55555556 represents... but the l0 is just a way to use what was stored by s0.
 
(L:RudderWheel, number) is stored in register in s0 and checked right away by an {if}. Zero, (false) is the only value that will bypass this {if} because there is no comparison to check, if so, it then goes all the way to the end %{else}straight%{end}
If not a zero, this first {if} is true, then -
Register s0 is retrieved ( l0 ), it has a range of -180 to 180 where we need a absolute ( "abs" - positive number only) as a percentage. 180 * 0.55555556 = 100.00000008, close enough, it is rounded in the print code %!d!%.
The full code of the percentage display - %(l0 0.555555556 * abs)%!d!%% %
Now we figure out if it's left or right.
Register s0 is retrieved again ( l0 ), it has a range of -180 to 180, we already know it can't be a zero, that was handled earlier, but we can check to see if it's greater or less than zero.
(l0 0 &gt;) - if it's greater than, then it's right trim, otherwise it's left. %{if}right%{else}left%{end}%
 
@Ed: that clears up one thing. I thought IO was ten

@ Roman: I think I follow that - the output is in percentage, not in degrees. So for the aileron trim where the full movement is 12.5 degreees either side of zero:-

%(l0 0.125 * abs)%!d!%% %

Yes? No?
 
No..
The value is taken from (L:RudderWheel, number). What you do with that value afterwards to command the +/- 12.5° trim will end up the same.
The L:var equals 180, you are commanding 12.5° both are at 100%
The L:var equals -180, you are commanding -12.5° both are at 100% ( of course with "abs" )
 
May I add that the Learning Center list a lot of TooltipID which can be used asis,
But also show the corresponding TooltipText from which you can easily derive most of what one needs,
the syntax being a real nightmare..

My two cents... and Mery Chrismas

Gérard
 
Back
Top