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

Clarification on Nesting Abilities and Queries...

The wiki is somewhat helpful but the wording doesn't include whether or not some things are possible.  Also, previous threads are not general enough. I want a character specific Ability to be called from another of that character's Abilities. ^ I can has. I want an Ability with a Query to call  a Abilities as the determinate cases for the output . ^ No  can has? Must use command syntax: &{template:<temp name>} {{[[<Button Name>]](<Ability>)}}     From my understanding, the problem is that a Query parses the Ability to a value, thus the dropdown box inputs the contents  of the ability, including/instead of the option name, then breaks the remaining options, since the Ability call does not resolve. I want an Ability to call multiple Attributes.  These attributes hold API commands. ^  No can has? Again, this parses and resolves only the first call? Here are more specific examples, though I felt the general references would be better suited to the forum.  Caveat; this is API and 5e[Shaped] Sheet dependent. Nesting problem: Toggle_Ability_On  %{<character_id>|repeating_racialtrait_<id>_action}   This works by itself. Toggle_Ability_Off  !token-mod --set tint_color|transparent aura1_color|9e5f9f aura1_radius|0 This also works, though only the final key|value is required. Toggle_Query  ?{<Query_Ability_Name>|%{selected|<Toggle_Ability_On>}|%{selected|<Toggle_Ability_Off>}} This is a no-go and must use a command button syntax? Attribute Calls: Attribute_Name1 !token-mod --set tint_color|transparent aura1_color|9e5f9f aura1_radius|0 This works by itself if called  in an Ability. Attribute_Name2 !roll20AM -audio,play,nomenu|<Track Name> Again, this works when called solo from an Ability. Ability_Name @{selected|Attribute_Name1}@{selected|Attribute_Name2} This does not work, only resolving the first call, whether they are on the same line or not.
1532317199
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, so, all of these are possible (in the general sense), however they may not be depending on your character sheet. So, starting with nestable abilities: Toggle_Query  ?{<Query_Ability_Name>|%{selected|<Toggle_Ability_On>}|%{selected|<Toggle_Ability_Off>}} The reason this is a no-go is that you are referencing a repeating ability of a character sheet (maybe the 5e OGL sheet?). Unless your sheet exposes the macro code somehow (ala the PF Community). If your sheet did expose the macro code, you would need to html encode problem characters in the ability which would make it work in the query, but no longer work when not called via the query. Also, you can get a option name to display that is different from the value selected like so: ?{Query Prompt|Option 1 Name,Option 1 Value|Option 2 Name, Option 2 Value} Note that you need at least two options for this to work. Now, for your attribute calls in sequence. There is no practical limit on how many attribute calls you can make. Putting attributes in sequence works just fine: [[@{strength_mod} + @{bab}]] => [[5 + 2]] => 7 It is also certainly possible to call multiple API commands via this method, but they do need to be on separate lines (I know you said you already tried this). @{selected|attribute_name1} @{selected|attribute_name2} So, let's check some things about your combined API macro. Let's make sure that we are in fact getting the API that we expect: attribute 1: @{selected|attribute_name1} attribute 2: @{selected|attribute_name2} This will give us an output that will show what the api commands would have been, but won't actually trigger the API.
Using 5e[Shaped] Sheet, which does allow for repeating abilities by <id>, with the syntax mentioned.  Using <Option> tags did not do much, as the query still displays the values within the Abilities inside the dropdown box, and the second <Option> does not function. This is what I'm currently working with on that front: %{-LEx46a7alUuz27TkS5j|repeating_racialtrait_-lexoazyz9usdfek7oup_action} !token-mod --set aura1_radius|0 ?{Necrotic Shroud |On, %{selected|NS_On} |Off, %{selected|NS_Off}}   I also tried it with and w/o html replacement, though the Roll20 wiki indicates under the heading Advanced Usage for Roll Queries : Due to the  order of operations ,  calls  (i.e. @{ Attribute }, %{ Ability }, # Macro ) are parsed to their  values  before Roll Queries are executed. For example, Attribute   calls   (e.g. @{selected|HP}) are parsed to (i.e. replaced by) either their Current   value   or their Max   value   (depending on whether that   call   contains the "max" flag, i.e. @{selected|HP|max}). Again, the (normally-problematic) characters that are part of Attribute and Ability  calls  are parsed to their  values   before  they can affect a Roll Query. Hence,  calls  are not problematic! Do not subject them to character replacements! Never do this: @{target|token_name} I even tried using syntax that would delineate the Ability by <id> within the query, both with and w/o replacement. The Attributes that it will not call within the same Ability are these, which I created for an Aasimar racial trait: Necrotic_Shroud_Aura: !token-mod --set tint_color|transparent aura1_color|9e5f9f aura1_radius|10 Necrotic_Shroud_Audio: !roll20AM --audio,play,nomenu|GhostlyScream The Ability: Necrotic_Shroud_On: @{selected|Necrotic_Shroud_Aura}@{selected|Necrotic_Shroud_Aura} Neither using a newline nor changing the order of the Attribute  calls  helped, it only does the first and ignores the second.  In fact, I resorted to making them Attributes specifically because using two API's within the same Ability wouldn't work either. I even abandoned this track and added the API calls directly to <Freeform> on the character sheet, which works just fine, however; calling an Ability within the Query keeps borking the dropdown and thus, not displaying the second Option.
1532353515

