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 for colored dices ?

Hi everyone, I am pretty new on roll20 and it is already amazing! Wiht my team, we are playing a rollplay by the name of SHAAN, the system for this game is a little complicated and you need to roll 4 dices separated and with 4 differents colors. ROLL20 having is own language, its really difficult to code for me, so i was wondering if you would be my angels coming from the skies with the knowledge of the ancients scribes ? What this macro need to do : launch 4 separated dices with one red, one blue, one yellow, one black. If not possible, maybe adding colored texts to each roll ? Thanks for helping and sorry for my bad english, i am french so Bonjour et merci d'avance! :)
1436189489

Edited 1436189523
DXWarlock
Sheet Author
API Scripter
You can do this: &{template:default} {{name=SHAAN Rolls}} {{Red=[[1d20]]}} {{Blue=[[1d20]]}} {{Yellow=[[1d20]]}} {{Black=[[1d20]]}} which returns this: And change the 1d20 to whatever dice value its suppose to be. You can also just do: Red:[[1d20]] Blue:[[1d20]] Yellow:[[1d20]] Black:[[1d20]] But the output isnt as fancy:
So no way to add color directly like with a color code HTML ?
1436190770
DXWarlock
Sheet Author
API Scripter
Not to the dice rolls, the yellow is the default color of the returned numbers :\ Without an API script no way parse the results and color code the numbers as html text.
1436191064

Edited 1436191120
Lithl
Pro
Sheet Author
API Scripter
The best you could do is to manipulate the critical success/critical failure values to make an inline roll yellow, red, green, or blue. 1d20cf0cs0 will never be a crit or a fumble, so it will always be yellow. 1d20cf0cs>1 will always be a crit, so it will be green. 1d20cf>1cs0 will always be a fumble, so it will always be red. 1d20cf>1cs>1 will always be both a crit and a fumble, so it will always be blue. Of course if you do this, you cannot quickly and easily see actual crits/fumbles.
1436191299
DXWarlock
Sheet Author
API Scripter
ahh i didn't think of that, using the max/min/both outlines as colors since they are the same. Very sneaky and creative Brian :)
Hmm will testing this macro, i don't have exactly what you have : What the purpose of the } ? Also it doesn't launch them together and sometimes cut the rolls :/
1436267333

Edited 1436267653
DXWarlock
Sheet Author
API Scripter
The { and } let it know its part of the rolltemplate (the fancy box) the first one tells it what template to use (which unless you have a character sheet with ones defined, default is the safest bet as everyone can use it) , the next what to put in the purple box (name the title) , and the rest, as many as you want, add rows for each one. the wiki on roll templates: <a href="https://wiki.roll20.net/Roll_Templates" rel="nofollow">https://wiki.roll20.net/Roll_Templates</a> It has to be all one line. Hitting enter makes it think its a new command separate from the one above. Why the title and purple box work, but the rest dont, as that is the first line in itself. try this it should do what you want, just change the names of the colors to the words you want: (it may wrap in the window due to space, thats fine. Long as you arent manually forcing a linebreak enter). &{template:default} {{name=ShaanRoll}} {{Red=[[1d10cf0cs0]]}} {{Blue=[[1d10cf0cs0]]}} {{Yellow=[[1d10cf0cs0]]}} {{Black=[[1d10cf0cs0]]}}
1436267838

Edited 1436268983
Oh so that's how it works! Thanks OK last thing now ^^ i want to change the range of the dice (roll20 uses a dice10 from 1 to 10 and i want it from 0 to 9) so the command would be [[1d10-1]] but what would be the best way to add it ?
1436279591

Edited 1436279830
DXWarlock
Sheet Author
API Scripter
Yea that's the easiest way, and that will give you 0-9 every time. Since using a [[1d9]] would give you 1-9. For adding and keeping the colors, it maybe someone else can chime in. Since I cant seem to get the crit/fumble to understand negative numbers (you would need -1 vs 0, since you can get a 0 result)
Is it possible to do the test so the number keep the colors and after do the -1 ?
1436283131
Lithl
Pro
Sheet Author
API Scripter
1d10cf0cs0-1 and so on. The cs/cf are modifiers to the dice, then you subtract from the final result.
It works perfectly ! Thank you everyone ^^