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 Help

Ok, i want a macro to roll a random number between -10 to 10, so it wiil range from 10 to -10.  I havent been able to figure it out.  Any help?
1455075233
Diana P
Pro
Sheet Author
[[d21-11]] will give you a range from -10 to 10 ...
1455075235
Silvyre
Forum Champion
Sure; I'll give you the macro and explain how I got it! [[ -11 + d21 ]] is an inline dice roll . It's basically just a more compact version of /roll -11 + d21 ?{Min} and ?{Max} are Roll Queries , which allow you to include variable input within a macro. So, [[ [[?{Min|-10} - 1]] + d[[?{Max|10} - (?{Min} - 1)]] ]] This is the "roll formula" that produces "one die that rolls between two variables (i.e. minimum and maximum values)". To get a die that rolls between the variables -10 and 10, you would input -10 into the ?{Min} Roll Query, and 10 into ?{Max}. This would result in... [[ [[-10 - 1]] + d[[10 - (-10 - 1)]] ]] = [[ [[-11]] + d[[10 + 11]] ]] = [[ -11 + d[[21]] ]] = [[ -11 + d21 ]] Let me know if you have any questions!
1455075332

Edited 1455075498
Sweet thanks  :) You know that was so simple I dont know why I had such a hard time.  I had d30-11
OK here is another question.  Is it possible to make a macro that will roll random numbers and have each number represent something?  Im working on a high tech space game and I wont to roll random planetary stats and other stuff.
1455144535

Edited 1455144966
Silvyre
Forum Champion
QRob001 said: Is it possible to make a macro that will roll random numbers and have each number represent something? Something like this? Mass: [[ [[1d9]]e[[19 + 1d[[1d11]]]] ]] kg Moons: [[ 1d[[1d[[1d100]]]] - 1 ]] Current distance from star: [[ 1d[[1d1000]] / 10d10 ]] AU
Yes something like that, can you explain a little how that works?  I could live with that, or is there a way to have like each number in a d10 = something.  Like roll d10, 1 = Canine, 2 = Feline, 3 = humanoid etc.?
Also can one macro call another one?
1455148915

Edited 1455149054
Silvyre
Forum Champion
QRob001 said: Yes something like that, can you explain a little how that works? Oh, all of those are pretty much just a jumbled mess of nested inline dice rolls . :) QRob001 said: Also can one macro call another one? Yup; check out Nesting Macros . QRob001 said: is there a way to have like each number in a d10 = something.  Like roll d10, 1 = Canine, 2 = Feline, 3 = humanoid etc.? This is trickier, and is best handled with an API Script like PowerCards . Access to the API is available within games in which the Creator has an active Pro subscription. Without an API Script, pretty much the best you can do is a macro like this: Roll: [[1d10]] [[1]] ⇒ Canine [[2]] ⇒ Feline [[3]] ⇒ Humanoid etc. With PowerCards: !power {{ --name|Roll --Result:|[[ [$R] 1d10 ]] -- ?? $R == 1 ?? |Canine -- ?? $R == 2 ?? |Feline -- ?? $R == 3 ?? |Humanoid -- ?? $R >= 4 ?? |etc. }}
Sweet, thanks a lot Silvyre
1455154000
Silvyre
Forum Champion
You're very welcome! Good luck and happy rolling!
1455156289
Diana P
Pro
Sheet Author
QRob001 said: is there a way to have like each number in a d10 = something.&nbsp; Like roll d10, 1 = Canine, 2 = Feline, 3 = humanoid etc.? It's not quite the same, but you could use a rollable table (<a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables</a> ).&nbsp; Set the table up with the races (or what ever): Canine Feline Humanoid Reptilian etc. and then call it in your macro with race: [[1t[inhabitant-race] ]]
Thanks Diana