Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
Create a free account

[Script] MonsterHitDice Issue - solved

Just posting this here for anyone else who runs into this problem in the future.  I have several seemingly random NPCs where MonsterHitDice doesn't seem to work for some reason. I finally pinned it down to this: " The default token for the character needs to represent that creature but should not have the bar used for hit points linked to an attribute. "  And I was thinking... I have the Bar1 link set to 'None', so why isn't this working? I was using TokenMod to set up all my tokens, including this: 'bar1_link|None', which unfortunately sets the linked bar correctly to not be linked to anything, but still sets some 'value' even though it's the same as what appears to be a 'null' link, so MonsterHitDice reads it as a 'linked bar', and doesn't work. But  using'bar1_link| ' correctly sets a null value, and !mhd will work as expected.
Its a trap has this same bug in the sound option.  If you delete the sound the trap was going to play, it crashes the sandbox, if you then set that traps sound option to "None" it tries to play "None" and crashes still.  
The Aaron
Forum Champion
API Scripter
Hmmm.  I'm going to have to try and duplicate this and see about getting a patch in on or both scripts.
The Aaron said: Hmmm.  I'm going to have to try and duplicate this and see about getting a patch in on or both scripts. I have a feeling it has more to do with how Roll20 processes or evaluates 'null' character sheet attributes. Being set to 'none' doesn't seem to be the same as actually setting a 'null' or blank value, similar to how using TokenMod to set the 'default token' on a character sheet doesn't retain the Bar Location and Style settings the same way manually saving the 'default token' does. But if anyone is able to figure out a patch I'm sure it's you! :). For now a simple workaround is to use a blank attribute instead of 'None' when setting a bar_link in TokenMod.  So a quick add to the help section of TokenMod and MonsterHitDice would hopefully prevent others from having the same issue in the meantime.
For its a trap my solution is to just delete the trap token with the deleted sound and make a new one that never had a sound setup.