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 with scriptcards? any suggestions?

Hi, we're playing Pathfinder 1st Edition and our Sorcerer want to use the Magic Missile spell to attack different targets. I have try it that way: !scriptcard {{   --#title|TargettingLoop   --=HowMany|5   --=TC|1 --:TargetLoop| --+|@{target|[$TC]|token_name} is [$TC]/[$HowMany]! --=TC|[$TC]+1 --?[$TC] -le [$HowMany]|TargetLoop --+|That's it --x| }} But I can only target the first one and the remaining four will be the same as the first one automatically. I can't figure out how to do it?
So that's a Roll20 limitation, The `@{ }` stuff is processed first before anything else. ScriptCards has a workaround listed to get targets in its  Information Request section . Basically you'll run the macro, if it reaches that spot it will send a button that will then query for targets. There is an example Magic Missile script with this functionality in  Kurt J's GitHub repo  where it will build the loop. It's a workaround for the limitations in Roll20's query system, where `?{ }` and `@{ }` are processed first regardless of anything else in the chat. With the ScriptCards `--i` allowing for ? and @{target} stuff to be processed later and honor things like variables and conditional statements.
1699794104

Edited 1699797749
thanks. I have missed that one. I have checked the awesome script and I'm encoutering a little problem. The following line should put out the token_name instead of character_name. &nbsp;--+Missile|[$DisplayCount.Total] Hits [*[&amp;ThisTarget]:character_name] for [$ThisMissile] [b]force[/b] damage But changing it to token_name results in this error: "Error: No attribute or sheet field found for character_id -NEzHKvhdQrUhfc545lD named token_name" I don't what the script to apply the damage directly. So I'm in need of the token_name. The token_name contains a number. do you have any advice how to accomplish that? Samuel fires 2 missiles of magical force! &nbsp; ScriptCards Hervorrufung ♦ Ranged Attack Missile 1 Hits Ghul for <span style="font-family: &quot;undefined&quot; ; font-size: 1.2em ; font-weight: normal ; font-style: normal ; text-align: center ; font-size: 100% ; display: inline-block ; font-weight: bold ; height: 1.0em ; min-width: 1.75em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid ; border-radius: 3px ; background-color: #88cc88 ; border-color: #004400 ; color: #004400" class="userscript-showtip userscript-tipsy" title="Roll: 1d4 + 1 Result: (4) + 1 ">5 force damage&nbsp;&nbsp;&nbsp;&nbsp; &lt;- Output using character_name Missile 2 Hits undefined for <span style="font-family: &quot;undefined&quot; ; font-size: 1.2em ; font-weight: normal ; font-style: normal ; text-align: center ; font-size: 100% ; display: inline-block ; font-weight: bold ; height: 1.0em ; min-width: 1.75em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid ; border-radius: 3px ; background-color: #88cc88 ; border-color: #004400 ; color: #004400" class="userscript-showtip userscript-tipsy" title="Roll: 1d4 + 1 Result: (4) + 1 ">5 force damage&nbsp; &lt;- Output using token_name Total Total damage is <span style="font-family: &quot;undefined&quot; ; font-size: 1.2em ; font-weight: normal ; font-style: normal ; text-align: center ; font-size: 100% ; display: inline-block ; font-weight: bold ; height: 1.0em ; min-width: 1.75em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid ; border-radius: 3px ; background-color: #fffea2 ; border-color: #87850a ; color: #000000" class="userscript-showtip userscript-tipsy" title="Roll: 5 + 5 Result: 5 + 5 ">10