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.
I'm not actually using the Roll20 sheets for my players, the mixed bag of sheets is for my monsters. My players much prefer the DND beyond interface and using beyond20 so I can keep track of a few useful things like HP.  I like the idea of the FX Library from a mechanical/ organizational standpoint. I'll probably try a small run of that to see how it plays in more complex scripts like this one before I make the whole library. Unfortunately that will have to wait till I get home and have better internet available.  As for that Assemble script, after reading through it, I don't think It'd work for what I'm doing. As far as roll20 is concerned most of my PCs don't even have spells/ are 2024 sheets so it wouldn't have any attributes to pull from for this. My other concern is that my sandbox is already fighting for its life and adding any other scripts is something I have to do with a lot of caution. For some reason my Fetch keeps crashing it out. For a while there my scripts were completely nonfunctional and no amount of restarting the sandbox or deleting/ reinstalling some pretty standard scripts (meta script/ tokenmod/ things like that). Keith had me check for duplicates, and deleting those got it working again, but every copy of that game, or new game I make, crashes out the same way When I try to install the metascript toolbox. Not really sure what 's causing it, and at this point I have it filed under "future me" problems since my actual game is working... But I really have to weigh the risk vs benefit anytime i install a new script now a days. 
1782164754
timmaugh
Pro
API Scripter
Hmm... well, the Assemble script wouldn't be for pulling information from a character sheet in the game. It would be for building your list of targets prior to running a command. For instance, you would build a set of 3 targets, then run a single TokenMod command. The IDs of the tokens you'd assembled would be stored in an attribute on a mule sheet (none of your players have to know about it, it just has to be there). Then your TokenMod command could reference that attribute in the "--ids" argument. In other words: !token-mod --ids @{mule|assembledIDs} ... ...or some such. I'd have to look at the documentation again to know the name of the attribute. Or, with the Toolbox working, you could drop those IDs into a {&select} tag, but from what you said you don't have the Toolbox installed. One thing I can say is that Roll20 recently rolled out some "dependency check" logic to get dependency scripts installed, but it is riddled with problems and installs duplicate scripts. We've engaged the devs on it, but haven't gotten a resolution yet. It should work fine if you install scripts that you don't have, but if you already have the scripts, you just need to cancel/ignore the warning. However, as you say, that's a problem for the future. If you are still encountering that problem whenever you get back to it (or now, if you decide you want to give the Assemble script a try), feel free to reach out and/or invite me to your game and I can see if I can spot what might be going on.