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

Weapon/Attack Selection Macro

Hi Guys, I was wondering if anyone could help me work this out. I'm playing Dnd 5e, setting up some time saving macros  I wanted to have a macro that started with a drop down list, with the weapons/attacks you have listed. So far, so easy I'm pretty sure, ?{Attack|Long sword, Placeholder |Long Bow, Placeholder }. so far, so good, i press the macro button, a drop down appears with Long sword or Long bow, i press one, then "Placeholder" appears in the chat. I then have a separate macro with the specific weapon macro in it, for example, one called #Long-Sword: @{Bjorn Frostwalker|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Longsword}} {{r1=[[@{Bjorn Frostwalker|d20}cs>20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs>20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=Slashing }} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[1d10[CRIT]]]}} 0 {{desc=}}   {{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} But when i try to combine the two, ie ?{Attack|Long sword, #Long-sword |Long Bow, #Long-Bow}, i no longer get a drop down list, instead i get a text box, with all the option name "Long Sword" then "," and then the rest of the code for the macro attack (the #Long-Sword macro). if i just click yes, nothing happens, but, if i remove everything other than the option name for the text box, in this case "Long Sword" then i get the raw output of the attack roll: Long sword {{mod=+6}} {{rname=Longsword}} {{r1=18}} {{query=1}} {{normal=1}} {{r2=6}} {{attack=1}} {{range=5 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=10}} {{dmg1type=Slashing }} 0 {{dmg2=0}} {{dmg2type=Slashing }} {{crit1=5}} {{crit2=5}} 0 {{desc=}} {{spelllevel=}} {{innate=}} {{globalattack=}} {{globaldamage=0}} {{globaldamagecrit=0}} {{globaldamagetype=}} ammo= charname=Bjorn Frostwalker |Long Bow, #Long-Bow} So, my question really is, how can i get the attack macro to be the output for the a selected item in a drop down menu macro. (P.S, i tired with the attack macro directly in the drop down menu macro, it had the same result, and i did it this way to make things a bit cleaner)
The } brackets break the drop down menu. You would either need to have macro that doesn't use those, ie no templates, or convert all of the offending characters to their HTML entity codes. I keep this site on hand for a list.&nbsp; <a href="https://dev.w3.org/html5/html-author/charref" rel="nofollow">https://dev.w3.org/html5/html-author/charref</a> &nbsp; You want to avoid commas , and and any bars | that aren't part of an attribute.
Hi Ed, Thanks for the reply. When i do that, it works, but once i save it, the macro reverts it back from HTML code to text, and it stops working. is there a way to force the macro to use the text i give it and not revert the text? Thanks
1557301907

