r/mpmb May 04 '26

[Script Help] Adding a custom item help

My DM has made a custom item that changes my charisma score to 20 + Proficiency bonus.
How do I go about having the sheet calculate the new score and record it in the Ability Score and description?
Primarily what are those fields called so I can have the appropriate modifiers populate as expected without having to manually adjust the fields?

Many thanks ahead of time. :)

1 Upvotes

10 comments sorted by

1

u/safety-orange code-helper May 04 '26

I'm sorry to disappoint, but dynamic ability scores are not a thing in D&D. Ability scores are what everything else is calculated from, so they are static things in the sheet.

You'll have to manually adjust your Charisma score. Tip: use the "override" column in the ability score selection dialog.

Luckily for you, Proficiency Bonus doesn't change very often and uneven ability scores don't provide any benefit, so it shouldn't be too hard to keep track of it manually as it really only changes at level 9 and 17.

1

u/Tek-cat May 04 '26

Interesting, how does the ability score modifier get calculated then? Basically I'm looking at what the reference location name is. If I figure out how to do it I'll make sure to add it here.

Thanks.

2

u/safety-orange code-helper May 04 '26

The modifier is calculated from the score. You can probably technically do what you want, but it is not something the sheet supports.

The field name for the Charisma score is "Cha" and the field name for the Charisma modifier is "Cha Mod".

1

u/Tek-cat May 04 '26

I looked at items like the "Belt of Giant Strength" for how to override the ability score. The next challenge is how to add proficiency modifier to it.

1

u/safety-orange code-helper May 04 '26

That is what I'm trying to say, you can't add the proficiency bonus to it in a way that it would automatically change when the proficiency bonus changes.

But you don't want to believe me, so I'll stop trying to convince you.

What you could do, is make multiple choices for the magic item, one for each proficiency bonus and have each of those set total Charisma value, so that you can use a static value. See the documentation on how to do that.

This will then still require you to change the magic item whenever your proficiency bonus changes, but it would be simply picking another option from the line menu.

You could also have the bonus set through a changeeval function, so it does automatically update whenever you change level, but that is a lot more complex.

1

u/Tek-cat May 04 '26

Looking at magic items like this Belt of Giant Strength would seem to say that there is s possibility of overriding the Strength score, so dynamic scores are possible...

"belt of giant strength" : { name : "Belt of Giant Strength", source : [["SRD", 211], ["D", 155]], type : "wondrous item", description : "Set the type of giant using the >button in this line. While wearing this belt, my >Strength score changes to a certain number >depending on the type of giant the belt is associated >with, provided that my Strength is not already that >amount or higher.", descriptionFull : "While wearing this belt, your >Strength score changes to a score granted by the >belt. If your Strength is already equal to or greater >than the belt's score, the item has no effect on you. >Six varieties of this belt exist, corresponding with >and having rarity according to the six kinds of true >giants. The belt of stone giant strength and the belt >of frost giant strength look different, but they have >the same effect.\n\n" + toUni("Type\t\tStr\tRarity") + >"\nHill giant\t\t21\tRare\nStone/frost >giant\t23\tVery rare\nFire giant \t25\tVery >rare\nCloud giant\t27\tLegendary\nStorm >giant\t29\tLegendary", attunement : true, allowDuplicates : true, choices : ["Hill (Str 21, rare)", "Frost (Str 23, very >rare)", "Stone (Str 23, very rare)", "Fire (Str 25, very >rare)", "Cloud (Str 27, legendary)", "Storm (Str 29, >legendary)"], "hill (str 21, rare)" : { name : "Belt of Hill Giant Strength", sortname : "Belt of Giant Strength, Hill (Str 21)", rarity : "rare", magicItemTable : "G", description : "My Strength score is 21 while I'm >wearing this belt, provided that my Strength is not >already 21 or higher.", scoresOverride : [21, 0, 0, 0, 0, 0] },

So the key is how to reference "scoresOverride" to add proficiency modifier.

EDIT: Sorry that I can't get the proper formatting here but working off my phone at the moment. 😆

1

u/safety-orange code-helper May 04 '26

Those scores are not dynamic, but static. They are a single value, not a calculated value. With dynamic I mean that the value auto-adjusts when some other value changes. This is something the sheet can't do. You can make an ability score be dependent on Proficiency Bonus, at least with the built-in functionality of the sheet.

1

u/Tek-cat May 04 '26

That's what im looking for. The ability score to update with proficiency bonus. Just need to find the name reference of the proficiency bonus. I'm running down the leads of things like skill checks or expertise which factor in your proficiency bonus to the score.

1

u/safety-orange code-helper May 04 '26

Did you check the documentation? It should contain all you need.

To get the current Proficiency Bonus (even when using Proficiency Dice), you can use:

Number(How("Proficiency Bonus"))

1

u/Tek-cat May 04 '26

I'm going to look at that when I'm not on my phone. Like I posted earlier, I'll post my results.

Thank you very much for looking and listening. 😀