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

Am I trying to do too much at the same time? chatbox w/varying # of targets and each can make saves

I'm trying to make a chat box menu that lets me fire off effects and status changes based off spell level changing number of targets. For spells with no saves I think I have it figured out, once queries for saves come into play, i'm stumped. I know there is the HTML issue for nested Queries and I  think  I have addressed that... maybe. I'll share what I've got so far. I have NO training in this stuff. All I know I learned through Nick Olivo's youtube channel, Several of Keithcurtis's posts here, google and stubborness... so... it's probably ugly as sin, but it's what I've got.  the working script with no queries is  &{template:default} {{name=Beacon of Hope}}{{When you are ready choose the number of affected creatures, then designate your targets}} {{[1](!
/fx glow-holy @{target|Target1|token_id} 
!token-mod --set statusmarkers|+Courage::1748637 --ids @{target|Target1|token_id} --ignore-selected)[2](!
/fx glow-holy @{target|Target1|token_id} 
!token-mod --set statusmarkers|+Courage::1748637 --ids @{target|Target1|token_id} --ignore-selected 
 
/fx glow-holy @{target|Target2|token_id} 
!token-mod --set statusmarkers|+Courage::1748637 --ids @{target|Target2|token_id} --ignore-selected)[Play sound](SYRINSCAPE LINK)}} !token-mod --set statusmarkers|+blue What I am tinkering with is this... &{template:default} {{name=Animal Friendship}}{{When you are ready choose the spell level, then designate your targets}} {{[1](!
/fx sparkle-charm @{target|Target1|token_id} 
!token-mod ?{Did Target 1 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target1|token_id} --ignore-selected)[2](!
/fx sparkle-charm @{target|Target1|token_id} 
!token-mod ?{Did Target 1 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target1|token_id} --ignore-selected 
 
/fx sparkle-charm --ids @{target|Target2|token_id} 
!token-mod ?{Did Target 2 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target2|token_id} --ignore-selected)[Play sound](SYRINSCAPE LINK)}} For 1 target it works just fine... It won't fire for 2 though. Google and reading several of Keith's posts in here has gotten me this far, But I can't find the next step for the life of me. Honestly he probably answered it in one of the pages I read, and it was just above my head and i didn't even realize it. Would anyone know if this is possible/ where i'm messing up?
Hi, there appear to be two separate things going on. First, this line in the 2-target version looks wrong: /fx sparkle-charm --ids @{target|Target2|token_id} /fx does not use --ids . It should be: /fx sparkle-charm @{target|Target2|token_id} Second, the harder issue is the inline query inside an API command button. Once you put multiple ?{...} queries inside the same chat button, you need to be very careful with escaping the query separators. In particular, the | and } characters inside the button/query can break the button parsing. Try replacing the query pipes and closing brace with HTML entities inside the button: ?{Did Target 1 Fail|Yes, --set statusmarkers#Charmed::1748634|No} and: ?{Did Target 2 Fail|Yes, --set statusmarkers#Charmed::1748634|No} So the important changes are: | becomes | } becomes } Also, fix the second FX line, so it is: / fx sparkle-charm @{target|Target2|token_id} Rather than using --ids . One other suggestion: for sanity, I would split this into smaller abilities/macros if possible. Have the menu buttons call separate macros, such as  #animal-friendship-1 and #animal-friendship-2 . It makes the escaping much easier to debug than having the whole spell nested inside one giant chat menu.
Alas, no success. Thanks for the try though. I didn't want to make a million macros every time there was an upcast, but I don't think I have an option. My brain would prefer all the stuff inside the macros be a giant mess and my list of macros be nice and tidy. there is definitely not a good reason for this, just how my brain likes things.   &{template:default} {{name=Animal Friendship}}{{When you are ready choose the spell level, then designate your targets}} {{[1](!
/fx sparkle-charm @{target|Target1|token_id} 
!token-mod ?{Did Target 1 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target1|token_id} --ignore-selected)[2](!
/fx sparkle-charm @{target|Target1|token_id} 
!token-mod ?{Did Target 1 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target1|token_id} --ignore-selected 

/fx sparkle-charm @{target|Target2|token_id} 
!token-mod ?{Did Target 2 Fail|Yes, --set statusmarkers#Charmed::1748634|No} --ids @{target|Target2|token_id} --ignore-selected) [Play sound](SYRINSCAPE LINK)}} is what I ended up with. unless I missed something I think I implemented everything you said correctly. I'm throwing in the towel I guess and making a ton of tiny macros. 
1781993571

Edited 1781993585
Gauss
Forum Champion
Hi Lord Rahl, Which character sheet are you using?
1781995002

Edited 1781995036
It's a mixed bag. Predominately I try to use the 2024. but there are some things that only have 2014.  I'm running OotA so many things didn't get updated
1782005276

Edited 1782005445
Gauss
Forum Champion
So for spells you could edit each spell to put the fx button into the description, but I don't think that is likely to work very well on the 2024 sheet due to how spells are set up there.  The other thing I'd try is making a library of fx macros on a mule, then call those rather than putting the code into each button.  &{template:default} {{name=Animal Friendship}}{{When you are ready choose the spell level, then designate your targets}} {{[1](~mulename|fxcommand1)[2](~mulename|fxcommand2) [Play sound](SYRINSCAPE LINK)}} That cleans up the default, then you make your mule and start putting macros on it. It would probably simplify those macros too. 
1782085458
timmaugh
Pro
API Scripter
Take a look at the Assemble script. That can potentially offload some of the "target group" building so you don't have to worry about the nested queries. You'd build your targets first, then reference the group by a simple attribute reference.