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

[PF] Using dropdown query to call sheet roll macros nested within abilities

To give a quick bit of background, I've been playing a character focused around summoning monsters. Initially they only had one attack and generally only received one buff type, so I managed quite well by just adding one buffed and one unbuffed attack roll macro in the 'attacks' section of my character sheet. As time goes on, though, said buff has come to include an extra natural attack, and monsters started having multiple natural attacks out of the box as well. This I solved with added inline rolls in the 'weapon notes' sections, and by telling my GM to increase attack and damage rolls by x amount whenever modifiers popped up. That last bit was far from ideal though, so I started looking into Roll20's macro functionality. My first remotely functional attempt was mostly built around queries that added modifiers, but it didn't really suit my needs; there were too many queries to really go through, which made activating them take a bit too long, and the way queries work made it very awkward to apply damage and attack modifiers from the same source without adding even more queries. Some experimenting later, I'm currently at the point where I have separate character sheets for these summons, with sheet roll buttons for all their natural attacks, sheet roll buttons for said attacks with bonus fire damage and activatable buffs to reflect modifiers such as charging, flanking, rage etc. The intent for this last batch was to create a dropdown query: standard attacks, attacks under rage (to add an extra gore attack), attacks under rage with added fire damage (which has limited uses per rage). Select your option and the macro will activate the appropriate sheet roll buttons. Now, I'm fairly sure this last options is possible , but I've been entirely unable to get it to work. What I've done is the following: 1. Create sheet roll buttons for a slam attack, a gore attack, a slam attack with fire and a gore attack with fire. 2. Figure out the ability calls with the aid of  this wiki entry . 3. Create abilities in the Attributes & Abilities character sheet function as below. Standard %{Small Earth Elemental|repeating_weapon_-LCB2BhRdaPLxy4krnpU_attack-roll} Rage %{Small Earth Elemental|repeating_weapon_-LCB2BhRdaPLxy4krnpU_attack-roll} %{Small Earth Elemental|repeating_weapon_-LCB8X-i8eXz0rl-QAjS_attack-roll} Blazing Rage %{Small Earth Elemental|repeating_weapon_-LCB8GoAV6pkvxopsnTg_attack-roll} %{Small Earth Elemental|repeating_weapon_-LCB8uzUQ4bHUWeKjI0G_attack-roll} 4. Create a macro that asks which attack type I would like to execute. Earth-S ?{Attack Type?|Standard, %{Small Earth Elemental|Standard} |Rage, %{Small Earth Elemental|Rage} |Blazing Rage, %{Small Earth Elemental|Blazing-Rage} } As those familiar with the macro system might immediately guess, this doesn't work; by my understanding because it has parser objects within the ability entry. I've tried replacing the parser objects within the ability with HTML entities as suggested in  this wiki entry though... and it still refuses to work. If I create a macro with just the 'Standard' entry, replacing the other ability calls with just letters for testing purposes, the version with no HTML entity replacement gives me a text form entry query. If I remove the gibberish and enter 'Standard', to reflect one of the query options, it prints what appears to be an unparsed version of the sheet macro. Prefilled query form text Standard, &{template:pf_attack Resulting print if Standard is entered Standard {{accessible=true}} {{rounded=rounded}} {{font=00}} {{color=}} {{character_name=Small Earth Elemental}} {{character_id=-LCQKFPiA_Y0KWwK1oj8}} {{subtitle}} {{name=Slam}} {{attack=12}} {{damage= Rolling 1d6 + 11 [Total] + 0 [Macro] + 0 + 0 = (<span class="basicdiceroll critsuccess ">6</span>)+11+0+0+0" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 63 , 179 , 21 ) ; padding: 0px 3px ; font-weight: bold ; cursor: help ; font-size: 1.1em ; color: rgb( 64 , 64 , 64 ) ; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif">17}} {{crit_confirm= Rolling 1d20 + 9 [Total] + 0 [Macro] + 0 + 0 + 0 = (<span class="basicdiceroll">16</span>)+9+0+0+0+0" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 254 , 246 , 142 ) ; padding: 0px 3px ; font-weight: bold ; cursor: help ; font-size: 1.1em ; color: rgb( 64 , 64 , 64 ) ; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif">25}} {{crit_damage= Rolling 1d6 + ((11 [Total] + 0 [Macro] + 0 + 0) * 1) = (<span class="basicdiceroll">4</span>)+((11+0+0+0)*1)" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 254 , 246 , 142 ) ; padding: 0px 3px ; font-weight: bold ; cursor: help ; font-size: 1.1em ; color: rgb( 64 , 64 , 64 ) ; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif">15}} {{type=B}} {{weapon_notes=}} 0 0 0 0 0 0 0 0 {{buff_note=}} {{condition_note=}} {{melee_notes=}} {{header_image=}} {{attack_notes=}} {{vs=ac}} {{vsac=ac}} {{precision_dmg1=}} {{precision_dmg1_type=}} {{precision_dmg2=}} {{precision_dmg2_type=}} {{critical_dmg1=}} {{critical_dmg1_type=}} {{critical_dmg2=}} {{critical_dmg2_type=}} {{attack1name=}} |Rage, B |Blazing Rage, C} If I replace ']', '|' and ',' with their respective HTML versions within the Ability form entries I get an error message, followed by different unparsed text; replacing '&' as well doesn't change the error. There is no query at all, just an immediate print. Error No ability was found for %{Small Earth Elemental| repeating_weapon_-lcqq9eyilhqgo3aq8wl_attack-roll} |Blazing Rage, C} Printed result ?{Attack Type?|Standard, Small Earth Elemental| repeating_weapon_-lcqq9eyilhqgo3aq8wl_attack-roll} |Rage, B |Blazing Rage, C Error, '&' replaced No ability was found for %{Small Earth Elemental| repeating_weapon_-lcqq9eyilhqgo3aq8wl_attack-roll} |Blazing Rage, C} Print, '&' replaced ?{Attack Type?|Standard, Small Earth Elemental| repeating_weapon_-lcqq9eyilhqgo3aq8wl_attack-roll} |Rage, B |Blazing Rage, C If anyone could help me out that'd be greatly appreciated, I'm kind of stuck at this point.
1526306177

