Displaying chance to learn spell with skills
Grammarsalad
Member Posts: 2,582
Hello,
I'm wondering if it is possible to display the mage's chance to learn spells (and no other int based stat) in the skills tab. I'd prefer to be able to do this with the mage only, but I'd be happy to just be able to do it.
I tried to model it after Lore. First I tried:
But, that just showed the intelligence value. I tried a few variations with worse results... Any help would be appreciated (even it the answer is that it just isn't possible)
Edit:
Okay, I added this:
This added all attribute bonuses to the skills screen (but with wonky text). I just need to exclude all of the entries I don't want...I don't know how to do that so far...
I'm wondering if it is possible to display the mage's chance to learn spells (and no other int based stat) in the skills tab. I'd prefer to be able to do this with the mage only, but I'd be happy to just be able to do it.
I tried to model it after Lore. First I tried:
elseif currentTab == 3 then listItems = { { characters[currentID].attr.int.strRef, characters[currentID].attr.int.current }, { characters[currentID].proficiencies.lore.strRef, characters[currentID].proficiencies.lore.current }, { characters[currentID].proficiencies.reputation.strRef, characters[currentID].proficiencies.reputation.current, characters[currentID].proficiencies.reputation.helpStrRef }, }
But, that just showed the intelligence value. I tried a few variations with worse results... Any help would be appreciated (even it the answer is that it just isn't possible)
Edit:
Okay, I added this:
for k, v in ipairs(characters[currentID].proficiencies.ability) do table.insert(listItems, {v.strRef, v.current}) end
This added all attribute bonuses to the skills screen (but with wonky text). I just need to exclude all of the entries I don't want...I don't know how to do that so far...
Post edited by Grammarsalad on
0
Comments
STR/DEX/CON values are always shown (the first 8 indexes).
Followed by the 3 INT values (highest level, max known, chance to learn), based on class.
Followed by CHA value (reaction).
Followed by WIS values (bonus spells), based on class and level.
A cleric will skip the INT values, and their bonus level 1 spell slots will occupy index 11, to avoid that check the strRef.
0xF0043E is the reserved StrRef for "Chance to Learn Spells".
You will end up with: The extra ":" at the beginning is because the two lists display things differently.
Thank you @kjeron . could I eliminate the extra ":" at the beginning if I remove lore and reputation? Ie:
Edit: I answered my own question. The answer is 'no'
Displays: Intelligence: Chance to Learn Spell: nn
That's not bad...
You're the best @kjeron !
Edit: Test: Works like a charm!!!!
Edit2: v[1], v[2], etc.: what do those represent? Are they different, um, ways to represent a list (e.g. <TEXT>":"<TEXT> vs <TEXT> (where in the 3rd instance, a ":" is already included in the text 'chunk'? Something like that?
Edit3: oh, duh, I see it in the code... Hey, learning! Cool!
God, it's so obvious when I see it...
"'^-'" means to separate text with a space, "': ' " means separate text with a colon... Edit: I'm not completely sure exactly what ^- means, but I get the basic idea...
"if (v[1] == '') then" if the first chunk/variable-def variable = "''"
@kjeron can you tell me how I can find these values? I accidentally displayed them on my character sheet--well, the values in decimal--but I didn't realize the significance and I don't remember how I did it...
The engine assigns StrRef (0xF00000 + row#) to mirror the string referenced for each row of that file (ignoring the 3 header rows).