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

Why does this work as a global modifier and not in a macro

1641168727

Edited 1641168871
I am trying to write a spell macro for firebolt.  It should produce a message in chat with damage rolled.  The roll should be the level appropriate number of dice. &{template:default}{{name=Firebolt}} {{Firebolt Deals=[[ ceil((@{selected|base_level})/4) ]]d10}} This is converted from: [[ceil((@{base_level})/2) ]]d6 used as a global damage modifier for sneak attack.
1641176424
Oosh
Sheet Author
API Scripter
If you're talking about the Roll20 5e sheet, the global fields are automatically wrapped in an inline roll when the macro is constructed. You'll need to do that manually since you're building the macro yourself: [[ [[ceil((@{base_level})/2) ]]d6 ]] Just checking, are you using homebrew for the spell mechanics? Because level/4 is not the correct cantrip progression for normal rules.
Firebolt increase in die at 5, 11, and 17.  if you use ceil then /4 will increase the die properly.  So you are saying that it should work if I incase the line in {}
1641307873
timmaugh
Pro
API Scripter
Double brackets: [[ ... ]] So you would turn this line: {{Firebolt Deals=[[ ceil((@{selected|base_level})/4) ]]d10}} ...into... {{Firebolt Deals=[[ [[ ceil((@{selected|base_level})/4) ]]d10]]}}
Interesting.&nbsp; I will try that. any suggestions here? <a href="https://app.roll20.net/forum/post/10583860/creating-a-spellbook-or-action-list-macro" rel="nofollow">https://app.roll20.net/forum/post/10583860/creating-a-spellbook-or-action-list-macro</a>
timmaugh said: Double brackets: [[ ... ]] So you would turn this line: {{Firebolt Deals=[[ ceil((@{selected|base_level})/4) ]]d10}} ...into... {{Firebolt Deals=[[ [[ ceil((@{selected|base_level})/4) ]]d10]]}} WORKED like a charm! Thank you.