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 .
×
May your rolls be chill this holiday season!
Create a free account

Linking Macros to ablilities with rolls.

1574613284

Edited 1574613499
Hi there, having some problems with refering to an ability in a character that rolls. (This is for auto rolling loot tables btw) I made a character called "MacroCharacter" and gave it an ability: Name:%copperroll5-10 Macro:&{template:default} {{Copper=[[4d6*100]]}} I have referenced the above ability within this. /w gm&{template:default} {{name=Loot}} {{[[1t[coin-type]]]}} {{[CP](!
%{MacroCharacter|%copperroll5-10} ) etc..... My problem is whenever "%copperroll5-10" has any sort of roll within the macro it breaks everything. I can type text and it works fine but not for rolls.(Works when refering to a normal macro instead of ability also) The only thing that shows up is the top of the template box that says "Loot" and nothing else. Plz help.
1574614174
Kraynic
Pro
Sheet Author
What happens if you remove the % from the name of your macro, and just have it as copperroll5-10?  I'm not sure having that character in there is good.  You might want to change the dash to an underscore too, but I'm not sure (and I'm not at a place where I can test if that is a problem).
Kraynic said: What happens if you remove the % from the name of your macro, and just have it as copperroll5-10?  I'm not sure having that character in there is good.  You might want to change the dash to an underscore too, but I'm not sure (and I'm not at a place where I can test if that is a problem). Tried and doesn't change anything. Its very weird because the macro executes fine when there is only text in the macro.
1574614740

Edited 1574614773
Kraynic said: What happens if you remove the % from the name of your macro, and just have it as copperroll5-10?  I'm not sure having that character in there is good.  You might want to change the dash to an underscore too, but I'm not sure (and I'm not at a place where I can test if that is a problem). &{template:default} {{Copper=[[4d6*100]]}} <can you spot anything the macro that would be conflicting with the macro nesting? or the template or something?
1574617931
Kraynic
Pro
Sheet Author
Might be best if you post your whole final macro.  Maybe there is something else (hopefully fairly simple) that is interfering.
1574617943

Edited 1574618143
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You are working too hard. :) You don't need all of that html replacement, for instance, and the reference for a sheet ability in a command button is much simpler. Try this: /w gm&{template:default} {{name=Loot}} {{[CP](~MacroCharacter|%copperroll5-10)}} I took out the table reference for quicker testing, but you can easily put it back in.
1574618105
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'd second Kraynic's suggestion by the way. The "%" is not causing any problem in your macro name, but as you write more and roe complex macros, it can lead to confusion, and perhaps actual problems. I'd avoid using the reserved symbols !,@,#,%, &. In fact, any of the keyboard-shifted number characters.
keithcurtis said: You are working too hard. :) You don't need all of that html replacement, for instance, and the reference for a sheet ability in a command button is much simpler. Try this: /w gm&{template:default} {{name=Loot}} {{[CP](~MacroCharacter|%copperroll5-10)}} I took out the table reference for quicker testing, but you can easily put it back in. Ok this works, i was working origionally from a tutorial that had the html replacement code in so i just left it because i didn't want to fuck anything up. Thanks.
1574626247
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Completely understandable. It's tricky. HTML replacements are mostly needed when including nested macros in dropdowns and roll templates. A macro (in the collections tab) will resolve those when you save it, which is undesirable to say the least, as you will need to re-replace them when you edit. Abilities (macros on a character sheet) will not resolve the html replacements. They also don't need them nearly as much as the references to other abilities is much simpler. Referencing a macro form an ability still requires a bit of html trickery, but thankfully it stays intact past an edit. Dropdowns that reference macros or abilities should be avoided unless they are very simple, or you have a very strong grasp of when they are needed and why. They make my eyes water, so I tend to avoid them whenever possible. There is more information about how to format different macro and ability calls in a chat menu  here , the advantages of a macro sheet here , and when and why to use replacements here .