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

Help needed with variable table name inside a macro...

1558428070

Edited 1558428146
Ray
Pro
Greetings oh wise ones...I require help with the following code... The problem is highlighted in BOLD &amp;{template:default}{{@{selected|token_name} inflicts [[1t[dc(3+{{@{selected|str}-10}/5})a]]] [*Killing*]( <a href="http://journal.roll20.net/handout/-LLEgjEskeIUBG-YvkFB" rel="nofollow">http://journal.roll20.net/handout/-LLEgjEskeIUBG-YvkFB</a> ) BODY against [[1t[HitLocsK]]]}} I am trying to call a variable table name...in the example above the variable name is:&nbsp; "dc (3 + ((character's str - 10) / 5)) a"&nbsp; e.g&nbsp; dc4a (for str of 15) Can anyone figure out a code solution for this? Thanks in advance. Ray
try enclosing the math part of your name in double square brackets to force it to be evaluated to its result first.
1558461044
GiGs
Pro
Sheet Author
API Scripter
In addition to Aranador's suggestion, you might need a rounding function to make sure after dividing by /5 the table name isn't something like dc3.2a Also you have one set of squiggly brackets { } where you should have (). &nbsp;[[1t[dc [[ 3+ ceil(( @{selected|str}-10 ) /5 )]] a]]]&nbsp; Ceil() always rounds up. If you need to round down, use floor() . If rounding the nearest, use round() Also, make sure all possible tablenames you can roll actually exist.
Thanks guys...I will try this solution...