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

Spell query as a token action from a PC sheet

1509657690

Edited 1509657925
First off i'm sorry if this is posted anywhere but after a whole day i still couldn't find the solution so i thought why not ask here? I wrote the following macro in an attempt to make a query for using spells but i keep getting options that are wrong and when choosing one of the wrong options it will only ececute the third spell @{selected|wtype}&{template:spell} {{Spell=?{Spell|HoT, [[@{selected|repeating_spell-1_$0_rollcontent}]] |HM, [[@{selected|repeating_spell-1_$1_rollcontent}]] |ES, [[@{selected|repeating_spell-1_$2_rollcontent}]]}}} Any help would be super apreciated. edit: i'm using the 5e OGL sheet
1509682384

Edited 1509682708
A couple things that I notice about your macro and I am in no way an expert. The correct call for repeating spells is&nbsp;%{selected|repeating_spell-cantrip_$0_spell}. See&nbsp; <a href="https://wiki.roll20.net/5th_Edition_OGL_by_Roll20" rel="nofollow">https://wiki.roll20.net/5th_Edition_OGL_by_Roll20</a> for more info under Dynamic References to Repeating Sections . You also don't need the double square brackets in order to roll it. Just putting the above ability call in a macro calls that spell. You don't need the template call at the beginning because that is the format each spell is already in which is the reason it will not work when using a roll query. Even when you escape characters it will not parse the roll template correctly when it is in a roll query. More info on that can be found here&nbsp; <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> under&nbsp; Advanced Usage for Roll Queries . Edit: Something else I noticed. @{selected|wtype} doesn't work when whisper is set to toggle.
Matt said: A couple things that I notice about your macro and I am in no way an expert. The correct call for repeating spells is&nbsp;%{selected|repeating_spell-cantrip_$0_spell}. See&nbsp; <a href="https://wiki.roll20.net/5th_Edition_OGL_by_Roll20" rel="nofollow">https://wiki.roll20.net/5th_Edition_OGL_by_Roll20</a> for more info under Dynamic References to Repeating Sections . You also don't need the double square brackets in order to roll it. Just putting the above ability call in a macro calls that spell. You don't need the template call at the beginning because that is the format each spell is already in which is the reason it will not work when using a roll query. Even when you escape characters it will not parse the roll template correctly when it is in a roll query. More info on that can be found here&nbsp; <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> under&nbsp; Advanced Usage for Roll Queries . Edit: Something else I noticed. @{selected|wtype} doesn't work when whisper is set to toggle. Thank you so much for the help so far. I changed the macro because my character doesn't have any cantrips to the following: ?{Spell|Hail of Thorns, %{selected|repeating_spell-1_$0_spell} |Hunter's Mark, %{selected|repeating_spell-1_$1_spell} |Ensnaring Strike, %{selected|repeating_spell-1_$2_spell}} The results: Same query still broken (options aren't showing properly; i do see Hail of Thorns but the following options are still whisper/public role instead off Hunters Mark & Ensnaring Strike). after selecting Hail of Thorns it still asks me for an input value with the text "Whisper&{template:spell:". note: could be that because the macro for casting the spell contains a level query there is a problem with the nesting of said level query? " Even when you escape characters it will not parse the roll template correctly when it is in a roll query. " I didn't fully grasp the meaning of this so this might be the answer. (I removed the text for easier viewing, for the rest it is the same) @{selected|wtype}&{template:spell} {{level=?{Cast at what level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4|Level 5,5|Level 6,6|Level 7,7|Level 8,8|Level 9,9}}} {{name=Hunter's Mark}} {{castingtime=}} {{range=}} {{target=}} {{v=1}} 0 0 {{material=}} {{duration=}} {{description=}} {{athigherlevels=}} 0 {{innate=}} {{concentration=1}} @{selected|charname_output} Again thank you for any help or tips you can provide me with.
there is a post some where on the forms about scorching ray menu system used to cast that spell at each level type and out put the correct amount of rays that may help you sort out some of the nest. i myself am no where near good enough to debug for you thou.&nbsp;
lordmage said: there is a post some where on the forms about scorching ray menu system used to cast that spell at each level type and out put the correct amount of rays that may help you sort out some of the nest. i myself am no where near good enough to debug for you thou.&nbsp; Thanks for the suggestion, I'll look for it and see if it helps. :D
Michiel B. said: note: could be that because the macro for casting the spell contains a level query there is a problem with the nesting of said level query? " Even when you escape characters it will not parse the roll template correctly when it is in a roll query. " I didn't fully grasp the meaning of this so this might be the answer. Yes, this is why. Escaping characters means that you use a replacement 'code' in place of the actual character. For example, using '&amp;' instead of '&' character. This allows the compiler, the browser in this case, to parse the information correctly. The reason this is needed, in this case, is due to how the roll query starts and ends. A roll query begins with the first open curly bracket '{' and ends on the first closed curly bracket '}'. Also, keeping in mind that all information in roll queries are parsed prior to the actual roll of that query. Using your example:&nbsp; ?{Spell|Hail of Thorns, %{selected|repeating_spell-1_$0_spell} |Hunter's Mark, %{selected|repeating_spell-1_$1_spell} |Ensnaring Strike, %{selected|repeating_spell-1_$2_spell}} The query will parse this &nbsp;' %{selected|repeating_spell-1_$0_spell}' information prior to doing the actual query and because every sheet roll uses the character sheet's built in template, it won't work correctly. So prior to running the query it will look like this (with all the proper spell information being filled in the template): ?{Spell|Hail of Thorns,&nbsp; &{template:spell} {{level=school level}} {{name=name}} {{castingtime=castingtime}} {{range=range}} {{target=target}} {{v=1}} {{s=1}} {{m=1}} {{material=material}} {{duration=duration}} {{description=description}} {{athigherlevels=athigherlevels}} {{ritual=1}} {{concentration=1}} {{charname=charname}}|&nbsp;Hunter's Mark,&nbsp;&{template:spell} {{level=school level}} {{name=name}} {{castingtime=castingtime}} {{range=range}} {{target=target}} {{v=1}} {{s=1}} {{m=1}} {{material=material}} {{duration=duration}} {{description=description}} {{athigherlevels=athigherlevels}} {{ritual=1}} {{concentration=1}} {{charname=charname}}|Ensnaring Strike,&nbsp; &{template:spell} {{level=school level}} {{name=name}} {{castingtime=castingtime}} {{range=range}} {{target=target}} {{v=1}} {{s=1}} {{m=1}} {{material=material}} {{duration=duration}} {{description=description}} {{athigherlevels=athigherlevels}} {{ritual=1}} {{concentration=1}} {{charname=charname}}} This will not parse correctly because the first closing curly bracket it sees is at the end of &nbsp; &{template:spell}, which isn't the end of your macro. This is why you see 'Hail of Thorns,&nbsp;&{template' etc. in the drop down and, as far as I know and have tried, roll queries won't work with rolls that are already in the form of a roll template without being able to escape characters. Unfortunately, with what you are trying to accomplish, escaping those characters can't be done as the template is inherent to that character sheet and the ability you are trying to call. For reference here is an example of escaping characters ( <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> ): ?{Name of Query| Label 1, ?{value1| Label 1A, ?{value1A&#124; Label 1Ai&#44; value1Ai &#124; Label 1Aii&#44; value1Aii &#125; | Label 1B, ?{value1B&#124; Label 1Bi&#44; value1Bi &#124; Label 1Bii&#44; value1Bii &#125; } | Label 2, ?{value2|value2} } This is all done inside the roll query itself without trying to call something else associated with a template. I know this doesn't help your problem but I hope it helps clarify.