Search Authority

Roll20 Stat Macro: Ultimate Guide to Automated Dice Tracking & Calculation

Roll20 stat macros let you automate dice rolls, modifiers, and conditional logic inside your games, reducing fumbling and speeding up play. By combining basic dice notation with...

Mara Ellison
Roll20 Stat Macro: Ultimate Guide to Automated Dice Tracking & Calculation

Roll20 stat macros let you automate dice rolls, modifiers, and conditional logic inside your games, reducing fumbling and speeding up play. By combining basic dice notation with logical operators, you can track complex character states without leaving the VTT.

This guide walks through practical patterns for attack rolls, saving throws, and resource tracking. Use these examples to build macros that scale with character level and adapt to house rules.

Category Key Fields Values and Notes Use Case
Attack To Hit /roll 1d20 + @{attack_bonus} + @{mod_flex} Standard attack roll with variable bonus
Damage Weapon Dice /roll 1d8 + @{str_mod} + @{damage_bonus} Weapon damage plus modifiers
Saving Throw DC Input /roll 1d20 + @{saving_throw} >= @{dc} Check against a dynamic or chosen DC
Resource Short Rest Recharge /reinvigorate @{"hitdice"} -- Recharges after short rest Track limited abilities like bardic inspiration

Basic Dice Notation and Operators

Roll syntax in Roll20 follows standard dice expressions such as 1d20, 2d6, or 1d100. You can combine dice with flat modifiers using + or −. Logical operators like >= let you encode pass/fail conditions inside a single macro line.

Parentheses help control evaluation order when mixing arithmetic and comparison operators. For example, /roll (1d20 + 5) >= 16 checks against a target number after adding a static bonus. Understanding these building blocks makes advanced patterns easier to read.

Attack Rolls and Critical Logic

Standard Attack with Flexible Bonus

Use a variable attack bonus that pulls from abilities or items. A macro like /roll 1d20 + @{attack_bonus} >= @{target_ac} returns hit or miss and can be extended with critical ranges or advantage logic.

Critical Hit Table Integration

Add automatic crit on 20 and fumble on 1 by testing the rolled value. You can display damage twice on a crit or apply special effects when natural 20 appears, keeping the logic inside the roll output.

Saving Throws and DC Management

Dynamic DC Input

Let the GM pass a DC as a parameter or select it from a sheet. /roll 1d20 + @{saving_throw} >= @{dc} works for any saving throw and makes it easy to switch DCs between encounters.

Partial Success Rules

Roll with thresholds to determine degrees of success. For example, a roll of 10–14 might mean partial effect, while 15+ represents full effect, giving more granularity to tough saves.

Damage Tracking and Multiplier Handling

Weapon Damage with Bonus

Combine dice, ability modifiers, and situational bonuses in one line. Use /roll 1d8 + @{str_mod} + @{damage_bonus} for straightforward weapon damage, and extend for extra dice or elemental types.

Critical Damage Scaling

Double weapon dice on a natural 20 using conditional formatting in the macro output. Some tables prefer explicit dice duplication, while others apply a simple x2 damage note for clarity.

Resource Management and Recharge

Charges Per Short Rest

Track limited uses such as spell slots or class features with a counter. /reinvigorate @{"charges"} resets after a short rest and can be bound to buttons for instant recovery during downtime.

Conditional Recharge Triggers

Add narrative conditions, like completing a short rest in a safe location, before allowing the resource to refresh. This keeps pacing consistent and prevents premature regeneration.

Optimizing Workflow for Roll20 Stat Macro Use

  • Test macros in a private campaign before sharing them with the group
  • Document variable names so other GMs can maintain the macros
  • Use consistent naming like @{attack_bonus} and @{target_ac} across sheets
  • Leverage the Roll20 API for complex automation beyond basic rolls
  • Version your macros so changes do not break existing campaigns
  • Communicate macro behavior with players to manage expectations

FAQ

Reader questions

How do I use a roll macro to add advantage for specific skills?

Use two separate rolls with /roll 1d20 and keep the higher result, then apply your skill bonus on top. This pattern works for checks where your table allows advantage on certain situations.

Can I embed a roll macro inside a journal entry description?

Yes, you can insert a macro block in a journal, and players can click it during the game to resolve rolls. This is helpful for NPC actions, hazards, or scripted events that need automatic resolution.

What happens if my macro references a sheet attribute that is blank? Roll20 treats empty attribute fields as zero in calculations, which can produce unexpected results. Always add a default value or use an if statement to handle missing bonuses safely. How can I prevent my macro from showing raw code to players?

Wrap sensitive logic in HTML app tags or use chat commands that only trusted players can execute. Limiting macro visibility helps keep house rules and advanced patterns clear of casual users.

Related Reading

More pages in this topic cluster.

Who Designed the Nike Logo? The Story Behind the Swoosh

The Nike swoosh is one of the most recognizable symbols in the world, but few people know the story behind its creation. This piece explores who designed the Nike logo, why it h...

Read next
What is the World's Hottest Pepper? 🌶️🔥

When people ask about the world's hottest pepper, they usually mean the variety that currently holds the Guinness World Record and pushes the boundaries of capsaicin heat. Peppe...

Read next
Jon Huertas in This Is Us:角色, 出演时期与剧情影响详解

Jon Huertas 在《这就是我们》中饰演成年 Kevin Pearson,这一角色从2016年首播持续至2022年最终季,构成了剧集核心家庭叙事的重要组成部�...

Read next