Edited 1532354421
I just game here this morning for this same issue. I'm trying to simplify my 5e OGL Saves Macro once I realized they support %{selected|npc_xxx_save} I initially tried this %{selected|npc_+?{Save|Strength,str|Dexterity,dex|Constitution,con|Intelligence,int|Wisdom,wis|Charisma,cha}+_save} That didn't work, and I just assumed I was trying to get too cute with it. So I then decided to try writing it all out like so. (simplifying so I don't have to type this all out) ?{Save|Strength,%{selected|npc_str_save}|Dexterity,${selected|npc_dex_save}} However when I do this, I get the following for a prompt. So then I assumed it was problem characters, so I changed it to ?{Save|Strength,%{selected|npc_str_save}|Dexterity,${selected|npc_dex_save}} However, this also does not fix it, and instead I get an error message in chat that reads  TypeError: Cannot read property 'substring' of undefined
Jeremy said: %{selected|npc_+?{Save|Strength,str|Dexterity,dex|Constitution,con|Intelligence,int|Wisdom,wis|Charisma,cha}+_save} That didn't work, and I just assumed I was trying to get too cute with it. So I then decided to try writing it all out like so. (simplifying so I don't have to type this all out) ?{Save|Strength,%{selected|npc_str_save}|Dexterity,${selected|npc_dex_save}} However when I do this, I get the following for a prompt. So then I assumed it was problem characters, so I changed it to ?{Save|Strength,%{selected|npc_str_save}|Dexterity,${selected|npc_dex_save}} However, this also does not fix it, and instead I get an error message in chat that reads  TypeError: Cannot read property 'substring' of undefined The first instance, I don't think you need the '+' character to concatenate, as that would indicate a mathematical operation.  Have you tried it without the '+'s? %{selected|npc_?{Save|Strength,str|Dexterity,dex|Constitution,con|Intelligence,int|Wisdom,wis|Charisma,cha}_save} **Edit** This might need to include @{<Attribute>} calls as well but maybe not since your ?Query is only outputting a string... **/Edit** In the second case, you shouldn't need to use replacement characters unless you are calling an %Ability from another %Ability or #Macro and even then, the replacement doesn't go into the call  in the new %Ability but rather, in the original  %Ability that you are calling.  In other words, say you wrote one ability for each save like this %Ability, let's name them Save_Attrx_wGM: /w gm {template:default} {{<Output_Field_Name>=@{selected|npc_<Attribute>_save}}} If you then tried to call  that %Ability from a new %Ability, you would have to go back and edit using replacement for the ones you were calling but not in the ?Query itself: ?{<Which_Save?>|Strength, %{selected|Save_AttrStr_wGM}|Dex, %{selected|Save_AttrDex_wGM}...} According to the Roll20wiki entry on Macros , it parses each %Attribute call  to a value before continuing with the query.  Any html replacement would have to be done back in our Save_Attrx_wGM %Ability definitions, if necessary. I think the problem that we are both running into is that the values  of the called  %Abilities is a Command, which our queries then treat as a string  then placing them into the query selection and breaking the rest of the query. What I believe  Scott C.  was getting at is that we would need to know the syntax for the sheet's &{template:<name>} when it makes the call(s)  to %{selected|<SaveOrAttribute>} then insert the entire text of the &{template:<name>}, possibly making an %Ability or #Macro as a copy of it but with html replacements, so that the ?Query syntax parses correctly.