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 .
Advertisement Create a free account

[Help] DCC Helper Script Modification

I need a change to the DCC Helper Script, found here: <a href="" rel="nofollow"></a> The original author (Sturtus: <a href="" rel="nofollow"></a>) hasn't posted on Roll20 in the better part of a year, which makes me think he's not active here any more. The problem is that the !deed api script errors out (seems to cause an infinite loop) if the DeedDie character attribute is d0, as it is with any DCC class that isn't a Warrior, Dwarf, Ranger or Paladin. This prevents you from using this script as a generic Attack script associated with the attack buttons on the DCC Character Sheet (found here: <a href="" rel="nofollow"></a>... I'm not using the standard DCC Character Sheet in the Roll20 because of other changes I've wanted to make to it. Can anyone help? I'm just a raw beginner when it comes to HTML/CSS/Javascript. Thanks.
The Aaron
Forum Champion
API Scripter
Can you give an example of the command that causes it to crash?
!deed CharName|dmgDie|atk1,atk2,...|dmg1,dmg2,...|(Normal|Mighty|Smite)|(crit) Is the author's syntax for the command. For the specific button the character sheet, this turns into: !deed @{character_name}|@{WeaponDmg}|@{WeaponAtk},@{ATK},@{STR}|@{STR}|?{Attack Type?|Normal,Normal|Mighty,Mighty|Smite,Smite}|@{WarriorThreat} @{character_name} is obviously the name of the character. @{WeaponDmg} is pulled from the repeating table, and is usually something like 1d8. @{WeaponAtk} is a weapon-specific attack bonus taken from the repeating weapons table, for instance +1 for a magic +1 sword. @{ATK} is the class-based attack bonus. This applies only for non-(Warriors/Dwarves/Rangers/Paladins). It will be zero for these fighting classes. Warriors/Dwarves/Rangers/Paladins instead use a "Deed Die" (which doesn't explicitly show in the command, but is used in the script), which can range from d0 (this is the default for non-fighting classes) up through 1d10+4. @{STR} is the attack or damage bonus for melee weapons due to character Strength, in the range of -3 to +3. @{WarriorThreat} is the critical threat range for Warriors. It defaults to 20 (on 1d20), but for Warriors it can go as low as 17 (to 20). (Normal|Mighty|Smite) is the type of attack being rolled by the script. Anyone can do a Normal attack, Mighty is restricted to Warriors, Dwarves and Rangers, Smite is restricted to Paladins. So when the script pulls this together, it should look something like this: !deed Bob|1d8|0,0,1|1|Normal|20, but additionally the script is pulling the DeedDie attribute from the character sheet, with a value of d0 that causes a problem.