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 .
×

[Coriolis Alternative] Parantheses in character name breaks sheet macros

Hey everyone! I'm the sheet author for Coriolis Alternative, a character sheet for Coriolis. I've gotten some reports from users that them having parantheses in their character names breaks the prayer mechanic (ability command button) in sheet macros for repeating items. It works perfectly fine for other objects (not repeating items). Would be very appreciative for any directions or help finding a fix. Thanks! Johan
1595522494
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Most likely, the best answer is to not use parentheses in character names. There are a number of characters that will break things in various parts of Roll20 and/or the API, not limited to any single character sheet. It's best to avoid anything that could be a "control characetr": ( ) { } [ ] , ' " ! @ # % & * I would suggest using something like Clark -Superman- Kent rather than  Clark (Superman) Kent
1595524827
GiGs
Pro
Sheet Author
API Scripter
Keith's advice is good as always. But if you post the prayer mechanic code we might spot an easy fix. (Unlikely, but worth a try.)
1595543372

Edited 1595543517
Spren
Sheet Author
I came across this same issue recently. I didn't find a perfect solution, but what I did was convert all of the characters in the name to html substitutes and store it is a new attribute I called "safeCharacterName". In the ability command button I use the safe name, everywhere else I use the regular character name. The main issue I encountered is that the default character_name attribute is not one that fires an "on:change" event, so how do you update it when a player changes their name? Short answer is you can't. So for now I just use a "on:sheet open" event. I don't love the solution but it works for now. If you find a better solution, let me know.
1595546220
Finderski
Pro
Sheet Author
Compendium Curator
I'd be interested in seeing your code, too, because I just tried it with one of my sheets and I didn't have a problem.  But then I have all the tags in a hidden field and the roll button's value references that field...don't know why that would matter, but... The top roll is with the roll button from the character sheet and the bottom one is with the Re-Roll Damage ability command button.
1595546489
Spren
Sheet Author
Can you actually click the button and it roll properly Finderski? Just checking because with mine the template would look fine, but the roll would output part of the macro as text.
1595551846

Edited 1595551873
Finderski
Pro
Sheet Author
Compendium Curator
Spren said: Can you actually click the button and it roll properly Finderski? Just checking because with mine the template would look fine, but the roll would output part of the macro as text. Yep. That bottom roll is actually from clicking the Re-Roll Damage button displayed in the roll template, not from clicking the button on the character sheet.
1595553330
Spren
Sheet Author
Cool, I'll have to take a look at what you did. I'd much prefer that to my solution.
1595553881
Finderski
Pro
Sheet Author
Compendium Curator
Here's how my main button is done... <button class="sheet-traitbutton sheet-traitflexattbutton" type='roll' name='roll_tAgilityRoll' title="@{tAgilityRoll}" value='@{agilitybutton} @{unshakeTemplate}'> <span data-i18n="agility">Agility</span></button> <input type="hidden" name="attr_agilitybutton" value="@{whisperagility} &{template:roll} @{rolltAgility} @{setmodsenc} @{showtraitmods}" /> The rolltAgility has most of the template stuff in it, because that all specific to the Agility roll, the other attribtutes are done that way so I have a common place update those particular roll template bits, if I ever need to.
1595554073
Finderski
Pro
Sheet Author
Compendium Curator
Should have included this above...weapon damage is done slightly differently... <button type='roll' class="sheet-weaponItem sheet-button" name='roll_tWeapon' value="@{weaponroll}"><input type="hidden" name="attr_weaponbutton" class="sheet-weaponbutton" value="1" /><span class="sheet-buttonand" data-i18n="attack-and-damage-abbr">Atk+Dmg</span><span class="sheet-buttondo" data-i18n="damage">Damage</span><span class="sheet-buttonma" data-i18n="multi-attack-and-damage-abbr">Atk<sup>x</sup>+Dmg</span></button> <button type='roll' class='sheet-hiddenButton' name='roll_dmg' value='@{damageOnly}'></button> <button type='roll' class='sheet-hiddenButton' name='roll_weaponsbonusDamage' value='&{template:bonusDamage} {{dieType=@{weaponsbdt}}} {{bonusDamage=[[@{vbonusdamage}!]]}}'></button> Because the main weapon button can be configured to make the attack (i.e. skill) roll AND the damage roll, and because damage can be re-rolled, I need to make a couple hidden buttons so that I could have ability command buttons in the template, so only the first button is visible, the other two buttons are hidden.
Wow, thanks for the input all! I will add a readme section asking people to stay away from special characters in the title for the next sheet merge and look into some of the solutions posted here!