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

Calling a macro inside a fieldset

1752963319
Falcon
Pro
Sheet Author
I couldn't find a related topic on this.  But I get the following error when I try to call a macro inside a fieldset: ODmvQW4sfRpSCcDBorh|repeating_meleeweapon_-OEo9JsiEk4fXijiHMtc_ The fieldset is meleeweapon.  The macro is: {{[Jinx Redraw](~jinx_redraw)=**[Fortify Redraw](~fortify_redraw)**}} Both the Jinx and Fortify buttons are global buttons (sitting outside the repeatable fieldsets) and it works find when not in a repeatable section. Is this a known issue?  Is there a way around it.
What game are you playing and which character sheet is being used for the game? E.g. Playing D&D 5th Edition using the "D&D 5E 2024 by Roll20" character sheet, or something else?
1752981876
Falcon
Pro
Sheet Author
This is my own game and character sheet.
1752990771

Edited 1752990783
Falcon
Pro
Sheet Author
It's clear that the roll macro is not going outside the repeatable section to look for macros.  Its stating that it can't find the macro within the repeatable section.  I have even included the buttons inside the repeatable section and it still did not work.  So - is there a different way to put in the macro when selecting a button (roll) macro outside of the repeatable section?
1753154855
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Try adding the character name to the macro buttons. The shorthand can be finicky. Eg: {{[Jinx Redraw](~john smith|jinx_redraw)=**[Fortify Redraw](~john smith|fortify_redraw)**}}
1753202408
Falcon
Pro
Sheet Author
Thanks Scott.  if this is inside a character sheet designed would I do  {{[Jinx Redraw](~character_name|jinx_redraw)=**[Fortify Redraw](~character_name|fortify_redraw)**}}
1753203548

Edited 1753203616
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ah, if this is a macro that the sheet is just providing, you'll need a sheetworker to either 1) update an attribute that holds the macro whenever the character name changes or 2) use custom roll parsing to dynamically create the chat output at roll time. I'd recommend the CRP route, but I have used both methods in sheets I've made. The CRP method would look something like: HTML <fieldset class="repeating_meleeweapon"> <!-- You're repeating row code minus your current roll button--> <button type="action" name="act_menu">Output Menu</button> </fieldset> Sheetworker on('clicked:repeating_meleeweapon:menu',(event) => { const [,section,rowID,buttonName] = event.sourceAttribute.match(/(repeating_.+?)_(.+?)_(.+)/); // get any attributes we need // note the async tag so that we can wait for the result of startRoll getAttrs(['character-name','list of attributes to get'], async (attributes) => { // This is basic output of what you showed. I'm assuming you have other content that should be output in this roll as well. // You'll want to get any attributes you need for calculations or rolls in the getAttrs and then assemble the macro output. const rollText = `&{template:default} {{[Jinx Redraw](~${attributes.character_name}|jinx_redraw)=**[Fortify Redraw](~${attributes.character_name}|fortify_redraw)**}}` const roll = await startRoll(rollText); finishRoll(roll.id); }) })
You could change the macro to {{[Jinx Redraw](~@{character_id}|jinx_redraw)=**[Fortify Redraw](~@{character_id}|fortify_redraw)**}} That should work for any character without having to involve a sheetworker or CRP.
1753208176

Edited 1753208220
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Huh, that didn't used to work, but it looks like Roll20 fixed it at some point. So, yeah, you could just do a roll button: <button type="roll" name="menu" value="&{template:default} {{[Jinx Redraw](~@{character_id}|jinx_redraw)=**[Fortify Redraw](~@{character_id}|fortify_redraw)**}}">Menu</button> Now that I know that works, I need to go change how the K-scaffold handles draggable action buttons to make it simpler.
1753231318
Falcon
Pro
Sheet Author
Thank you both.  Yeah - RainbowEncoder that worked!!  This really helped me!!
1753231944
Falcon
Pro
Sheet Author
Hey Scott - is it difficult to create a compendium?  I want to create one for the game.
1753243280
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Compendium creation is a complex topic. In order to create a compendium for a game, you need to be the publisher of the game (or working on behalf of the publisher). You'd then follow the instructions for becoming a marketplace creator and talk to Roll20 about creating the compendium. Once you have the approvals, it's just data entry.