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 .
×
May your rolls be chill this holiday season!
Create a free account

Using Group function [[{}kl1]] within a Dropdown query...

1676075008

Edited 1676075054
I cannot get this to work, I must be facing a limit to Query syntax I am not aware of... I'm trying to create a query for Cure spells for a cleric that has many Healing specializations, so the calculation is a little heavy... Here's the basic code I use: &{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{subtags=Casts ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[1d8+5]] HP. |    Cure Moderate Wounds, **Cure Moderate Wounds**. Target regains [[2d8+8]] HP. |    Cure Serious Wounds, **Cure Serious Wounds**. Target regains [[3d8+8]] HP. |    Cure Critical Wounds, **Cure Critical Wounds**. Target regains [[4d8+10]] HP. }}} This works fine, but I'm trying to replace the  [[xd8+y]] with what I actually need to use: &{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{subtags=Casts ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[floor(1d8 * 1.5) + [[{@{divinecasterlevel}+1,5*1}kl1]][Level] + 2*1[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Moderate Wounds, **Cure Moderate Wounds**. Target regains [[2d8+8]] HP. |    Cure Serious Wounds, **Cure Serious Wounds**. Target regains [[3d8+8]] HP. |    Cure Critical Wounds, **Cure Critical Wounds**. Target regains [[4d8+10]] HP. }}} I just adjusted the Cure Light Wounds part to show what I need to do. If I remove the kl1 part (i.e. + [[{@{divinecasterlevel}+1,5*?{Level?}}kl1]][Level] ), it works. I tried modifying the syntax, or event did tests with very simple kl1 functions, but as long as the kl1 group is present, the query fails. Is that a limitation or is there another way to write this? Thanks!
1676075921

