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

D&D 5e character sheet's repeating parts: spellcomp_v, spellcomp_s, etc.

1725648052

Edited 1725648093
Hello! I am having some trouble checking the value of attributes like Repeating_spell-X_YYY_spellcomp_v I have made a script like so, to test it out: var attributeName = name.replace("spellname", types[Ti]); var attribute = findObjs({ type:'attribute', characterid: character.id, name:attributeName})[0]; var data = ""; if (attribute) data = attribute.get('current'); output += "{{" + attributeName +"="+data+"}}"; Output is a nice template, which makes the command give me this within: Repeating_spell-3_-O62mzXx3dAEBKmsHq0r_spellcomp_v = 0 If the "V" component of my spell is not checked. If I do check the "V" component of the spell, all I get is just the header of the template. Nevermind what other data I have (initially I had the data of all types of spell info, just the "toggles" broke them). Therefer I'd like to know how to check and save their values? When I try setting the 'current' to TRUE, 1, "1" it just resets it. I have the same problems with toggling the ritual tag or concentration on the spell. When I tried getting "typeof" of attribuge.get('current') it's almost always a string (only the current DC is int), so it's of no help. Any help would be appreciated!
The repeating spell component values are not ‘0’ and ‘1’. The values are ‘0’ and  '{{v=1}}' (for verbal components. You need the correct values for when it is toggled “on”.  You can find the correct values by using a character that has a spell with them all checked on and use the attribute calls such as: @{selected|repeating_spell-cantrip_$0_spellcomp_v} Then you should be able to collect them all for use in your script. 
Hey! Thanks for the quick answer. After I published this question I turned off roll20 hoping for somebody like you to help but then i just COULDN'T STAND IT so I tried again and actually did what you just said and came to the conclusion, that my making the output pretty make the thing break - because of the {{ }}. In any case, thanks a lot for help, I missed the part that it's v=1 or s=1 depending on the attribute, so that is very helpful. Cheers!