Edited 1526306307
vÍnce
Pro
Sheet Author
{{damage= Rolling 1d6 + 11 [Total] + 0 [Macro] + 0 + 0 = (6)+11+0+0+0" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 63 , 179 , 21 ) ; padding: 0px 3px ; font-weight: bold ; cursor: help ; font-size: 1.1em ; color: rgb( 64 , 64 , 64 ) ; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif">17}} I'm not sure I've seen html and inline style injected into a roll template used in a macro... does that work?  From the snippet above it seems that it's not even properly applied.  I wouldn't expect the macro would work even if it wasn't part of a dropdown/nested query. Oh wait, that was the output to chat?  Which still seems weird... Have you tried using the chat menu buttons that are included on the sheet?
That's what was output to chat if I activated the macro and entered 'Standard' in the freeform text field, yes. As for why it does that, I'm not quite sure; I'm assuming it has to do with it not parsing the code correctly. I have tested the buttons included on the sheet (the ones I'm trying to call within the macro, if I'm understanding your question correctly) and tried to activate the abilities from the Attributes & Abilities menu manually, and they worked in both cases. The variants of the abilities with HTML entities replaced do not, as the 'roll query troubleshooting' entry would suggest; it doesn't convert the entities back, so it just posts the macro code directly to chat ("Macros which contain HTML entities may no longer function autonomously.").
Sorta had the same problem, and just decided to do what i wanted a different way. <a href="https://wiki.roll20.net/Macros#Nesting_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Macros</a> This may help eventually, as apparently other macros and such that you run may have to include the replacements as well. However, for the current problem you got it probably won't. This is a bit of my code, ?{Terrain type| Space, %{@{selected|character_name}|Space} | Land, %@{selected|character_name}|Land} } One thing I noticed when trying to figure it out was: If I have it as a Macro or Character ability and got it opened up and use the "test macro" button, it will come up with the error: "No ability was found for %{@{selected|character_name}" Yet if it just run it from the token/macro bars, it doesn't come up with the error. It could just be because mine does an @{selected|character_name} to get, but I figured i'd say just on&nbsp; the off-chance it does. *Edit* Just got my thing working. What I did was this: Figured out that doing "test macro" and "test ability" causes errors to appear Ran it on the macro bar, causing it to appear without the orange errors. Every time it had the error where it's a text input, I see what part it ended at and replaced whatever } symbols that were there and repeated. (The things that need replaced were in the macro i was calling) Hopefully that helps, but yours looks pretty complicated with all the html (padding,font styles, etc)
Sorta had the same problem, and just decided to do what i wanted a different way. <a href="https://wiki.roll20.net/Macros#Nesting_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Macros</a> This may help eventually, as apparently other macros and such that you run may have to include the replacements as well. However, for the current problem you got it probably won't That was one of the steps I went through along the way actually, this attempt was kind of an iteration on that. I figured that if I could call macro buttons from the sheet in a query I could get a fairly painless way to combine multiple attack rolls into one button. Not so painless as I'd hoped, turns out haha. One thing I noticed when trying to figure it out was: If I have it as a Macro or Character ability and got it opened up and use the "test macro" button, it will come up with the error: "No ability was found for %{@{selected|character_name}" Yet if it just run it from the token/macro bars, it doesn't come up with the error. It could just be because mine does an @{selected|character_name} to get, but I figured i'd say just on the off-chance it does. Unfortunately that doesn't fix my issue. It probably is related to the @{selected call, I've tried running my macro off of the macro bar a couple times during testing with equally poor results. *Edit* Just got my thing working. What I did was this: Figured out that doing "test macro" and "test ability" causes errors to appear Ran it on the macro bar, causing it to appear without the orange errors. Every time it had the error where it's a text input, I see what part it ended at and replaced whatever } symbols that were there and repeated. (The things that need replaced were in the macro i was calling) Hopefully that helps, but yours looks pretty complicated with all the html (padding,font styles, etc) I'll give your 3rd step a try actually, that sounds like it might do something. As for it being complicated, all that formatting is from the default Pathfinder community sheet markup I'm trying to wrench my attack macros out of, so that's not really something I have a lot of influence on. Much too complicated for someone that can barely read code like me, haha.
1526320496
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Sargent179 said: ?{Terrain type| Space, %{@{selected|character_name}|Space} | Land, %@{selected|character_name}|Land} } I'm surprised this worked at all. Attribute/ability calls aren't supposed to be nestable like this. But you can actually do this easier anyways: ?{Terrain type|Space, %{selected|Space} |Land, %{selected|Land}}