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

Need help with a drop down macro

Hi everyone, I'm trying to make a drop down macro for my players to use when casting spells. So far most of them work, until I try to add the one for Sacred Flame. I'm not understanding why it doesn't work, because it seems when I'm adding the part about the spell DC is the part that stops it from working. I've tried going step by step, literally adding word for word and symbol (or HTML character replacement) by symbol, and when I add the closing "}" for the DC part that's when it shuts down and won't even show the template for Sacred Flame. Here is the code I'm working with so far, the bold and italicized portion is the area where it is messing up: &{template:default} {{name= Spell}} {{Action= ***@{selected|token_name}*** casts ?{What spell would you like to cast?|Guiding Bolt, &{template:default} {{name= Guiding Bolt, 1 Action, 120', 1 round, Evocation}} {{Components= V, S}} {{Action= There is a bright light that streaks through the sky to the target.}} {{Attack vs AC= [[d20+@{Spell Cleric}]]}} {{Damage= [[4d6]] Radiant}} {{Effect= Target has a dim glittering light surrounding it. Next attack roll to this target has Advantage.}} {{Upgradable= 1d6 extra per level over 1st}}|Inflict Wounds, &#amp;{template:default} {{name= Inflict Wounds, 1 Action, Touch, Instant, Necromancy}} {{Components= V, S}} {{Action= Says, "This is going to hurt!"}} {{Attack vs AC= [[d20+@{Spell Cleric}]]}} {{Damage= [[3d10]] Necrotic}} {{Effect= }} {{Upgradable= 1d10 extra per level over 1st}}|Sacred Flame, &{template:default} {{name= Sacred Flame, 1 Action, 60', Instant, Evocation}} {{Components= V, S}} {{Action= mumbles a few words!}} {{Target= Enemy target.}} {{DC= DEX [[@{Spell DC Cleric}]]}} {{Failed Save= [[1d8]] Radiant}} {{Successful Save= Take no damage!}} {{Effect= Flame-like radiance descends on the target! The target gains no benefit from cover for this saving throw.}} {{Upgradable= Add 1d8 at 5th level, 11th level, and 17th level.}}|Spell 2, **What's this**}}} Any help with this would be appreciated, Thanks everyone.
1445294612
Silvyre
Forum Champion
Can you post the macro with HTML entities intact as well as the formula for the @{Spell DC Cleric} attribute?
What do you mean with "HTML entities intact"? As for the @{Spell DC Cleric}, it's just referring to the Attribute for the character which is set at 15.
1445295713

Edited 1445295739
Silvyre
Forum Champion
Arthur B. said: What do you mean with "HTML entities intact"? Something that looks like this: &{template:default} {{name= Spell}} {{Action= ***@{selected|token_name}*** casts ?{What spell would you like to cast?|Guiding Bolt, &{template:default} {{name= Guiding Bolt, 1 Action, 120', 1 round, Evocation}} {{Components= V, S}} {{Action= There is a bright light that streaks through the sky to the target.}} {{Attack vs AC= [[d20+@{Spell Cleric}]]}} {{Damage= [[4d6]] Radiant}} {{Effect= Target has a dim glittering light surrounding it. Next attack roll to this target has Advantage.}} {{Upgradable= 1d6 extra per level over 1st}}|Inflict Wounds, &#amp;{template:default} {{name= Inflict Wounds, 1 Action, Touch, Instant, Necromancy}} {{Components= V, S}} {{Action= Says, "This is going to hurt!"}} {{Attack vs AC= [[d20+@{Spell Cleric}]]}} {{Damage= [[3d10]] Necrotic}} {{Effect= }} {{Upgradable= 1d10 extra per level over 1st}}|Sacred Flame, &{template:default} {{name= Sacred Flame, 1 Action, 60', Instant, Evocation}} {{Components= V, S}} {{Action= mumbles a few words!}} {{Target= Enemy target.}} {{DC= DEX [[@{Spell DC Cleric}]]}} {{Failed Save= [[1d8]] Radiant}} {{Successful Save= Take no damage!}} {{Effect= Flame-like radiance descends on the target! The target gains no benefit from cover for this saving throw.}} {{Upgradable= Add 1d8 at 5th level, 11th level, and 17th level.}}|Spell 2, **What's this**}}}
1445296845

Edited 1445296940
What I posted in the initial post is just about the same thing as what you have just above. It is what I have for the code so far and I got stuck. If you're meaning with the grey box around it I'm not sure how to do that part. I was just looking at the code you have up above and joticed that the beginning brackets "{{" are not replaced with the HTML format. is it ok if those are not coded out?
1445297562
Silvyre
Forum Champion
Arthur B. said: What I posted in the initial post is just about the same thing as what you have just above. "Just about" isn't going to cut it. I'm almost certain your issue lies with the your use of HTML entities (character replacements). So, I can't really help you further until I see your macro with the HTML entities intact (unconverted). The forum converts HTML entities to characters—it might be easier for you to take a screenshot of your macro in whole and post it here. Arthur B. said:  I was just looking at the code you have up above and joticed that the beginning brackets "{{" are not replaced with the HTML format. is it ok if those are not coded out? Usually.
Ok, I'm putting a screen shot of the code I have written so far. The trouble part is in the GREEN text. I've tried leaving the "*", & "@" regular and changed to HTML and neither works for me. As soon as I close the section with the "}" (or HTML counterpart) it won't even put any of the template in the chat. Anyway, here is the screen shot: Thanks for your help so far.
Also, it won't let me add @{selected|token_name} in any of the options, if you could help with that as well. I've tried coding every symbol with HTML as well as only coding some of the symbols, and nothing works. It does the same thing as when trying to add the attribute caller for the Spell DC Cleric so far as not showing any of the template at all in chat. Don't know if maybe the drop downs have a problem with the "@" symbol as a leading entity or what's going on, because it works perfectly fine when used with a roll.
1445301826

Edited 1445304849
Silvyre
Forum Champion
Due to the order of operations , Attributes nested within Roll Queries are fully expanded before the query is executed. This means that they should not be subject to character replacement.
OK, so when I remove the template tag, it won't show the "name=" tag, meaning that I don't get all the pertinent info such as what the name of the spell cast is, the action cost, range, duration, and school. I also just noticed that in the spells whenever there is a @{"Whatever"} it completely ignores it. I was running the spell through chat and noticed that it's not adding the attribute to the roll. So, for instance, I have [[d20+@{Spell Cleric}]], where "Spell Cleric" is 10, when run to chat it comes out as 16. When I hover to see what the formula for the roll was, I get just the amount rolled on the d20 and NOT the attribute added to the roll. No matter how I try to work it, either with some, all or no HTML entities, it never adds the attribute amount. Is it just something to do with trying to add templates to a drop down menu list? Is this something that can maybe be passed up to the Dev's to work on and see if they can fix it or not? Also would you help me to understand power cards with the API and can those have drop downs as well? I know I asked a lot, I hope you can help.
1445304446
Silvyre
Forum Champion
Arthur B. said: OK, so when I remove the template tag, it won't show the "name=" tag, meaning that I don't get all the pertinent info such as what the name of the spell cast is, the action cost, range, duration, and school. That's because of another redundancy; there's already a name field at the top of the macro. You'll probably want to rename the other fields. Arthur B. said: I also just noticed that in the spells whenever there is a @{"Whatever"} it completely ignores it. I was running the spell through chat and noticed that it's not adding the attribute to the roll. So, for instance, I have [[d20+@{Spell Cleric}]] , where "Spell Cleric" is 10, when run to chat it comes out as 16. When I hover to see what the formula for the roll was, I get just the amount rolled on the d20 and NOT the attribute added to the roll. No matter how I try to work it, either with some, all or no HTML entities, it never adds the attribute amount. Just to be sure; you're still testing this via Ability Macro, correct? Attributes can only be used without a character name flag via Ability Macro. Otherwise, pasting @{Spell Cleric} level into the chat directly or passing it through a General Macro will not work; you'd have to use @{Character Name|Spell Cleric}, @{selected|Spell Cleric} or @{target|Spell Cleric}. Arthur B. said: Also would you help me to understand power cards with the API and can those have drop downs as well? Here's a link to the PowerCards thread . It might be best if you posted any related questions in there, after you've read through the OP and tinkered around with them. And, yes; Roll Queries, along with 95% of Roll20 syntax currently functions very well with PowerCards.
1445304955

Edited 1445305076
Silvyre said: Arthur B. said: I also just noticed that in the spells whenever there is a @{"Whatever"} it completely ignores it. I was running the spell through chat and noticed that it's not adding the attribute to the roll. So, for instance, I have [[d20+@{Spell Cleric}]] , where "Spell Cleric" is 10, when run to chat it comes out as 16. When I hover to see what the formula for the roll was, I get just the amount rolled on the d20 and NOT the attribute added to the roll. No matter how I try to work it, either with some, all or no HTML entities, it never adds the attribute amount. Just to be sure; you're still testing this via Ability Macro, correct? Attributes can only be used without a character name flag via Ability Macro. Otherwise, pasting @{Spell Cleric} level into the chat directly or passing it through a General Macro will not work; you'd have to use @{Character Name|Spell Cleric}, @{selected|Spell Cleric} or @{target|Spell Cleric}. When I use my regular macros, doing something like [[d20+@{Spell Cleric}]] works just fine, but  (Disregard, just saw that you said Ability Macro and that's generally what I use. It's also what I'm using for my drop down spell macro.) I can't seem to get it to work inside the drop down menu formula. Also, when I try to do @{selected|"Whatever inserted here"} in the drop down formula, that also doesn't work. Even if I try to do it all with HTML entities, mix it up, or use none at all. Still nothing. I think the drop down formula has a problem with the "@" symbol, regardless of the formatting of that symbol.
1445306085
Silvyre
Forum Champion
Arthur B. said: I can't seem to get it to work inside the drop down menu formula. Also, when I try to do @{selected|"Whatever inserted here"} in the drop down formula, that also doesn't work. Could you elaborate on what you mean by "doesn't work"? Roll Queries should have no issues with the @ character.
1445306530

Edited 1445306628
It won't show the template at all in chat.  Nevermind, that is working. Must be something else that's throwing it off.
Just tried to use @{selected|Spell Cleric} to solve the problem of [[d20+@{Spell Cleric}]] not showing the @{Spell Cleric} in the roll formula and I get this error message: "No attribute was found for @{selected|Spell Cleric}]]}} {{Damage= [[4d6]] Radiant}} {{Effect= Target has a dim glittering light surrounding it. Next attack roll to this target has Advantage.}} {{Upgradable= 1d6 extra per level over 1st}}}" What is going on here?
1445306978
Silvyre
Forum Champion
Could you post a screenshot of your updated macro?
The highlighted section is now the part in question.
1445308258

Edited 1445308520
Silvyre
Forum Champion
Silvyre said: Please update your macro accordingly. And, please, bear in mind: Silvyre said: Attributes [...] should not be subject to character replacement.
OK, part of it is working now. it's adding the attribute parts. Can you tell my why the highlighted part is not coming through?
Also, the parts highlighted in BLUE are not showing up in the template?
1445310052
Silvyre
Forum Champion
Arthur B. said: Can you tell my why the highlighted part is not coming through? Its field isn't closed; you'd need to add }} either inside the Roll Query, or }} outside of it. Regardless, in renaming the "name" fields, you've swapped out one issue for another (that will also cause the highlighted field, even if closed, to still not display). In case it hasn't been made clear, Roll Queries cannot output two fields with the same name. If two fields have the same name, only the latter one will be output. On another note, I spot an extra } near the end of your macro.
1445310167