Edited 1557301943
As well, when i replace the necessary parts of the attack macro with the HTML code: @{Bjorn Frostwalker&amp;#124 wtype&amp;#125 &amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Long Sword&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=5 feet&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d8 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=Slashing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=Slashing &amp;#125&amp;#125 {{crit1=[[1d8[CRIT]]]&amp;#125&amp;#125 {{crit2=[[1d10[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp;&nbsp; {{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125 apart from being replaced with normal text after i save, if i test the macro while it still has html code (so before i click save), i get the following error: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "@" found. Why for this thing?
1557304892

Edited 1557305075
Ziechael
Forum Champion
Sheet Author
API Scripter
Once you save the macro the html will stay intact until you open it again. To solve that issue, keep a copy of your macro elsewhere with the html intact (just in case) and never reopen the macro again... ever... You also don't need to replace the offending characters in attribute calls, for example: @{Bjorn Frostwalker&amp;#124charname_output&amp;#125 is fine to remain as: @{Bjorn Frostwalker|charname_output} It is just the closing brackets of the template sections in your example that need the html treatment. As a long term complicated macro builder and query nester I'll share something with you that will save you hours of frustration and effort... chat menus .
Hi&nbsp;Ziechael, thanks for helping :) I'm not great at coding, and don't fully understand what i would need to do, perhaps you could take a look at my attempt to code a drop down for the attacks listed on my character sheet (my DM likes the way those to hit and damage roll boxes look and have both in them so, gotta use the macro from the sheet). i have not included the HTML code, just the code that i know works by itself, because I'm not sure what code works and what doesn't. My attempt: ?{attack | Long Sword 1H,&nbsp;@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Long Sword 1H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=1H Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=2H Slashing }} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[1d10[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} | Long Sword 2H,&nbsp;@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Long Sword 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + 4[STR]]]}} {{dmg1type=2H Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d10[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} | Long bow,&nbsp;@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 foot (melee), 20/60 (ranged)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + 4[STR]]]}} {{dmg1type=Peircing }} 0 {{dmg2=[[0]]}} {{dmg2type=Peircing }} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[1d8[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} | Spear 1H,&nbsp;@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear 1H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 foot (melee), 20/60 (ranged)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + 4[STR]]]}} {{dmg1type=Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=Peircing }} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[1d8[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} | Spear 2H,&nbsp;@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Foot}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=2H Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} } I should point out, i currently have macros made for each of those options with the code as it is there, so for example, i have a macro named Spear-2H, with the code:&nbsp; @{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Foot}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=2H Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output} So, if i know how to fix that code to work with the list, I can tidy up the list macro to be something like: ?{attack | Long Sword 1H, #Long-Sword-1H| etc.} But at the moment, I'm not sure what i need to change about the above code/s to make this drop down list for my attacks work, hopefully one of you guys could fix up the code above for me so i can see what I've done wrong. Thanks so much guys!&nbsp; :)
1557318206
Ziechael
Forum Champion
Sheet Author
API Scripter
I'd be happy to take a look when I have some time (back to back meetings today unfortunately), we could definitely get something functional for you. It's long term use or sustainability might be questionable though from the issues you've already seen. I'd reiterate the&nbsp; chat menus &nbsp;option again in the meantime, it's a great, and easily expandable way to manage a character using the official Roll20 5e sheet. Here is how they look in game, you simply click the choice in the chat window and the attack runs as if you were running it from your sheet. Add it as a token action or even a macro bar option and you never need open your sheet again. Even better is the way you can reorder it, add to it or remove from it with ease. Each repeating section attack has a row id ($0, $1 etc) which makes it easy to plan which section you want them to be in. I need to get around to adding the spell attacks in really... And here is the code that runs it, simple eh (you can do this for skills, saves, spells even): /w @{character_name} &amp;{template:atk} {{desc=**Attacks** **------------------------------------** **Melee** [@{repeating_attack_$0_atkname}](~@{character_name}|repeating_attack_$0_attack) [@{repeating_attack_$1_atkname}](~@{character_name}|repeating_attack_$1_attack) [@{repeating_attack_$3_atkname}](~@{character_name}|repeating_attack_$3_attack) **------------------------------------** **Ranged** [@{repeating_attack_$2_atkname}](~@{character_name}|repeating_attack_$2_attack) }}
Hi&nbsp;Ziechael, hope your meetings go well and you get out soon (i know how boring they can be) Thanks in advance (sorta) for taking a look at the macro code,I took a look at the chat menus, but i couldn't get my head around it. I'm not great at coding, so I'm not quite sure what to leave in, and what to replace with my stuff. It would be great if there is a way to make these attacks selectable with a drop down menu macro like i tried to do above, but if you able to shed any light on the chat menus as well, that would be super helpful. Again, thanks, i know you don't have to take time out of your day to do this so it means a lot you helping me out like this.
Honestly Chat menus are easier and simpler to code and what I ended up going with myself. Using exactly what Ziechael has above will work for your first 4 weapons.
How would i use those? i tried but it didnt really work,so im not sure what im missing about it.
I think the above macro might not have worked because you didn't have the macro in the characters abilities tab. That's the best place to store individual macros for a character. I use the following simple macro for attacks: /w "@{selected|character_name}"&amp;{template:atk} {{desc=**Weapon attacks:** ``[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack)`` ``[@{selected|repeating_attack_$1_atkname}](~selected|repeating_attack_$1_attack)`` ``[@{selected|repeating_attack_$2_atkname}](~selected|repeating_attack_$2_attack)`` }} Using @{selected| requires you to have the token that is attached to the character sheet selected on the tabletop, but it also ensures that you are pulling the data from the correct character. This will need to be modified based on how many weapons the character has.&nbsp; $0 is the first item in the attacks and spellcasting section, the second one is $1 and so on. The player can then click on the name of the attack in the chat menu and the attack happens. Be sure to set this as a token action in the abilities tab. I hope that helps Happy gaming
The way i personally do it. is i have multiple macro calls in a nested macro. Essentially, you make 1 macro for each weapon you wish to use, and then use a macro (with the button presses in chat) to call each macro you want to use from there. Ive found it to be 1. MUCH less lag inducing than that pop up window with the drop down menu, and 2. much easier to edit. as you only have to worry about the actual main macro that calls each of the weapon attacks breaking the HTML characters rather than the entire macro breaking constantly. I could show some examples if you like.
winterborn said: Hi Guys, I was wondering if anyone could help me work this out. I'm playing Dnd 5e, setting up some time saving macros&nbsp; Hey Winterborn, Yep, I hear ya about making time saving macros. I do like your idea of making a "drop list" of attacks rather than ending up with a dozen Taken Actions (for BBGs), so I'll be following to see your end results. :) Take a look at this one I made that has a few variables that I strangled out of the HTML of the OGL sheet. Maybe you could make use of some? <a href="https://app.roll20.net/forum/post/7425733/d-and-d5e-ive-cracked-it-my-personal-perfect-npc-attack-macros" rel="nofollow">https://app.roll20.net/forum/post/7425733/d-and-d5e-ive-cracked-it-my-personal-perfect-npc-attack-macros</a> And if you're sick of duplicating the data you already have in the sheets to make macros, maybe you could consider throwing a vote on this suggestion: <a href="https://app.roll20.net/forum/post/7347663/token-selection-new-attack-options-button-show-attack-options/?pageforid=7449682#post-7449682" rel="nofollow">https://app.roll20.net/forum/post/7347663/token-selection-new-attack-options-button-show-attack-options/?pageforid=7449682#post-7449682</a> Good luck!
Thanks for all your help guys, I can't seem to get the drop down list working, as normal or replacing the text with html code, if i do that, then it just pops up an error telling me it cant find the character. And I've setup all my attacks as token abilities, but i cant seem to get the chat buttons or menus working either. really not sure what I've done wrong at all.
1558059613
GiGs
Pro
Sheet Author
API Scripter
Post the code you're using, we might be able to point out the problem.
So, with the drop down list (effectively given up hope on this but maybe it will work if its put right) i had: ?{Attack|Long Sword 1H,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Long Sword 1H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=1H Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=2H Slashing }} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[1d10[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|Long Sword 2H,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Long Sword 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + 4[STR]]]}} {{dmg1type=2H Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d10[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|Long Bow,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+5}} {{rname=Long Bow}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 3[DEX] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 3[DEX] + 2[PROF]]]}} {{attack=1}} {{range=normal to 150, disavantage to 600}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 3[DEX]]]}} {{dmg1type=Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|Spear 1H,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear 1H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 foot (melee)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + 4[STR]]]}} {{dmg1type=Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=Peircing }} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[1d8[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|Spear 2H,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Foot}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 4[STR]]]}} {{dmg1type=2H Piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|Spear Ranged,@{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Spear Ranged}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=20-60 feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + 4[STR]]]}} {{dmg1type=}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}|} And get a popup saying "Attack:" but with the rest of the code in a text box. if i press okay, it does nothing, but if i remove all the code and put simply Long Sword 1H, it rolls the Spear Ranged attack&nbsp; OR If i change it to just the #macros for the attack its: ?{Attack|Long Sword 1H,#Long-Sword-1H |Long Sword 2H,#Long-Sword-2H |Long Bow,#Long-Bow |Spear 1H,#Spear-1H |Spear 2H,#Spear-2H |Spear Ranged,#Spear-Ranged |} But i get the same issue as above OR with HTML code replacements ?{Attack&amp;#124Long Sword 1H&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Long Sword 1H&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=5 feet&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d8 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=1H Slashing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=2H Slashing &amp;#125&amp;#125 {{crit1=[[1d8[CRIT]]]&amp;#125&amp;#125 {{crit2=[[1d10[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124Long Sword 2H&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Long Sword 2H&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=5 Feet&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d10 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=2H Slashing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=&amp;#125&amp;#125 {{crit1=[[1d10[CRIT]]]&amp;#125&amp;#125 {{crit2=[[0[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124Long Bow&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+5&amp;#125&amp;#125 {{rname=Long Bow&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 3[DEX] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 3[DEX] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=normal to 150&amp;#44 disavantage to 600&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d8 + 3[DEX]]]&amp;#125&amp;#125 {{dmg1type=Piercing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=&amp;#125&amp;#125 {{crit1=[[1d8[CRIT]]]&amp;#125&amp;#125 {{crit2=[[0[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124Spear 1H&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Spear 1H&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=5 foot (melee)&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d6 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=Piercing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=Peircing &amp;#125&amp;#125 {{crit1=[[1d6[CRIT]]]&amp;#125&amp;#125 {{crit2=[[1d8[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124Spear 2H&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Spear 2H&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=5 Foot&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d8 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=2H Piercing &amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=&amp;#125&amp;#125 {{crit1=[[1d8[CRIT]]]&amp;#125&amp;#125 {{crit2=[[0[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124Spear Ranged&amp;#44@{Bjorn Frostwalker&amp;#124wtype&amp;#125&amp;{template:atkdmg&amp;#125 {{mod=+6&amp;#125&amp;#125 {{rname=Spear Ranged&amp;#125&amp;#125 {{r1=[[@{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 @{Bjorn Frostwalker&amp;#124rtype&amp;#125cs&gt;20 + 4[STR] + 2[PROF]]]&amp;#125&amp;#125 {{attack=1&amp;#125&amp;#125 {{range=20-60 feet&amp;#125&amp;#125 {{damage=1&amp;#125&amp;#125 {{dmg1flag=1&amp;#125&amp;#125 {{dmg1=[[1d6 + 4[STR]]]&amp;#125&amp;#125 {{dmg1type=&amp;#125&amp;#125 0 {{dmg2=[[0]]&amp;#125&amp;#125 {{dmg2type=&amp;#125&amp;#125 {{crit1=[[1d6[CRIT]]]&amp;#125&amp;#125 {{crit2=[[0[CRIT]]]&amp;#125&amp;#125 0 {{desc=&amp;#125&amp;#125&nbsp; &nbsp;{{spelllevel=&amp;#125&amp;#125 {{innate=&amp;#125&amp;#125 {{globalattack=@{Bjorn Frostwalker&amp;#124global_attack_mod&amp;#125&amp;#125&amp;#125 {{globaldamage=[[0]]&amp;#125&amp;#125 {{globaldamagecrit=[[0]]&amp;#125&amp;#125 {{globaldamagetype=@{Bjorn Frostwalker&amp;#124global_damage_mod_type&amp;#125&amp;#125&amp;#125 ammo= @{Bjorn Frostwalker&amp;#124charname_output&amp;#125&amp;#124&amp;#125 and got the following error:&nbsp; SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "@" found. Not sure whats going on with that, as it should be fine with the HTML i thought. With the chat menu i had /w @{character_name} &amp;{template:atk} {{desc=**Attacks** **------------------------------------** **Melee** [@{Long-Sword-1H}](~@{Bjorn Frostwalker}|Long-Sword-1H) [@{Long-Sword-2H}](~@{Bjorn Frostwalker}|Long-Sword-2H) [@{Spear-1H}](~@{Bjorn Frostwalker}|Spear-1H) [@{Spear-2H}](~@{Bjorn Frostwalker}|Spear-2H) **------------------------------------** **Ranged** [@{Long-Bow}](~@{Bjorn Frostwalker}|Long-Bow) [@{Spear-Ranged}](~@{Bjorn Frostwalker}|Spear-Ranged) }} But when i do this i get the error:&nbsp; TypeError: Cannot read property 'substring' of undefined I've tried simple buttons with this&nbsp; [Long Sword 2H](~Long-Sword-2H) but i get the same error. I've selected my character and sent the macro in the chat as my character. when i press the up option it returns with: %{Long-Sword-2H} Not sure why that changed like that. All the attacks have been setup in my character sheet as token actions, but for both options I'm still getting issues, that i don't properly understand.
1558125936

