How to access blue text of a skill?

Is there a scriptwise method of accessing a skill's blue text? For instance, given $skill[Knees], I'd like to get "Weapon Damage +13".

I'm actually only interested in the Gelatinous Noob skills, ie. passives with a single line of blue text that's always a numeric modifiers, so I suppose I could do:
Code:
foreach modifier in [a list of modifiers] {
if(numeric_modifier($skill[sk], modifier) > 0)
return "" + numeric_modifier($skill[sk], modifier) + " " + modifier;
}
... but that requires extra numeric formatting to reconstruct the blue text, and will put the numeric value out-of-order with the modifier name half the time, and is just generally a lot more work than the alternative that I'm sure must exist.

Thanks for the help!
 

heeheehee

Developer
Staff member
string_modifier(sk, "Modifiers") will give you Mafia's list of (unevaluated) modifiers for that skill. This seems roughly like what you want.
 

Bale

Minion
You'd probably want to use string_modifier(sk, "Evaluated Modifiers"). The "Modifiers" keyword will show you formulae for modifiers that are complex. "Evaluated Modifiers" will calculate those modifiers based on the characters current condition.


... but that requires extra numeric formatting to reconstruct the blue text, and will put the numeric value out-of-order with the modifier name half the time, and is just generally a lot more work than the alternative that I'm sure must exist.

It does require a bit of formatting to make the string_modifier() look pretty, but I've already done that work for ChIT and it was copied by ckb's WTF scripts sick ckb liked it so much. I don't mind if you copy it also. If you've got ChIT installed on your system, check out chit_global.ash parseMods() which is called with the results of string_modifier().
 
Many thanks to you both! heeheehee's solution is elegantly simple, and Bale, I'll explore yours for the additional benefits, too.
 
Top