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

Warhammer 40k Black Crusade Macro

So i was trying to set up a macro that produces a table combined with a couple drop down menues. What it should basically look like is that you get a drop down where you first get to choose your characteristics (e.g. Intelligence) then depending on what you chose it shows you the target score you have to beat in the next column named target which is provided by adding the ability score + a modifier. Then in the next column it is supposed to roll a d100 and in the last collumn substract the rolled d100 from the target score.  I dont know if you understand what i mean :D What i have so far is this: &{template:default}{{name = Ability Test}}{{Ability = ?{Characteristics |Willpower, **Willpower**|Intelligence, Intelligence} I just dont know if it is possible with macros to refer to another column or if it would be possible that if i choose Willpower from the dropdown menu it creates another column called "Target" which would be filled with @{Willpower} +?{modifier|0} or if I need API for that...
1530125013

Edited 1530125178
The Aaron
Pro
API Scripter
Probably to be truly happy, you'd need the API.  You can't reference a roll result in a chat command like that. You also won't be able to show 2 different values from the same dropdown (both the bonus and the name).  The closest you can get is probably something like this: &{template:default}{{name = Ability Test }}{{Ability = ?{Characteristics|Willpower, @{selected|willpower} [Willpower]|Intelligence, @{selected|intelligence} [Intelligence]} }}{{Target = [[ (?{Characteristics})+?{Modifier|0}]] }}{{Result = [[ 1d100-((?{Characteristics})+?{Modifier}) ]] }} Assuming I wrote that right, it should so something akin to: Ability Test Ability 3 [Intelligence] Target [4] Result [63] with those last 2 numbers as inline rolls.
Thank for the code. This is actually pretty close to what I wanted. I thought that if I used a query multiple times I had to chose it every single time. But it actually only asks me once. Thats great to know. Thank you so much.
1530125886
The Aaron
Pro
API Scripter
Yep.  You are only queried once for each unique label in a roll query: ?{LABEL|ARG 1|ARG 2|...} And you don't need to repeat the arguments after the first one.  For ?{Characteristic} I'm taking advantage of the roll label syntax [text]  to create a value that is presentable but also usable in the inline rolls. [[ (3 [Intelligence])+0 ]]
One more question. Is it possible to reuse a rolled dice with macros? Because I would also like to have the degrees of success which is basically the result divided by 10. So a Result of 45 would be 4 degrees of success. However when i use two 1d100 seperatly it rolls them seperatly aswell
1530129598
The Aaron
Pro
API Scripter
It is not.  You can use a bit of math trickery to end up with the degrees of success as a decimal place:  [[ floor(((1d100-((?{Characteristics})+?{Modifier}))*1.001)*100+0.01)*0.01 ]] }} This should give you a value like 67.06 where 67 is the roll and 6 is the number of successes.