Edited 1558127768
GiGs
Pro
Sheet Author
API Scripter
Oh yeah, that's way too complex for me ;) My recommendation is to use chat menus instead. Edit: I see you've already tried them. it looks like the problem is you've used both these symbols: ~@, you only use one or the other, as appropriate. Can you print your Longsword-2h macro, and maybe we can see why it isnt working with a chat menu. Edit 2: in your chat menu, you have entries like this: [@{Spear-1H}](~@{Bjorn Frostwalker}|Spear-1H) The first part should not be a an attribute reference. [@{Spear-1H}] should be [Spear-1H] The text there is the visible text that shows on the button, it's just a label and should be basic text. The second part: (~@{Bjorn Frostwalker}|Spear-1H) isnt properly coded. You have the curly brackets in the wrong place, as well as them multiple @~ at the start.&nbsp; It should be something like (~Bjorn Frostwalker|Spear-1H) or (!&amp;#13;&amp;#37;{Bjorn Frostwalker|Spear-1H} The last two i believe are functionlally equivalent, but I'm a bit rusty on these. Putting it together, try this [Spear-1H](~Bjorn Frostwalker|Spear-1H) If that doesnt work, we need to know where your attack macros are stored. This is assuming they are Abilities. Edit 3: &nbsp;if your attacks are stored in the macros list, and not on your character sheet, it would be [Spear-1H]( !&amp;#13;# Spear-1H)
Hi there, i tried removing the "~" from the chat menu macro, but i got the same "sub string of undefined" issue. The Long-Sword-2H macro is the attack macro, so i go it by entering all the attack information from the book into my character sheet, and then i clicked on the character sheet and pressed the up arrow in chat. it comes out as: @{Bjorn Frostwalker|wtype}&amp;{template:atkdmg} {{mod=+6}} {{rname=Long Sword 2H}} {{r1=[[@{Bjorn Frostwalker|d20}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Bjorn Frostwalker|rtype}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=5 Feet}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + 4[STR]]]}} {{dmg1type=2H Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d10[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}&nbsp; &nbsp;{{spelllevel=}} {{innate=}} {{globalattack=@{Bjorn Frostwalker|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Bjorn Frostwalker|global_damage_mod_type}}} ammo= @{Bjorn Frostwalker|charname_output}
1558127196
GiGs
Pro
Sheet Author
API Scripter
Have you tried the updated syntax from my post's second edit?
1558127412

Edited 1558127431
GiGs
Pro
Sheet Author
API Scripter
By the way looking through your monster dropdown macro, you've used html replacements where you definitely shouldnt, like here: @{Bjorn Frostwalker&amp;#124d20&amp;#125cs&gt;20 You never do a replacement within an attribute call, and probably not within a roll. That said, you are better off dumping the dropdown based approach for complicated macros like this. Stick to chat menus, we'll get it working with a bit of effort.
Man! This is getting so complex! If only there was a new suggestion that could make this all so much simpler? Imagine, none of these threads would ever be needed again and DMs could get on with DMing rather than trying to be Coders... If only... <a href="https://app.roll20.net/forum/post/7347663/token-selection-new-attack-options-button-show-attack-options/?pageforid=7449682#post-7449682" rel="nofollow">https://app.roll20.net/forum/post/7347663/token-selection-new-attack-options-button-show-attack-options/?pageforid=7449682#post-7449682</a> =D
Hey Guys, Big thank you to GiGs,&nbsp;Ziechael,&nbsp;Ed S., Mark, and Richard J. I have finally got it working using the Chat menu options, And it works great. ive been able to split my macros into attack melee, attack ranged, skills, saves, and abilities. ontop of this ive made it so it whispers the message to me, so the chat buttons dont take up other peoples screen. Big thanks to gigs as this is the code i used (for attack melee, extrapolate for the rest if you wish): /w bjorn [Long Sword 1H](!&amp;#13;#Long-Sword-1H) [Long Sword 2H](!&amp;#13;#Long-Sword-2H) [Spear 1H](!&amp;#13;#Spear-1H) [Spear 2H](!&amp;#13;#Spear-2H) The code isn't pretty as i had to get it all on one line to be sent in one message, otherwise i would have to send myself a message for each attack, and that looked terrible. Like i said, I've got this for attacks, skills, saves and abilities now, so i can do pretty much any roll right from the main/chat screen, with no need to switch in and out of my character sheet. I also made a misc d20 roll that was possible in no small part because of the the help you guys gave me. it has a modifier input, as well as the option for advantage and all that. the code is below (you will have to edit the name for your own character if you wish to use it of course, but that should be all you need to change): @{Bjorn Frostwalker|wtype}&amp;{template:simple} {{rname=Misc roll}} {{r1=[[@{Bjorn Frostwalker|d20}+?{modifier|}@{Bjorn Frostwalker|pbd_safe}]]}} @{Bjorn Frostwalker|rtype}+?{modifier|}@{Bjorn Frostwalker|pbd_safe}]]}} {{global=@{Bjorn Frostwalker|global_save_mod}}} @{Bjorn Frostwalker|charname_output} Again guys, thank you for all your help and support, the task is finished and it was all thanks to you. My macros and rolls are now much more efficient for it :)
1558202817
GiGs
Pro
Sheet Author
API Scripter
That's great! If you want slightly prettier output, you could embed those buttons in a roll template, like /w bjorn &amp;{template:default} {{name=Melee Chat Menu}} {{[Long Sword 1H](!&amp;#13;#Long-Sword-1H) [Long Sword 2H](!&amp;#13;#Long-Sword-2H) [Spear 1H](!&amp;#13;#Spear-1H) [Spear 2H](!&amp;#13;#Spear-2H)}}
That looks really cool, but don't know how to make a good looking template, or how to put it into the game.
1558210945

Edited 1558210976
GiGs
Pro
Sheet Author
API Scripter
You can just past that test into chat (or a macro). roll20 has one standard rolltemplate that is available in every game You just start with the text &amp;{template:default} Then have sections enclosed in {{ }} brackets - each will be a new row. If you include an = sign, the cntents are split into two columns - whatever is the left of the = becomes the left column, and whatever is to the right becomes the right column. {{name=something}} is special - that creates a title row. Try out the above text I posted, it will work automatically.