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

Multiple targets in a single macro

I'm having a problem trying to set a drop down list for an attack that uses the same attack roll on up to X number of creatures, listed in the text under the name (3 in this example). So if the player chose 2, the subtag would be "makes a Multishot at <Target1's name> and <Target2's name>" What it has in the drop down list is  1 token_name 2 token_name and target2 token_name 3 token_name, target2 token_name, and target3 token_name Macro: &{template:DnD35Attack}  {{name=@{selected|token_name} }}  {{npcflag=true}}  {{subtags=makes a @{npcattack2type} at ?{Number of targets? |1, @{target1|token_name} |2, @{target1|token_name} and @{target2|token_name} |3, @{target1|token_name}, @{target2|token_name}, and @{target3|token_name}}}}  {{fullattackflag= [[0d1]] }}  {{fumbleroll= Fumble: @{npcattack1attack} }}  {{attack1=@{npcattack1type}: @{npcattack1attack} }}  {{damage1=D: @{npcattack1damage} }}  {{critconfirm1=Crit?: @{npcattack1critatk} }}  {{critdmg1= @{npcattack1critdam} }}  {{notes=@{npcattack1note} }} Extra newlines added for ease of reading the macro.
I've attempted to escape the | and last } for each of the targets, but with no success. It gives the error:  No character was found for 'target|token_name} ' No character was found for 'target|token_name} and @{target2|token_name} ' No character was found for 'target2|token_name} ' TypeError: Cannot read properties of undefined (reading 'substring')
ok, I figured it out, sort of. Format for targetting multiple targets is @{ target| target1|token_name} Now, it works, but you have to select all 3 targets, even if you only want 1 or 2.
1688801680
GiGs
Pro
Sheet Author
API Scripter
Yes, the standard macro system doesn't give you the ability to reduce the number of targets. You're a Pro user, though, and can benefit from ScriptCards, which should let yiou build a macro to do this.
1688839264

Edited 1688840231
vÍnce
Pro
Sheet Author
Not sure if it works here (on my phone, can't test) but I seem to recall a trick where you enter a "!" once you have reached your number of intended targets, which forces the macro to stop executing since "!" is used for api/mod commands. From GK 8yr ago... Lol <a href="https://app.roll20.net/forum/permalink/1865855/" rel="nofollow">https://app.roll20.net/forum/permalink/1865855/</a>