Useful Macros
From Roll20 Wiki
Contents |
Useful Macros for Players
Work in progress (use for general systems only, if system specific add to that page!)
D20 Based Systems
Generic Roller:
"20": /me rolls a [[1d20+?{modifier|0}]] for ?{reason|no reason}.
When clicked, this macro will prompt the user to enter a number, which represents the skill modifier to be added to a d20 roll.
Then it will ask the user to explain why this die was rolled.
For example, if the player is making a SWIM check with a swimming skill of 4, they'd type 4, enter, swimming, enter.
The results will look something like:
Phnord rolls a 17 for swimming!
If the user enters nothing for both prompts, the results will look something like:
Phnord rolls a 13 for no reason!
-Phnord Prephect--Phnord P. (talk) 21:01, 18 December 2013 (EST)
Quick Calculations Macro:**=** [[?{Calculator}]]//the double asterisks simply make the = bold. The only Part you really need is in the brackets.
Easy Roll Good Attributes Macro:
&{template:default} {{name= Ability Scores}} {{[[4d6r1dl1]]}} {{[[4d6r1dl1]]}} {{[[4d6r1dl1]]}} {{[[4d6r1dl1]]}} {{[[4d6r1dl1]]}} {{[[4d6r1dl1]]}}//Note, This will work for any character sheet. This macro re-rolls 1's and drops the lowest
//If you're not having luck getting these to work, make sure the entire thing is one continuous line. It CAN have spaces, it CAN NOT have new lines / separate lines.
Quick Whisper to GM:/w gm ?{Message}
/w ?{Whisper|name1|name2|name3|name4|name5} ?{what do you wish to say}
&{template:default} {{name=Dice}} {{d4 = [[d4]]}} {{d6 = [[d6]]}} {{d8 = [[d8]]}} {{d10 = [[d10]]}} {{d12 = [[d12]]}} {{d20 = [[d20]]}} {{d100 = [[d100]]}}
Pathfinder
useful Pathfinder macros here: Macros - Pathfinder Examples
Useful Macros for GMs
Work in progress (use for general systems only, if system specific add to that page!)
Initiative roller for d20 systems:
For GM-Controlled Tokens:
"GM_INIT":
/emas @{selected|token_name} rolls a [[1d20+?{modifier|0}&{tracker}]] for initiative!
Make sure to select "Token Action" before saving!
For GM use only; see below for players.
To use, select the token. Hit the button (GM INIT). When prompted, enter the total initiative modifier for the token. Token will automatically be added to turn order.
For Player-Controlled Tokens:
"Initiative": @{selected|token_name} rolls a [[1d20+@{selected|init}&{tracker}]] for initiative!
Make sure to select "Token Action" before saving!
Make sure to select "Visible to Players: All Players" before saving!
For Player Use:
To use, have an Attribute in Journal Entry linked to that token called 'initiative', which represents that characters total initiative modifier. Select token, hit the button "Initiative". Token will automatically be added to turn order.
Improved Version:
This does the same thing, but then adds the initiative bonus as a decimal after the initial roll (in cases of a tie, the higher initiative bonus is sorted to go first.)
Initiative: [[1d20+@{Initiative}+(@{initiative}/100)&{tracker} ]]
-by Phnord Prephect--Phnord P. (talk) 19:15, 18 December 2013 (EST)
Shadowrun v4/v5 (D6 based)
Generic roll that asks player / gm how many dice to throw to determine hits:
/r ?{Modifier|0}d6>5
Add as a macro and enable "in bar" so that the shortcut shows up below the player profiles.
--Moritz J. (talk) 06:27, 7 February 2014 (EST)
/roll {@{Character Name|Attribute}d@{Character|Physique}}>4
-- Below added by Steven G
These can all be added as macros on the third tab of the character sheet in the right hand column (Abilities):
Dodge roll (because the button on the char sheet disappears sometimes)
/r (@{reaction} + @{Intuition} - (@{woundmod} - ?{Modifier|0}))d6>5
Damage soak roll
/r (@{body} + @{armor} + ?{AP|0}))d6>5
Roll to resist mind control
/r (@{willpower} + @{Logic} - (@{woundmod} + ?{Force|0}))d6>5
Resist Drain for Shamanistic tradition
/r (@{willpower} + @{Charisma})d6>5
Resist Drain for Hermetic tradition
/r (@{willpower} + @{Logic})d6>5
--Brian B.
Shadowrun 5th - A general roll macro that asks for attributes, skills, positive modifier, and negative modifier as well as the limit
/me gets [[(?{Attribute|1}+?{Skill|0}+?{Positive Modifiers|0}-?{Penalty|0})d6sdkh?{Limit|1}>5]] Successes!
Other Macro Related Information
Work in progress (use for general systems only, if system specific add to that page!)
Common Macro/Dice Issues
These are a list of common pitfalls when creating complex macros or dice rolls.
Subtracting a Negative Attribute
When subtracting an attribute it is best to put parentheses around the attribute. What this is preventing from happening is a double subtraction instead of the subtraction of a negative. For example let's say our THAC0 attribute is negative two. /r 1d20-@{THAC0} translates into /r 1d20--2, which is bad syntax and will fail. /r 1d20-(@{THAC0}) translates into /r 1d20-(-2), which is good syntax and will give you the desired result.
Conditional Statements (Math Only)
Using the multiplicative properties of 0(absorption) and 1(identity) you can write conditional statements for integer values(and to some extent floating point values too)
An example of this is the formula "if x greater than or equal to A, then T; else F," where T and F are some values. If x or A are dice rolls, surround them with [[]] inside these formulas.
This can be written as a macro with
[[{{x,something-less-than-A}>A}*(T-F) + F]]
Example 1:
[[{{3,0}>2}*(4) + 3]]
Example 2:
[[{{[[1d4]],0}>2}*(4) + 3]]
The above examples will multiply (4) with however many times the statement '{X}>2' was true and add +3 to the result. For example 1 that is true 1 time, since 3 > 2, but 0 < 2. This will result in 1*4+3 = 7. For example 2 that is true 0-1 time, depending on the result of the 1d4. This will result in either 0*4+3=3 or 1*4+3=7.
Similarly, "x greater than A, then T; else F" is written
[[{{x,something-less-than-A}>[[A+1]]}*(T-F) + F]]
(Assuming A is an integer)
Alternatively, you can multiply one minus the (x==A) check below with the (x>=A) check above, like so:
[[({{x,something-less-than-A}>A})*(1-{0,floor(1-abs(x-A))}dl1)*(T-F)+F]]
"x equals A" is simpler.
[[({0,floor(1-abs(x-A))}dl1)*(T-F) +F]]
Now for some identities: "x less than A" is the inverse of "x greater than or equal to A," so the conditional can be written as "x greater than or equal to A, then F; else T" using the formulas above. Similarly with "x less than or equal to A" and "x greater than A," as well as with "x not equal to A" and "x equal to A."
Custom Power Cards
Custom Power Cards are not macros: they are an API script for applying html and css to the output of a macro in the chat pane.
Sample of a standard macro and its output.
- Standard macro that will include an emote, plus my attack and damage rolls it would look like this:
- Macro Name:
dagger
- Macro Body:
/me rams his dagger home
/roll 1d20+10 vs AC
/roll 1d4+9 Damage
- The output would look like:
Sample of a standard macro action with Custom Power Cards.
- With Custom Power Cards the macro would be constructed as an API command using Custom Power Cards markup tags:
- Macro Name:
dagger
- Macro Body:
!power --emote|@{selected|token_name} rams his dagger home --name|Short Sword --leftsub|Melee --rightsub|Main Hand --attack|[[1d20+10]] --defense|AC --damage|[[1d4+9]] --dmgtype|piercing
- The output would look like:
For more information see: Custom Power Cards
-Stephen S.--Stephen S. (talk) 03:57, 2 March 2014 (EST)