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

Having problems with a macro: Drop-down query

I am trying to make a generic save for any token selected, this is all I got so far:
?{Choose a Save|Fortitude, %{selected|Fort-Save}|Reflex, %{selected|Ref-Save}|Will, %{selected|Will-Save}}

I cant seem to make it work, I would like some help with this. From what I can notice, the drop-down query is having problems with both the % next to the brackets and the horizontal line inside the brackets.
July 15 (9 years ago)

Edited July 15 (9 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Abner, 
Silvyre may beat me to the punch on this, but here goes:

Take a look at the advanced roll query usage wiki entry for more details on what follows. Roll queries resolve after ability/attribute calls, but before rolls. This means that in your query above, you are actually doing ?{Choose a Save|Fortitude, {whatever the macro for Fort-Save is}|...} I would guess that the macros for your saves are utilizing roll templates. In order for this to work, you would need to replace all of the problem characters (e.g. Pipes: |, commas: , , and end brackets: } ) that are not part of an attribute or ability call with their respective html entities. This would also make these abilities unable to be used outside of a roll query. For what you're trying to accomplish, I would recommend using ability command buttons to make simple GUI's in the chat for selecting what save/ability/skill to use. It still reduces your token and/or macro bar buttons, but you don't have to go through the trouble of html escaping all the problem characters present in a roll templated macro. The downside of course is that it pollutes the chat window, although you can minimize this by having it whispered to the appropriate character/player rather than just being broadcast. Out of curiosity, what sheet are you using?

-Scott
I am using a pathfinder sheet.
I am having trouble understanding you, I looked at the advanced roll query and assumed I would need to replace all or some of the | and } but it did not work, I thought that maybe it was some(the ones inside the brackets) and it did not work either for the outside ones or the inside ones.

Just to clear up just in case, What I am looking for are these steps:
  1. I select any token(Example a bandit or a player)
  2. I start the macro
  3. It asks me what I want to roll from the selected token in a drop-down menu style(Fortitude, Reflex or Will checks).
  4. I choose for example fortitude, then click submit.
  5. The macro looks inside the character sheet for the fortitude roll(1d20 + Fortmod) and rolls it.

I hae done this before but for initiative and perception and it works:
/emas @{selected|token_name} Gets ready to fight.
%{selected|Roll-for-initiative}

It works, even if I do it for saves, but as soon as I try to make it into multiple selection drop-down menu style it stops working. I assume that what you are trying to say is that the way I am trying to make it wont work for dropdowns and must change the | for the respective character replacement

I have tried these for example
[original]
?{Choose a Save|Fortitude, %{selected|Fort-Save}|Reflex, %{selected|Ref-Save}|Will, %{selected|Will-Save}}
[character replacement  into the html equivalent in the parenthesis]
?{Choose a Save(|)Fortitude, %{selected|Fort-Save}(|)Reflex, %{selected|Ref-Save}(|)Will, %{selected|Will-Save}}
[character replacement into the html equivalent in the parenthesis]
?{Choose a Save|Fortitude, %{selected(|)Fort-Save}|Reflex, %{selected(|)Ref-Save}|Will, %{selected(|)Will-Save}}

July 15 (9 years ago)

Edited July 15 (9 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, it looks like you're trying to escape the characters in the roll query itself. Those you always leave intact (unless you're nesting queries, but that's another story). So for your example, you have roll query:
?{Choose a Save|Fortitude, %{selected|Fort-Save}|Reflex, %{selected|Ref-Save}|Will, %{selected|Will-Save}}

Those ability calls (e.g. %{selected|Fort-Save}) are resolved before the roll query so %{selected|Fort-Save} expands out into (assuming you're using the pathfinder sheet by Vince, Chris b., and many others v.55) whatever the macro for the Fort-Save is, which is not accessible, so there's no way to edit it, but is probably something like this:
@{PC-whisper} &{template:pf_defense} @{toggle_accessible_flag} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_defense}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=name of roll}} {{name_link=www.url.com}} {{subtitle=subtitle}} {{dr_notes}} {{resistances_notes}} {{immunities_notes}} {{weaknesses_notes}} {{armor_notes}} {{save_notes}} {{cmd_notes}} {{defense_notes=@{defense-notes}}} {{save=[[1d20+@{fort}]]}}

In order for this to work in a drop-down query, you would need to replace at the very least, the end brackets I've put in bold. And you would need to make your own version of the fort save ability as an independent macro/ability that you could edit yourself. As an alternative, take a serious look at the ability command buttons I linked above as they allow a menu selection like this:


With a lot less work.

Thanks for the help, il read up and try out the ability command buttons. I think I will try to make it all appear in the chat(as buttons) instead of making a drop-down menu. Like in the picture