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 .
×

Nested Macro question

Hi I'm playing 4th ed D&D and most of the rolls are based on checks against a stat so I made stat check macros like [[1d20+@{char name|Dex}+?{modifier|0}+#lvl2 ]] for example. When using this to make an attack I'm trying to make a macro that adds implement and other consistant bonuses relative to that attack for example /em Eldritch Blast vs Reflex [[@{implement}+ {#Con_test }]] to hit [[1d10+@{implement} +@{Con}]] Damage [[1d6]] If under Warlocks Curse The problem is when I try to run this it asks for the modifier so it is calling the check, but nothing is ever displayed... if I change the second line to /r and remove the [[ ]] it works but takes multiple lines and can't add flavor text inline...what am I doing wrong?
1388958992
Gauss
Forum Champion
Please post all macros and abilities so I can better understand where the problem is. Example: Macro: #attack /roll 1d20 +@{strength} Attribute: @{strength} 5 / blank etc.
1388967027

Edited 1388967161
D J
Pro
Ok here goes... macro: #con_test [[1d20+@{selected|Co}+floor(@{selected|Lvl}/2)+?{modifier|0}]] attribute: @{co} 2/0 @{lvl} 1/0 @{implement} 2/0 this macro rolls 1d20 adds the constitution bonus + half character level + user entered modifier to account for things like combat advantage, or bless this macro works the problem comes when I try to use it inside another macro. macro: #eldblast /em Eldritch Blast vs Reflex [[@{implement}+ {#Con_test }]] to hit [[1d10+@{implement} +@{Con}]] Damage [[1d6]] If under Warlocks Curse this macro and a dozen others r supposed to get bonuses specific to an attack or skill check add them to results for contest or other stat check and add flavor text. In the above macro I am prompted to enter the modifier, enter it and....nothing...nothing comes up in chat at all, no error message no results, no flavour. macro: #eldblast /em Eldritch Blast vs Reflex /r @{implement}+ {#Con_test } to hit [[1d10+@{implement} +@{Con}]] Damage [[1d6]] If under Warlocks Curse this one works but more dice math is shown than I wanted and "to hit" is on another line again taking more chat window than I was aiming for. results look like: Kairn Eldritch Blast vs Reflex Kairn: rolling 2+ 10 2+10 = 12 to hit 15 Damage 6 If under Warlocks Curse Goal was: Kairn Eldrith Blast vs Reflex 12 to hit 15 Damage 6 if under warlocks curse I hope that clears things up a little ps thank you in advance for your time
You might want to try %{selected|Con_test}.
1388978819

Edited 1388978931
GiGs
Pro
Sheet Author
API Scripter
This syntax is wrong: {#Con_test } Should be #{Con_test } for macros or as Shane suggests, %{Con_test } if referring to an ability on a sheet (and you might need to use %{Selected|Con_test }
% is for abililities and Con_test is a macro...built it like that so I can use it for any critters i use as well as characters or npcs
1388984700

Edited 1388984725
Gauss
Forum Champion
Ok, I see the problem. You are putting one inline roll in another. By putting #con_test in an inline roll you are getting: [[@{implement}+ { [[1d20+@{selected|Co}+floor(@{selected|Lvl}/2)+?{modifier|0}]] }]] You cannot put one inline roll in another.
thank you I never would have found that I have to adjust my thinking about []
if I remove the [[ ]] from inside the #con_test then it is looked at as text and not math so when called it simply writes out what I want it to do but doesn't do it... if I put /r same thing... if I leave #con_test inline than the text doesn't come out how I'd like... breaks up lines ends emotes, you get the idea...if anyone can think of how this can be done I would greatly appreciate it
1389072751
GiGs
Pro
Sheet Author
API Scripter
If you remove the roll from con_test, and add it later, it should work For instance make con_test = @{selected|Co}+floor(@{selected|Lvl}/2) Then have two separate macros For actually rolling CON: 1d20 + #con_test + ?{modifier|0} and for your macro, on the lin which uses con_test (I haven;t tested this but you can see what i mean): [[@{implement}+ 1d20+ {#Con_test } + ?{modifier|0}]] to hit
Thank you for your help, I had hoped Con_test and its brothers for the other 5 stats would include everything just because they are used in every attack, skill check etc. The more inclusive they are the less redundant code is necessary.