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

Trying To make a multiple choice attack macro...

Hello all, I'm still learning how this all works but I'm trying to create a macro for my players where they click attack they pick a target for the attack then gives them a drop down menu of the weapons they could use for this. It will roll the attack the damage. So far I have the following. /em strikes out at @{target|foe|npc_name}! ?{Which Weapon Do you want to use|Great-Ax, #greatax|Dagger|Heavy Xbow|Hand Xbow} the #greatax macro is just a copy paste of the character sheet attack roll. Could I just call the attack macro the same way it works on NPC sheets with %{selected|repeating_npcaction_$1_npc_action}?
1475480319

Edited 1475480482
So I have this that works, but I can't figure out how to get the two options nested as a drop down. Great Ax attack <code>/em strikes out at @{target|foe|npc_name}!@{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 5[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} ammo= @{Vargan Tuskbeard|charname_output} VS @{target|foe|npc_AC} AC Hvy Xbow Attack /em strikes out at @{target|foe|npc_name}! @{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Heavy Crossbow}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=100/400}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + 5[STR]]]}} {{dmg1type=Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d10[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}   ammo= @{Vargan Tuskbeard|charname_output} VS @{target|foe|npc_AC} AC
1475481659
Andrew C
Marketplace Creator
Each template is a new "result" for the Macro. ?{Which weapon?|Axe, #axemacro|Knife, #knifemacro|Rubber Chicken, #rubberchickenmacro|...} Then you also need to HTML substitute your right-braces so that the drop-down box doesn't have a fit. Then you replace each weapon macro in # form with the full HTML substituted Roll Template.
1475483998

Edited 1475485273
ok, I put it in like this  /em strikes out at @{target|foe|npc_name}! ?{Which Weapon Do you want to use|Great-Ax &#44 #greatax VS @{target|foe|npc_AC} AC |Dagger&#44|Heavy Xbow|Hand Xbow} Thing is now when it brings up the dropdown box it shows Great-Ax & # 44 ; without the spaces and then nothing happens. I assume that's what you meant by html substitute your right braces.  the greatax macro has @{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 5[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}   ammo= @{Vargan Tuskbeard|charname_output}
Ok... Two steps forward one back..... So this is the token ability code  /em strikes out at @{target|foe|npc_name}! ?{Which Weapon Do you want to use|Great-Ax &#44 #greatax VS @{target|foe|npc_AC} AC |Dagger&#44|Heavy Xbow|Hand Xbow} Then it spits this into the chat... I think I missed something someplace.... probably because it's 2am.. Dave (GM) strikes out at @{target|foe|npc_name}! ?{Which Weapon Do you want to use|Great-Ax &#44 @{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=1}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=17}} {{dmg1type=Slashing }} 0 {{dmg2=0}} {{dmg2type=}} {{crit1=0}} {{crit2=0}} 0 {{desc=}} ammo= @{Vargan Tuskbeard|charname_output} VS @{target|foe|npc_AC} AC |Dagger&#44|Heavy Xbow|Hand Xbow}
1475487529
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi David, take heart... it's a heck of a learning curve but the view from the top is splendid. I'd start by reviewing the  wiki for useful information on  nesting macros in queries . Make sure to review the  advanced usage information as well. Possibly wait until the morning and have a strong coffee first though ;)
1475487905

Edited 1475488763
Andrew C
Marketplace Creator
You will need to add in between the ! and the ? You will need to replace the "}".  Because the first "}" you hit the "?{Which weapon" ends.  It doesn't think it hits them when you stick in the HTML entities.  In the example you have, it thinks the Query ended just after wtype. /em lynches @{target|token_name} ?{Which weapon?|GreatAxe, &{template:atkdmg} {{mod=+8}} etc, etc, etc. Let's mockup your initial macro: /em goes after @{target|token_name} with their ?{Which weapon?|Great Ax, #greataxatk|Sword, #swordatk} Let's say you have #greataxatk for the Great Ax Attack, #swordatk for the Sword Attack. We can do it with two and then scale it out after that. #greataxatk needs to then be  &{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs>20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 5[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} ammo= @{Vargan Tuskbeard|charname_output} And you use basically the same structure for #swordatk
1475488826
Andrew C
Marketplace Creator
This will also help...&nbsp;<a href="https://dev.w3.org/html5/html-author/charref" rel="nofollow">https://dev.w3.org/html5/html-author/charref</a>
1475498459

Edited 1475498553
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I would also highly recommend making your html replaced macros character abilities rather than global macros. The global macros will parse html code when opened again, character abilities will not. If you need to have a macro repository for players, simply make a character called macros, abilities, or some such; give control to all players and then archive the character. Your players can access the macros through %{Abilities|abilityName}, and you won't have to redo all the html replacements every time you edit the macro slightly. Also of important note, but sometimes skipped over is the fact that once you do html replacement in a macro, it will only work from inside a roll query. And, the final note; I made a Google sheet to help with roll query nesting. You can find the details on it in this post:&nbsp; <a href="https://app.roll20.net/forum/post/3905546/easily-nest-roll-queries/?pageforid=3905546#post-3905546" rel="nofollow">https://app.roll20.net/forum/post/3905546/easily-nest-roll-queries/?pageforid=3905546#post-3905546</a>
1475526286

Edited 1475526349
Ok, been working on this... however something odd has happened. Any macro in my game on any character anywhere won't work. I click the button and nothing happens..... No dice rolls work nothing.
1475526444

Edited 1475526512
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Miss-formatting advanced nesting of roll queries can cause chat issues. Back out to your game splash page (with the pink join button on it) and select "clear chat archive" from the game settings drop down menu. This will get rid of the erroneous html code that is causing the chat block. *Note: using "Clear Current Chat Log" from inside the game will not do anything.
Thanks much appreciated :D
1475615115

Edited 1475617035
This is the ability I have as it stands now&nbsp;?{What weapon do you want to use? |Great Ax,&# 37;{Abilities&# 124;GreatAx&# 125;|Dagger,Value2|Heavy Crossbow,value3|Hand Crossbow,value4} Question, in that multiple choice attack macro I can refer to Abilities like so&nbsp;%{Vargan Tuskbeard|Great-ax} like the wiki says I can or can I refer to the 5E OGL Character sheet like so&nbsp;%{Vargan Tuskbeard|repeating_attack_-KNsonFudRZcxPeLb3tz_attack} ? after removing the problem HTML characters of course. As I have tried to do it but it dosn't seem to work correctly. For the ability one it just shows the text&nbsp;Vargan Tuskbeard|Great-ax if I try that and&nbsp;%{Vargan Tuskbeard|repeating_attack_-KNsonFudRZcxPeLb3tz_attack} if I try using the character sheet one. *pulls at hair*
1475619613
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It sounds like you are replacing the characters in the call, rather than in the macro like so: %{Vargan Tuskbeard&amp;124;Great-ax&amp;125; You need to replace the contents of your great-ax macro not the call itself. Never, ever, ever replace characters in the calls themselves. Due to the&nbsp; order of operations attributes and abilities are resolved before roll queries which are resolved before roll queries which are resolved before inline rolls which are resolved before /r commands (really the rolls are all resolved at once inside-out). Because of this requirement, you can't call the OGL sheet's macros as you can't replace them (best solution for these is&nbsp; ability command button menus).
1475620703

Edited 1475621359
I understand what your saying the attack ability that I'm making is &nbsp;/em targets @{target|foe|npc_name}! ?{What weapon do you want to use? |Great Ax,%{Abilities|GreatAx}|Dagger,Value2|Heavy Crossbow,value3|Hand Crossbow,value4} VS @{target|foe|npc_AC} AC I can run the ability pick great ax which is @{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs&gt;20 + 5[STR] + 3[PROF]]]}} @{Vargan Tuskbeard|rtype}@{Vargan Tuskbeard|halflingluck}cs&gt;20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 5[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} &nbsp; ammo= @{Vargan Tuskbeard|charname_output} with the appropriate &# 124; and &# 125 in place of | and } what appears in the chat is:&nbsp; Abilities VS 15 AC if I try to call a global macro with the same code as the ability it just shows #Varggreatax Vs 15 AC in the chat window. It's acting almost like it can't read any where into the macro or ability.... I can give you the link for the test game I'm trying to do this in and give you access to the character if that will help
1475621279
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Might, pm me me the invite
Pm Sent
1475632313

Edited 1475869817
Issue Solved, For any others that go looking for fixes to said troubles The multiple choice attack macro /em targets @{target|foe|npc_name}!&nbsp; ?{What weapon do you want to use? |Great Ax, %{Vargan Tuskbeard|Greatax} |Dagger, 1|Heavy Crossbow, 2|Hand Crossbow, 3} {{desc=VS @{target|foe|npc_AC} AC}} The linked Greatax Macro @{Vargan Tuskbeard|wtype}&{template:atkdmg} {{mod=+8}} {{rname=Great Ax}} {{r1=[[1d20@{Vargan Tuskbeard|halflingluck}cs&gt;20 + 5[STR] + 3[PROF]]]}} {{always=1}} {{r2=[[1d20@{Vargan Tuskbeard|halflingluck}cs&gt;20 + 5[STR] + 3[PROF]]]}} {{attack=1}} {{range=5ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 5[STR]]]}} {{dmg1type=Slashing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} You just have to change the & to & amp; and all the } to &#125; except those around any @{vargan Tuskbeard} entries. Many Thanks To Scott C for spending the time in my testing game to explain everything with great patience.
1475638032
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Just paying it forward :)