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

Starfinder Character Sheet and Drop Down Menu Abilities

Hello everyone! I'm trying to create some macros and abilities to help with Hurl Forcedisk the spell. The way that I'd really like to have is a drop down menu along the lines of "Number of Secondary Targets" with options 0, 1, 2, 3, 4 and then the ability call to generate the text box. I can use the attacher to create a drop down menu like ?{Number of Secondary Targets|0,test0 |1,test1 |2,test2 |3,test3 |4,test4} But when I try to add the ability call it does not work, where 1HFsecTarget generates the sf_generic box with the correct roles. %{Stitches|1HFsecTarget} It kind of makes sense that this doesn't work due to the delimiter '|' being in the text, as the drop down becomes a input box with the start of the ability. However it also produces the same result when 1HFsecTar is an attribute and referenced as @{1HFsecTar} Which also seems a bit odd. I am very new to this whole macro and attacher thing (this afternoon in fact) and I'm wondering if there is any work arounds so that the menu can execute the ability For complete reference, the attacher code (on the second line) is  ?{Number of Secondary Targets|1,%{Stitches|1HFsecTar}|2,test2} And the 1HFsecTar code is &{template:sf_generic} {{name=@{character_name}}} {{title=Hurl Forcedisk Secondary Target}} {{r1name=ATTACK}} {{r1=[[1d20 + @{dexterity_mod} + @{bab}]]}} {{r2name=Spell Penteration}} {{r2=[[1d20+@{class_1_level}]]}} {{r3name=Force}} {{r3=[[2d6]]}} Thanks for the assistance!
You are right that it's a Roll Query syntax problem; just in the wrong place. Abilities, Attributes and Macros are all fully resolved before the Roll Query does anything. So by the time your Roll Query runs it looks something like as follows (I don't know the values for dex mod, bab, level so I used 2, 3 and 4 respectively ) ?{Number of Secondary Targets|1,&amp;{template:sf_generic} {{name=Stitches}} {{title=Hurl Forcedisk Secondary Target}} {{r1name=ATTACK}} {{r1=[[1d20 + 2 + 3]]}} {{r2name=Spell Penteration}} {{r2=[[1d20+4]]}} {{r3name=Force}} {{r3=[[2d6]]}}|2,test2} As far as it's concerned the Roll Query only offers a default value of&nbsp;' 1,&amp;{template:sf_generic ' rather than a list of values. There are two ways around this Replace the problem characters in the ability with HTML Entities (Codes that get translated after the Roll Query) Defer calling the abilities through use of ability buttons (Clickable links in chat that call the ability) Replace the problem characters in the ability with HTML Entities &nbsp;The characters&nbsp; , | } &nbsp;that are left behind after all the Attributes are resolved need to replaced to ensure the Roll Query works as expected. They are replaced by the codes&nbsp; &amp;comma; &amp;vert; &amp;rcub; &nbsp;respectively. So your code for 1HFsecTar would become &amp;{template:sf_generic&amp;rcub; {{name=@{character_name}&amp;rcub;&amp;rcub; {{title=Hurl Forcedisk Secondary Target&amp;rcub;&amp;rcub; {{r1name=ATTACK&amp;rcub;&amp;rcub; {{r1=[[1d20 + @{dexterity_mod} + @{bab}]]&amp;rcub;&amp;rcub; {{r2name=Spell Penteration&amp;rcub;&amp;rcub; {{r2=[[1d20+@{class_1_level}]]&amp;rcub;&amp;rcub; {{r3name=Force&amp;rcub;&amp;rcub; {{r3=[[2d6]]&amp;rcub;&amp;rcub; Note how the&nbsp; } &nbsp;used in Attribute references are not replaced. These are still required to lookup the values before the Roll Query happens. Doing this allows 1HFsecTar to work inside of a Roll Query. However it will now only work inside of a Roll Query. Defer calling the abilities through use of ability buttons Instead of having the secondary targets rolls automatically you can have a clickable link that you use to roll the chosen ability. Details of which are available at&nbsp; <a href="https://roll20.zendesk.com/hc/en-us/articles/360037256794#Macros-AbilityCommandButtons" rel="nofollow">https://roll20.zendesk.com/hc/en-us/articles/360037256794#Macros-AbilityCommandButtons</a> So the next step for your Roll Query would become ?{Number of Secondary Targets|1,[Roll 1 Secondary Target](~Stitches&amp;vert;1HFsecTar)|2,test2} Note the&nbsp; | &nbsp;for the ability button is replaced with&nbsp; &amp;vert; &nbsp;to not mess up the Roll Query, but it's a lot fewer replacements than above. Doing things this way allows the 1HFsecTar Ability to be used directly or elsewhere if required. However it requires you click on the link that appears in chat since it won't happen automatically with the primary roll. I realise this is quite the info dump but I hope it's helpful.
1604812979
Oosh
Sheet Author
API Scripter
You could even take Rainbow's suggestion a step further, and exploit the fact that API buttons are made after Queries are resolved. You can slap them right in the middle of the button call, eliminating the need for any HTML replacement: [Roll ?{Number of Secondary Targets|0|1|2|3|4} Secondary Target](~stitches|?{Number of Secondary Targets}HsecTarget)