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

macro/inline roll with conditions (if...)

1468824476

Edited 1468824501
[Deleted]
Sheet Author
What can I do for a macro to  roll (1d6r<2)-2          if the character is unskilled (no checked box) roll on called attributes    if the character is skilled (some checked boxes) I  already tried using a roll querry (in a template) &{template:default} {{name=skill Test}} {{?{Do you have any skill?|unskilled,[[(1d6r<2)-2]]|skilled,[[@{skill_toughbastard1}d6 @{skill_toughbastard2}d6 @{skill_toughbastard3}d6 + @{upgrades24}]]}}} {{note= This is a skill test}} But I do not want the players to be asked for every roll.  I would like the roll to be only a simple "click and automatic choice" depending on the conditions.
If the Attribute corresponding to the skilled check box is named @{checkbox}, you could use something like this: Result: [[ [[1 - @{checkbox}]]d6r<2 - [[2 * (1 - @{checkbox})]] [← Unskilled] + [Skilled →] [[@{skill_toughbastard1} * @{checkbox}]]d6 [[@{skill_toughbastard2} * @{checkbox}]]d6 + [[@{skill_toughbastard3} * @{checkbox}]]d6 + [[@{upgrades24} * @{checkbox}]] ]]
the skills checkboxes are actually named @{skill_toughbastard1}  @{skill_toughbastard2} @{skill_toughbastard3}  each with a value of 1 But your answer gave me ideas. I will try the beginning
I finally got that to work and display both unskilled and skilled dice results. ("upgrade24" is also a box but a modifier applied to the final result, not a die roll) &{template:default} {{name=skill Test}} {{unskilled=[[ (1 - @{skill_toughbastard1})d6r<2 -2)]]+ @{upgrades24}}} {{skilled=[[@{skill_toughbastard1}d6]] [[@{skill_toughbastard2}d6]] [[@{skill_toughbastard3}d6]] + @{upgrades24}}} {{note= This is a skill test}} It will display the 2 possibilities (unskilled/skilled) and give a negative result for "unskilled" if any skill box is checked; it will give 0 results in "skilled" for each dice if no skill box is checked.
Nice!
a function that checks if "toughbastard1" box is value 0 and displays the "unskilled" result  or value 1 and displays the "skilled" result would be better but I have at least got a useful result so far.
guillaume t. said: a function that checks if "toughbastard1" box is value 0 and displays the "unskilled" result  or value 1 and displays the "skilled" result would be better but I have at least got a useful result so far. You might find this post helpful. (More specifically, I would recommend PowerCards for this application.)