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

Token Action Magic with Hidden Fields

1407893013
Finderski
Pro
Sheet Author
Compendium Curator
So, I wanted to make things easier to create Token Actions from the Character Sheet I built. I had the brilliant (at least in my mind) to use a hidden field to store the same value as what's in the button tag. I tried this out on the key attributes (Agility, Smarts, etc) and even got it to work on the Unskilled and Fighting Skill (which are not part of the repeating skills, btw) and it worked flawlessly. I then replicated the exact same process with the repeating skills, using the format David S. mentioned in a previous thread (@{repeating_skills_0_<value}). Here's what the field looks like: <input type="hidden" name="attr_rollSkill" value="/em @{character_name} attempts to do something with @{SkillName} and rolls: [[{1d@{SkillNameRank}![@{SkillName}], 1d@{wilddie}![Wild Die]}kh1 + @{SkillNameMod}[Other Modifiers] + @{ttmod}[Modifiers] - @{wounds}[Wounds] - @{fatigue}[Fatigue]]]!"> I then created a macro on the character sheet: @{repeating_skills_0_rollSkill} I get this result: I can modify the macro by replacing rollSkill with SkillName and the output will be the value in the SkillName field. I can get each individual part to work, but not this one. Any ideas on why that is? I suppose can always make the macro manually since the formula is the same for all skills, but I was hoping for something a little simpler, more elegant. The macros for rollAgility, etc. are easy, they are a single line. But this one has me stumped... Thoughts? And thanks. :)
1407899788
Sam M.
Pro
Sheet Author
This is in a repeating section and can't be manipulated because it's hidden. Repeating fields don't store default values. Even if you could call it, it would break because the macro won't insert "repeating_skills_x_rollSkill" for each repeating attribute. The only way I could get around this was to create hard coded buttons for repeating sections.
1407900011
Finderski
Pro
Sheet Author
Compendium Curator
That's what I was afraid of... What character sheet is that for? I'd love to take a look at it. In the meantime, I've just copied the formula and put it in a textarea that can one can hide/unhide, and I updated the formula to show @{repeating_skills_0_*} and just noted that for each skill they'd have to increment the number. Thanks.
1407902523
Sam M.
Pro
Sheet Author
Pathfinder