Edited 1445310187
Silvyre
Forum Champion
Arthur B. said: Also, the parts highlighted in BLUE are not showing up in the template? It's probably because the "Action" field that contains the Roll Query isn't closed. That should be fixed before all else.
So, in each of the queries I need to put a different tag for where the name tag used to be?
1445311502

Edited 1445311920
Silvyre
Forum Champion
You replaced {{name= with {{Action= because there was already a {{name= field earlier in the macro. This was done to address redundancy. However, there also already existed an {{Action= field in the macro (it currently contains the roll query). Hence, redundancy remains an issue. To finally solve this issue, you'll need to rename either the green {{Action= field or all of the black ones to something unique to the macro.
1445311902

Edited 1445311986
I tried to change the First Action to Casting and now all it shows is the header of the macro "Spell Book" and no other fields behind it. I'm beginning to think this is a lost cause.
1445312074

Edited 1445312297
Silvyre
Forum Champion
Have you yet closed the Action Casting field?
Just for kicks I tried just a simple macro with a template, which should have worked but didn't. This is my simple code: &{template:default} {{name= Spell Book}} {{Action= **@{selected|token|name}** casts a spell!!!}} All that came up was the title of the template Spell Book in a purple box.
Silvyre said: Have you yet closed the Action field? Yes, I made sure it was closed.
1445312336
Silvyre
Forum Champion
Arthur B. said: @{selected|token | name} @{selected|token _ name}
Silvyre said: @{selected|token _ name} That's what I put in the code, just typed it wrong in the last post. Lol, think I'm getting tired. Too much trying to figure this out.
1445312539
Silvyre
Forum Champion
Could you post another screenshot of your updated macro?
1445313241
Silvyre
Forum Champion
Sorry; I erroneously mentioned that placing }} outside of the query was an option. Instead, you'll need to place }} right before each {{Spell=
Ok, I will try that later. Going to bed now, unfortunately have to work tomorrow. will let you know the outcome.
1445314076
Silvyre
Forum Champion
Please do. This should be the last necessary change.