Edited 1676076068
Gauss
Forum Champion
The problem you are probably running into is that you have all of this in a query. The moment you put "}" (from kl1) into a sub-line of the query the query thinks it is all done.  What you see your query as:  ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[floor(1d8 * 1.5) + [[{@{divinecasterlevel}+1,5*1}kl1]][Level] + 2*1[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Moderate Wounds, **Cure Moderate Wounds**. Target regains [[2d8+8]] HP. |    Cure Serious Wounds, **Cure Serious Wounds**. Target regains [[3d8+8]] HP. |    Cure Critical Wounds, **Cure Critical Wounds**. Target regains [[4d8+10]] HP. }}} What the system sees the query as:  ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[floor(1d8 * 1.5) + [[{@{divinecasterlevel}+1,5*1 } Solution: replace that last "}" with the HTML entity equivalent.  This should work:  &{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{subtags=Casts ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[floor(1d8 * 1.5) + [[{@{divinecasterlevel}+1,5*1 { kl1]][Level] + 2*1[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Moderate Wounds, **Cure Moderate Wounds**. Target regains [[2d8+8]] HP. |    Cure Serious Wounds, **Cure Serious Wounds**. Target regains [[3d8+8]] HP. |    Cure Critical Wounds, **Cure Critical Wounds**. Target regains [[4d8+10]] HP. }}} Note: you cannot put this in a Collection tab macro, it must go into an Ability macro. If you stick HTML entities in a collection tab macro they will revert to what they represent the next time you open the macro.  In the future, if you build more complicated queries, you may want to go the Chat Menu route instead. It is much easier to work with. 
Thank you so much! Yes, I use this in the Abilities tab of the character sheet, thanks for the heads up though. It didn't work, but it improved. I was able to get the dropdown choices to display correctly, but the calculation didn't work. First, I noticed that you had a typo, the right brace is } not { . But that correction didn't change anything, the dropdown worked, but not the calculation, it just displayed the actual code text, up to a point. I noticed the displayed result stopped right before the comma within the kl1 group. So I replace that comma with , and then it worked like a charm! (That comma interfered with the commas needed within the label/option part of the dropdown code itself.) The final code (in case people want to use something like this): &{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{notes=Casts ?{Spell|    Cure Light Wounds, **Cure Light Wounds**. Target regains [[floor(1d8 * 1.5) + [[{@{divinecasterlevel}+1,(5*1)}kl1]] [Level] + 2*1[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Moderate Wounds, **Cure Moderate Wounds**. Target regains [[floor(2d8 * 1.5) + [[{@{divinecasterlevel}+1,(5*2)}kl1]] [Level] + 2*2[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Serious Wounds, **Cure Serious Wounds**. Target regains [[floor(3d8 * 1.5) + [[{@{divinecasterlevel}+1,(5*3)}kl1]] [Level] + 2*3[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. |    Cure Critical Wounds, **Cure Critical Wounds**. Target regains [[floor(4d8 * 1.5) + [[{@{divinecasterlevel}+1,(5*4)}kl1]] [Level] + 2*4[AugmentHealing] + @{cha-mod}[Prestige] )]] HP. }}} Thanks again (and thanks for the tip about the Chat Menu, I didn't know it existed, I'll look into it)!
1676082065
Gauss
Forum Champion
Sorry, that is what I get for responding while half-asleep. You are correct it should have been 125, not 123. And yes, commas also have to be converted because that is also a query control character. 
No worries, that was still very helpful. You showed me the way and I learned something! Can I bother you some more? I looked at Chat Menus and it looks interesting. However, my dumb ass cannot figure out how we instantiate the menu itself so that it can appear in the chat panel. Do you keep the code in some place and then copy/paste when you need it? That must not be it, that wouldn't be very efficient... I read two articles, here and there , but I couldn't fathom on how to instantiate those amazing double columns chat menus with several buttons... After looking at it some more, I ended up creating a macro in the Abilities part of the character sheet and I placed a button in the macro bar to call that chat menu macro. Is that the way it should be done? Thanks!
1676164318
Gauss
Forum Champion
This is my macro for a Chat Menu spell level macro: /w @{selected|character_name} &{template:npcaction}{{rname=@{selected|character_name}}}{{name=@{selected|npc_type}}}{{description=**Select Spell Level** [Entire Spell List](~selected|Master Spell List) [Cantrip](~selected|Cantrip) [Level 1](~selected|Level1) [Level 2](~selected|Level2) [Level 3](~selected|Level3) [Level 4](~selected|Level4) [Level 5](~selected|Level5) [Level 6](~selected|Level6) [Level 7](~selected|Level7) [Level 8](~selected|Level8) [Level 9](~selected|Level9) }} &{noerror} This is what it looks like:  Each button leads to a different macro. 
Gauss said: This is my macro for a Chat Menu spell level macro: /w @{selected|character_name} &{template:npcaction}{{rname=@{selected|character_name}}}{{name=@{selected|npc_type}}}{{description=**Select Spell Level** [Entire Spell List](~selected|Master Spell List) [Cantrip](~selected|Cantrip) [Level 1](~selected|Level1) [Level 2](~selected|Level2) [Level 3](~selected|Level3) [Level 4](~selected|Level4) [Level 5](~selected|Level5) [Level 6](~selected|Level6) [Level 7](~selected|Level7) [Level 8](~selected|Level8) [Level 9](~selected|Level9) }} &{noerror} Each button leads to a different macro.  Unfortunately Jean-Guy is not playing 5E, so it (and any other sub-menus) have to be modified for 3.5E.  Jean-Guy, the best approach is to create a ‘Macro Mule’ character that holds all of the chat menus that you want as Abilities, then call those chat menus from a separate macro (could be an ability on each character, or a Collection macro).  For example if the Macro Mule character was named ‘Macros’, and the Ability on ‘Macros’ was named ‘ChatMenu’, then you would create a separate Collection macro (you can name it whatever you want) with this code to call the chat menu: %{Macros|ChatMenu} The ‘ChatMenu’ code would look similar to what Gauss posted above. Then you would have additional Abilities for chat menu macros named ‘AllSpells’, Level1Spells, etc.  If you want to see an example of a ultra-complicated version of that for D&D 5E, you can look at my Universal Chat Menu approach. It would have to be heavily modified for your use case, but it is possible. 
1676178763
Gauss
Forum Champion
Jarren said: Unfortunately Jean-Guy is not playing 5E, so it (and any other sub-menus) have to be modified for 3.5E.  Oops, missed that, thanks.