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

Need help with grouped roll macro

1595561554

Edited 1595561818
Mago
Pro
Sheet Author
Hello I have this issue, cant seem to find a way to fix it. Im making a custom character sheet for FFG Rogue trader game and the problem is this: In the game some weapons have the "Tearing" quality and the way it works is, you roll two 1d10s and keep the highest to determine damage per hit. (the hits are determined in a separate check that is unrelated to this macro problem) using the grouped roll function it should work like this {1d10+1d10}dl1 Here is the full macro, now take into account that @{meleeweapondamage} most likely is not just a 1d10 but it also has bonuses. eg: 1d10+3 I also included a selector to give the player the option to select 1 or 2 hits that must be rolled separately but in the same macro to reduce time and improve order (some weapons can hit up to 10 times! we dont want to roll 10 separate times) &{template:default} {{name=TEST TEARING}} {{Tearing= ?{Hits|1Hit, [[ {@{meleeweapondamage}+1d10}dl1 ]] |2 Hits, [[{@{meleeweapondamage}+1d10}dl1]] [[{@{meleeweapondamage}+1d10}dl1]] }  }} THIS MACRO WORKS, when added as an ability in the attributes and abilities tab, BUT! it does NOT work when i add it to my custom sheet, the macro breaks like it was missing a " } " and i have no idea why. i tried replacing all characters with HTML code and it still doesnt work here is how it looks inside the HTML character sheet <div class="sheet-item" style="width: 20%;"><button name="roll_meleetearing" type="roll"  value="&{template:default} {{name=TEST TEARING}} {{Tearing= ?{Hits|1 Hit, [[ {@{meleeweapondamage}+1d10}dl1 ]] |2 Hits, [[{@{meleeweapondamage}+1d10}dl1]] [[{@{meleeweapondamage}+1d10}dl1]] }}}"> <label>Tearing Dice</label></button></div> In this case @{meleeweapondamage} is 1d10+3 it fails to execute, please help!
1595564026

Edited 1595564176
Oosh
Sheet Author
API Scripter
Edit - didn't read your post all the way, that it's HTML in a custom sheet. My post is probably irrelevant, sorry. I thought you'd moved it to Collections. The @{meleeweapondamage} is an Attribute call. Attributes only exist on character sheets, so you need to supply a character sheet name in the format of: @{bob|attribute} - specific character name, will always link to that sheet @{selected|attribute} - will use the attribute from the sheet linked to the currently selected token on the canvas. Fails if the token is not linked to a sheet, or no token selected @{target|attribute} - prompts you to click a token to grab the attribute, same limitation as selected - won't work on unlinked tokens @{attribute} - reads the attribute from the sheet the code is running on. This will not work from Collections macros as there is no sheet to reference. This is what you currently have, which is why it works from an Ability macro (it's on a character sheet) but not outside of it (the macro has no idea where to pull the Attribute from). Generally speaking, to make a universal macro, you probably want @{selected} calls. If it's character-specific, or only for a couple of characters, save it as an ability macro and use the @{attribute} as you were.
1595665787
Mago
Pro
Sheet Author
Thanks for the reply, sadly im trying to make this macro work inside the HTML of the sheet, the macro works just fine outside the sheet when added as an ability macro. should i post this in another forum section?
1595668570

Edited 1595670009
GiGs
Pro
Sheet Author
API Scripter
Keep it in this forum since you've already asked here. The html isnt the issue, its the roll thats the problem. It may look like your macro is working, but in my testing, it isnt. It always returns the meleeweapondamage, and ignores the dice roll in the result. The group roll isnt constructed properly. You have this (with html entities processed): {@{meleeweapondamage}+1d10}dl1 That's not a group roll - its a single roll, so you are confusing roll20 about what this roll is. If there should be a second die roll in there, change it to 1 Hit, [[ {@{meleeweapondamage}+1d10,@{meleeweapondamage}+1d10}dl1 ]] | or even better 1 Hit, [[ {1d10,1d10}dl1 + @{meleeweapondamage}]] | and it should work.