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 .
×

Macro Help Needed before game on Wednesday!

1585059800
Andrew H.
Pro
Marketplace Creator
Hi all! I'm trying to create a macro and hitting a wall.  Possible newb question: In my game, Attributes are represented by dice.  A character's strength might be a d6.  Whenever they want to use their Strength, they'd roll a d6.  Higher dice are stronger Attributes. I've created variables for each of these Attributes. I want to create a macro that triggers a dropdown menu that allows you to pick an Attribute and have it roll the appropriate die.   I am only getting it to return plain text; it just prints to the chat, "/roll d8".  I know I'm doing something wrong and hoping someone could help. Here was my best result after an hour of trying: ?{Choose a Roll|      Strength, /roll d@{Strength} + ?{Bonus}|      Agility, /roll d@{Agility} + ?{Bonus}|      Vitality, /roll d@{Vitality} + ?{Bonus}|      Intelligence, /roll d@{Intelligence} + ?(Bonus}|      Wisdom, /roll d@{Wisdom} + ?{Bonus}|      Charisma, /roll d@{Charisma} + ?{Bonus}} Advanced question: Skills are also represented by dice.  Ideally, I'd like a Skill Check macro that first queries which Attribute to use, then queries which Skill to pair it with.   In an even more perfect roll, also a chance to input a bonus to the Check.  If anyone can post this macro, I'd be in your debt forever! Attributes: Strength, Agility, Vitality, Intelligence, Wisdom, Charisma Skills: Academics, Animal Handling, Arcana, Athletics, Insight, Investigation, Medicine, Perception, Persuasion, Stealth, Survival, Thievery Thank you in advance for any tips or macros I can use, amazing roll20.net community!
1585060508

Edited 1585061025
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Consider using inline rolls: [[1d6]]. /roll works just fine, but you may prefer the cleaner output. Mostly you needed to specify how many dice were needed for each roll. The roller doesn't default to 1 die if nothing is specified. Give this a shot: ?{Choose a Roll|      Strength,[[1d@{Strength} + ?{Bonus}]]|      Agility,[[1d@{Agility} + ?{Bonus}]]|      Vitality,[[1d@{Vitality} + ?{Bonus}]]|      Intelligence,[[1d@{Intelligence} + ?(Bonus}]]|      Wisdom,[[1d@{Wisdom} + ?{Bonus}]]|      Charisma,[[1d@{Charisma} + ?{Bonus}]]} Or with /roll ?{Choose a Roll|      Strength,/roll 1d@{Strength} + ?{Bonus}|      Agility,/roll 1d@{Agility} + ?{Bonus}|      Vitality,/roll 1d@{Vitality} + ?{Bonus}|      Intelligence,/roll 1d@{Intelligence} + ?(Bonus}|      Wisdom,/roll 1d@{Wisdom} + ?{Bonus}|      Charisma,/roll 1d@{Charisma} + ?{Bonus}}
1585060764

Edited 1585060777
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
For your other question, you can make the queries first, and then plug them in as variables wherever you would like, later on. Example
1585061229
Ziechael
Forum Champion
Sheet Author
API Scripter
You can call a single die without the 1, `/roll d20` will call a single d20 the same way as 1d20, the reason your initial attempt was failing was because of the preceding space in your query results: ?{Choose|This, That} resolves to _That ?{Choose|This,That} resolves to That That extra spaces makes a difference when trying to call the dice roller.
1585061372
Ziechael
Forum Champion
Sheet Author
API Scripter
With queries in general you are advised to only put the changes in the result of the query: /roll d?{Attribute|Strength,@{Strength}|Agility,@{Agility}... etc} + ?{Bonus|0} The above will give the same result but without the need to do replacements on the bonus query or repeat the /roll d in every result.
1585061632
Andrew H.
Pro
Marketplace Creator
Keith, you are indeed a Forum Champion.  The inline roll worked perfectly without a hitch!  Ziechael, thank you for pointing out why mine was failing, it's good to learn why things go wrong when they do.  You both are amazing!
1585062383
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ziechael said: You can call a single die without the 1, `/roll d20` will call a single d20 the same way as 1d20... Well dip me in butter, roll me in bread crumbs and bake me for 30 minutes. I had no idea.
1585062625
Ziechael
Forum Champion
Sheet Author
API Scripter
Ha yeah, I had to jump into a game to confirm as I wasn't sure (seen a few sheets with code that omits the 1 but had never tried it in a macro context before).
1585062709

Edited 1585062724
Ziechael
Forum Champion
Sheet Author
API Scripter
Totally welcome, this community is great for helping people learn the ropes... admittedly those ropes are like a spiderweb sometimes but the help is always there for those who ask :) Andrew H. said: Keith, you are indeed a Forum Champion.  The inline roll worked perfectly without a hitch!  Ziechael, thank you for pointing out why mine was failing, it's good to learn why things go wrong when they do.  You both are amazing! Happy rolling!
1585142924
Andrew H.
Pro
Marketplace Creator
These macros are working incredibly well and I'm applying what you taught me to other ones.  Very, very powerful tool.  Thank you both, Forum Champions!