View Full Version : Castles & Crusades - AbilityScore question
Varsuuk
April 2nd, 2018, 23:13
When doing my ruleset attempt, I was borrowing concepts from AD&D and C&C as I tried to write a new ruleset in order to learn how stuff gets done.
I come across this and decided to use a variation of it for my Attributes:
<number_charabilityscore name="strength" source="abilities.strength.score">
<anchored to="abilityframe" position="insidetopleft" offset="100,25" />
<description textres="char_tooltip_str" />
</number_charabilityscore>
<string_charabilitylabel name="strength_label">
<anchored to="strength" />
<static textres="strength" />
The area I was wondering about was how <description> tags gets use IF it does. I tried hovering over the Ability Score box but nothing pops up. What is this for? I tried searching C&C/Core for uses of <character> tag but I probably didn't look everywhere. No luck on anything in lua/script that seems to use it to display something.
Now, the label itself, that DOES display that tooltip - but it is evidently getting this from <number_charabilityscore name-"strength"><description> but not sure how?
Talyn? Anyone?
(I was doing it the same way but my labels being different didn't display the text. I traced to Label to StringControl but still haven't seen how it goes into play. Was gonna look more but dinner and son's prepping calls :(
Trenloe
April 3rd, 2018, 00:37
Trace the template through to the base control used by FG. You'll need to "Find in files" in both the C&C and the CoreRPG ruleset. Search for number_charabilityscore - find the template for this and then work back through the various template definitions to the base FG control.
In this case you will find it is numberfield which inherits numbercontrol - info here: https://www.fantasygrounds.com/refdoc/numbercontrol.xcp
The "Definition" section of this page defines <description> - The string used as the description of a data drag. If no child tags or attributes defined, the enclosed text will be used.
Varsuuk
April 3rd, 2018, 01:37
Thanks Trenloe - I didn't understand what is meant by that description. Probably because haven't yet gotten to messing around with drop source or targets?
When testing C&C, I simply moved my mouse (no click or drag) over the word "Strength" and the <description> tag resource info pops up. IS that the "data drag" concept? If so, how does it differ from a "tooltip"?
What is bugging me out though is that the TOOLTIP appears when my cursor was over the ability label (which doesn't have the description tag) - in the picture my cursor is like over G in strength - not anywhere over the number field control (where the tag is defined)
It is probably me not being able to express myself, I do somewhat better on chat ;) but am confused here.
22838
Trenloe
April 3rd, 2018, 02:57
When testing C&C, I simply moved my mouse (no click or drag) over the word "Strength" and the <description> tag resource info pops up.
The <description> text resource does *not* pop up as a tooltip. Search for the string resource (https://www.fantasygrounds.com/refdoc/string.xcp) char_tooltip_str in the C&C ruleset and you'll see it is different to the tooltip you show in your screenshot.
IS that the "data drag" concept? If so, how does it differ from a "tooltip"?
Nope a tooltip has nothing to do with dragdata. Info on dragdata here: https://www.fantasygrounds.com/refdoc/dragdata.xcp Start dragging a strength score value - what do you see? Text that corresponds to the string resource value (char_tooltip_str) of the <description> field.
What is bugging me out though is that the TOOLTIP appears when my cursor was over the ability label (which doesn't have the description tag) - in the picture my cursor is like over G in strength - not anywhere over the number field control (where the tag is defined)
Yes, because <description> is not a tooltip.
Recommendation - follow things completely to their end values. In this case - find the actual value of the text (string) resources specified in a control - don't assume anything - look for the actual value.
Varsuuk
April 3rd, 2018, 03:33
I TOTALLY see it now.
Of course, I am now on my desktop instead of my 15" non-retina macbook with the non-53-yo-friendly letter size. (I REALLY want to get a lighter longer lasting battery macbook this Fall - scared though that have to go 15" because the great light 13" even if get upgraded to retina this year will be too hard on eyes or not enough real estate for showing 2 sources side by side in Netbeans/XCode/Eclipse (I do coding in C++/refreshing Java since work is now also using that/learning Swift) but an issue for another day...)
And I am trying to reos my son's PC to my left (birthday gift, now installing tons of stuff from old HDs) and moving off wife's backups on his seconddary drive to lame OneDrive (slow as hell with that much, esp while Steam downloading going on) and being distracted by said kid wondering how much longer... :)
Oh, and yeah - I have my own *SQUIRREL!* attention issues.
I'm sorry, will be more careful - upon relook it was OBVIOUS that I interpreted what it I thought it SHOULD be - not what it was. My Macbook BURNS my lap when running FG, so I tend to scan and look at files and only load the ruleset when I MUST or am testing my ruleset. It's a PRO with an nVidia geforcewhatever - total waste I bought that add on as I stopped playing games on it and used exclusively for coding like 2 months after buying it.
Did I mention fan and burning heat when running FG - someone mentioned it was because it cannot employ the macos code and it autoswitches to discrete vid card when in Wine. Which is another worry as I want to buy one WITHOUT discrete card for these reasons and Pros I think NOW come with them in all builds. And no 15" Airs. *SQUIRREL* ... right....
So, now that dragged it I SEE what you mean. I was totally off base :( I don't actually care about tooltips, was just tryign to get it working. So now will use what got and will look about bells and whistles later ;)
No real excuse... the above was embarrassed rambling. You are too kind Trenloe, thanks for pointing this all out.
damned
April 3rd, 2018, 04:29
Trying turning OFF Linux/Mac compatibility - it my not work for you but if it does it will use way less CPU and generate way less heat.
Varsuuk
April 3rd, 2018, 06:43
Hmmm!!! As I type, I just hit enter on turning that off and my fan is dying down! No clue what that option is for but it just became near silent and FG is on in background - any chance we can get any intel on what that functionality is? Cos wow, this may make a huge difference for me. I was going to avoid a discrete GPU specifically for this at all costs (so kudos on how much I value running FG on all my machines lol)
22841
--> In the above, I hovered over the numeric box, but same tooltip is set in the lebel hover - wanted to compare them - only going to keep one.
So, I read through all the family tree and now grok the whole drag/description thing as well as the qindowcontrol aspects to tooltip. Left with a choice between putting the tooltip on the label with the by-needs shortening of the instruction or the numeric input control where the data goes.
If you have tips whether specific to this scenario or a general rule of thumb you always apply, I'd love to hear them.
In this case, I lean towards label because it is an "expansion" of the text in the label. The negative to me is that the user may not easily/accidentally hover over the label to find this expanded text as one usually expects tooltips in the controls. But putting int he control, where a tooltip really belongs (I think) is slightly problematic because it pops up perhaps as you are typing info (which is NOT an issue for these controls as they will be for displaying data only when done) and also because over the life of FG play - one may use the input box a lot and eventually be annoyed by a regular popup of obvious info where the label popup can be easily avoided once you know what it is.
Thoughts?
PS -> Fan is STILL off all this time!
damned
April 3rd, 2018, 11:20
The compatibility mode forces the screen to redraw more often - hence more cpu load...
Many mac/linux installs dont need it - some do...
Varsuuk
April 3rd, 2018, 16:25
It’s been a godsend to my legs since turned it off. Thank you, god Damned!
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.