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

Initiative Macro, Prompt and &{tracker}

1447499124

Edited 1447499281
Phoxounet
Sheet Author
Translator
Hi there ! I am almost new to Roll20 but I and my fellow players already really enjoy it. Really nice vtt ! Anyway, I have a small problem with an intiative macro. I made a prompt to ask wich initiative condition a player will use and then the macro should rolls for initiative and add the token to the tracker. I made separate macros (one for each condition) and it works like a charm. However, my prompt macro does not work at all. I am pretty sure that closing brackets of the &{tracker} function is the problem. I tried using the html tags but couldn't make it function. base macro : /em tire son initiative et obtient ?{Condition d'initiative|Base, [[1D100!p>90cs>10cf<3 +@{Initiative}&{tracker} ]] | Vitesse du Ki, [[1D100!p>90cs>90cf<3 +45&{tracker} ]] | Initiative Maximum, [[1d100!p90cs>90cf<3 +90&{tracker}]]} I used the html tag  : /em tire son initiative et obtient ?{Condition d'initiative|Base, [[1D100!p>90cs>10cf<3 +@{Initiative}&{tracker} ]] | Vitesse du Ki, [[1D100!p>90cs>90cf<3 +45&{tracker} ]] | Initiative Maximum, [[1d100!p90cs>90cf<3 +90&{tracker}]]} With this formula, the macro behaves correctly except the tokens are not added to the tracker. Any idea ? Regards edit : damn, forgot that the closing bracket html tag would be transformed into the actual closing bracket itself so the 2nd macro does not look different than the 1st one.. ><
Order of operations doesn't allow for queries to pull attributes from the sheet inside the query itself. @{Initiative} is an attribute from the character's sheet. If you did the query for the value then did the math outside the query it would work. 
1447523417

Edited 1447525368
Ed S. said: Order of operations doesn't allow for queries to pull attributes from the sheet inside the query itself. Attributes can be placed inside Roll Queries, but are parsed to their value before the Roll Query executed. Generally, I'll recommend that elements common to all drop-down values within a Roll Query be factored out of the Query. In this case, the &{tracker} (which is likely the cause of your issues) could be placed outside of the Query. If you'd like, you could also get away with placing the square brackets as well as "1D100!p>90cf<3" outside of the Query, like so: /em tire son initiative et obtient [[ d100!p>90cf<3?{Condition d'initiative| Base,cs>10 + @{Initiative}| Vitesse du Ki,cs>90 +45| Initiative Maximum,cs>90 + 90 } &{tracker} ]]
1447529885

Edited 1447530080
Phoxounet
Sheet Author
Translator
Wonderfull !! Works like a charm ! thx, Silvyre ;) Here is the final macro : /em tire son initiative et obtient [[1D100!p>90cs>90cf<3 +@{Initiative} + ?{Condition d'initiative|Base, 0 | Vitesse du Ki, 10| Initiative Maximum, 60} &{tracker} ]] Much more simple than the 1st I made and functional. Perfect ;)