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 .
×

New to roll20 and Macros

Hi. Im DMing my first campaign on Roll20 tomorrow. Im trying to learn and set up a few Macros. The ones Im trying to use is from here - <a href="https://gist.github.com/Erreinion/df870538022c501e8a9862c11558e0a6" rel="nofollow">https://gist.github.com/Erreinion/df870538022c501e8a9862c11558e0a6</a> My problem is that when using the&nbsp; /w gm #raw-actions &amp;{noerror} command/line it works with "Test Macro" but now when I use it from "Bar" or "Token Action". How come? What am I missing :p Thanks for any enlightenment!
1580491967
GiGs
Pro
Sheet Author
API Scripter
Does your macro name have spaces or any weird characters in it? What is it called?
Hi. Thanks for answering. I got one named: 04-NPC-Action /w gm @{selected|wtype}&amp;{template:default} {{name=@{selected|character_name} Actions}} {{ Actions= [@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) [@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) [@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) [@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action) }} /w gm #raw-actions &amp;{noerror} Im guessing i gotta do something with the "/w gm #raw-actions &amp;{noerror}". Have tried making a&nbsp; Im do not know any form for code. From the github page where I found the macro. "Strategy: set up a raw macro that does the work and then call the macro from a wrapper that can do error handling." How do I call "the" macro from a wrapper?
1580497448
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this: /w gm @{selected|wtype}&amp;{template:default} {{name=@{selected|character_name} Actions}} {{ Actions= [@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) [@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) [@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) [@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action) }} &amp;{noerror} /w gm #raw-actions&nbsp; You can't put a whisper command in the middle of a line.
1580503157

Edited 1580503199
That doesn't do any thing. Still get the errors when I use it "In Bar" but when using the "Test Macro" while making it does not give me any error, as you can see on the last command in the picture.
1580504593

Edited 1580504786
GiGs
Pro
Sheet Author
API Scripter
Firstly does your npcactions section have at least 4 items in it? you'll get the errors above if you only have one item. Also have you created a macro by the name of raw-traits ? Looking at the page you linked, this macro&nbsp; /w gm @{selected|wtype}&amp;{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$0_name}}} {{description=@{selected|repeating_npctrait_$0_desc}}} /w gm @{selected|wtype}&amp;{template:npcaction} {{rname=@{selected|repeating_npctrait_$1_name}}} {{description=@{selected|repeating_npctrait_$1_desc}}} /w gm @{selected|wtype}&amp;{template:npcaction} {{rname=@{selected|repeating_npctrait_$2_name}}} {{description=@{selected|repeating_npctrait_$2_desc}}} /w gm @{selected|wtype}&amp;{template:npcaction} {{rname=@{selected|repeating_npctrait_$3_name}}} {{description=@{selected|repeating_npctrait_$3_desc}}} is expected to be named raw-traits . This macro&nbsp; /w gm #raw-traits &amp;{noerror} is simply a way to call that same macro and suppress the errors seen above. You should not have that last line inside the raw-traits macro, that'll definitely cause errors. If you call the first section raw-traits , and then create another macro, called lets say, raw-traits-noerrors , and make it just this /w gm #raw-traits &amp;{noerror} it should hopefully work. I dont use that sheet so cant say if it will work, but its worth try. If it doesnt work, you might need to add&nbsp; &amp;{noerror} &nbsp;to the end of each row of the first macro.
1580505861

Edited 1580505935
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
AFAIK, &amp;{noerror} is only meant to be used in-line with a roll template. I'm not sure it will work appended to a macro call. Can you post the code for #raw-actions?
1580507242
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This seems to work for me: 04-NPC-Action /w gm @{selected|wtype}&amp;{template:default} {{name=@{selected|character_name} Actions}} {{ Actions= [@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) [@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) [@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) [@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action) }} &amp;{noerror} called by: Actions /w gm #04-NPC-Action &amp;{noerror} Output, from clicking the button:
1580507332

Edited 1580507854
@GiGs: Thanks that did it. Had to open the macro with another macro. Thus the names had to be 100%. @ Keithcurtis: Check out the added picture. Is it possible to make the Trait macro look like the Actions one with buttons? Have tried editing it but not with any luck... Guessing I gotta remove the last /w gm's and change the template maybe? Thanks! Edit: I removed the &amp;{noerror} from raw-traits. That code only works when I use the "Test Macro" Button.
1580528440
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Unfortunately, Traits do not have an associated display macro You would need to make a macro to display each one, and then call each of those in their own chat menu buttons. There are some API scripts that will do this automatically, but those require a Pro subscription.