https://wiki.roll20.net/api.php?action=feedcontributions&user=1005167&feedformat=atomRoll20 Wiki - User contributions [en]2020-05-30T15:03:01ZUser contributionsMediaWiki 1.20.3https://wiki.roll20.net/Useful_MacrosUseful Macros2015-07-14T00:08:20Z<p>1005167: /* Custom Power Cards */</p>
<hr />
<div>== Useful Macros for Players ==<br />
<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
=== D20 Based Systems ===<br />
<br />
Generic Roller:<br />
<br />
"20": '''/me rolls a [[1d20+?{modifier|0}]] for ?{reason|no reason}.'''<br />
<br />
When clicked, this macro will prompt the user to enter a number, which represents the skill modifier to be added to a d20 roll.<br /><br />
Then it will ask the user to explain why this die was rolled.<br />
<br />
For example, if the player is making a SWIM check with a swimming skill of 4, they'd type 4, enter, swimming, enter.<br /><br />
The results will look something like:<br /><br />
<br />
Phnord rolls a 17 for swimming!<br />
<br />
If the user enters nothing for both prompts, the results will look something like:<br /><br />
<br />
Phnord rolls a 13 for no reason!<br />
<br />
-Phnord Prephect--[[User:186177|186177]] ([[User talk:186177|talk]]) 21:01, 18 December 2013 (EST)<br />
<br />
=== Pathfinder ===<br />
useful Pathfinder macros here: Macros - [[Macros_-_Pathfinder_Examples|Pathfinder Examples]]<br />
<br />
== Useful Macros for GMs ==<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
<big>Initiative roller for d20 systems:</big><br />
<br />
''For GM-Controlled Tokens:''<br /><br />
"GM INIT": <br />
'''/emas @{selected|token_name} rolls a [[1d20+?{modifier|0}&{tracker}]] for initiative!'''<br /><br />
<br />
Make sure to select "Token Action" before saving!<br />
<br />
For GM use only; see below for players.<br /><br />
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.<br />
<br /><br />
<br /><br /><br />
<br />
''For Player-Controlled Tokens:''<br /><br />
"Initiative": '''@{selected|token_name} rolls a [[1d20+@{selected|initiative}&{tracker}]] for initiative!'''<br /><br />
<br />
Make sure to select "Token Action" before saving!<br /><br />
Make sure to select "Visible to Players: All Players" before saving!<br /><br />
<br />
For Player Use:<br /><br />
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.<br />
<br />
<br />
<br />
''Improved Version:''<br />
<br />
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.)<br />
<br />
Initiative: '''[[1d20+@{Initiative}+(@{initiative}/100)&{tracker} ]]'''<br />
<br />
<br />
<br />
<br />
-by Phnord Prephect--[[User:186177|186177]] ([[User talk:186177|talk]]) 19:15, 18 December 2013 (EST)<br />
<br />
=== Shadowrun v4/v5 (D6 based) ===<br />
<br /><br />
Generic roll that asks player / gm how many dice to throw to determine hits:<br />
<br /><br /><br />
/r ?{Modifier|0}d6>5<br />
<br /><br /><br />
Add as a macro and enable "in bar" so that the shortcut shows up below the player profiles. <br />
<br /><br /><br />
--[[User:110534|110534]] ([[User talk:110534|talk]]) 06:27, 7 February 2014 (EST)<br />
<br /><br />
/roll {@{Character Name|Attribute}d@{Character|Physique}}>4<br />
<br /><br /><br />
-- Below added by Steven G <br /><br />
These can all be added as macros on the third tab of the character sheet in the right hand column (Abilities):<br /><br /><br />
Dodge roll (because the button on the char sheet disappears sometimes)<br /><br />
/r (@{reaction} + @{Intuition} - (@{woundmod} - ?{Modifier|0}))d6>5 <br /> <br /><br />
Damage soak roll<br /><br />
/r (@{body} + @{armor} - (@{woundmod} + ?{AP|0}))d6>5<br /><br /><br />
Roll to resist mind control<br /><br />
/r (@{willpower} + @{Logic} - (@{woundmod} + ?{Force|0}))d6>5 <br/><br /><br />
Resist Drain for Shamanistic tradition<br /><br />
/r (@{willpower} + @{Charisma} - @{woundmod})d6>5 <br /><br /><br />
Resist Drain for Hermetic tradition<br /><br />
/r (@{willpower} + @{Logic} - @{woundmod})d6>5 <br ><br /><br />
<br />
== Other Macro Related Information ==<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
===Common Macro/Dice Issues===<br />
These are a list of common pitfalls when creating complex macros or dice rolls.<br />
====Subtracting a Negative Attribute====<br />
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. <br />
/r 1d20-@{THAC0} translates into /r 1d20--2, which is bad syntax and will fail.<br />
/r 1d20-(@{THAC0}) translates into /r 1d20-(-2), which is good syntax and will give you the desired result.<br />
<br />
=== Conditional Statements ===<br />
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)<br />
<br />
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.<br />
<br />
This can be written as a macro with<br />
<pre><br />
[[-1*floor((A-x-0.1)/(abs(A-x-0.1)+0.001))*T - floor((x+0.1-A)/(abs(x+0.1-A)+0.001))*F]]<br />
</pre><br />
<br />
Similarly, "x greater than A, then T; else F" is written<br />
<pre><br />
[[-1*floor((A-x+0.1)/(abs(A-x+0.1)+0.001))*T - floor((x-0.1-A)/(abs(x-0.1-A)+0.001))*F]]<br />
</pre><br />
<br />
"x equals A" is simpler, and works when x is a dice roll, but not when F is a dice roll<br />
<pre><br />
[[F + round((T-F)/(10*(x-A+.1)))]]<br />
</pre><br />
<br />
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."<br />
<br />
=== Custom Power Cards ===<br />
<br /><br />
[[Custom Power Cards]] are not macros, they are an API script for apply html and css to output of a macro in the chat pane.<br /><br />
<br />
'''Sample of a standard macro and its output.'''<br />
* Standard macro that will include an emote, plus my attack and damage rolls it would look like this:<br />
:Macro Name: <br> <code>dagger</code><br><br />
:Macro Body: <br> <code>/me rams his dagger home</code><br> <br />
:<code>/roll 1d20+10 vs AC</code><br> <br />
:<code>/roll 1d4+9 Damage</code><br><br />
<br />
*The output would look like:<br />
<br />
:[[File:AttackMacro.JPG]]<br />
<br />
'''Sample of a standard macro action with Custom Power Cards.'''<br />
* With [[Custom Power Cards]] the macro would be constructed as an API command using Custom Power Cards markup tags:<br />
:Macro Name: <br> <code>dagger</code><br><br> <br />
:Macro Body: <br> <code>!power --emote|@{selected|token_name} rams his dagger home --name|Short Sword --leftsub|Melee --rightsub|Main Hand --attack|<nowiki>[[1d20+10]]</nowiki> --defense|AC --damage|<nowiki>[[1d4+9]]</nowiki> --dmgtype|piercing</code><br><br />
<br />
* The output would look like:<br />
<br />
[[File:AttackMacroPowerCard.jpeg]]<br />
<br />
For more information see: [[Custom Power Cards]]<br />
<br />
-Stephen S.--[[User:135636|135636]] ([[User talk:135636|talk]]) 03:57, 2 March 2014 (EST)<br />
<br />
: [[Category:Tips]]</div>1005167https://wiki.roll20.net/Useful_MacrosUseful Macros2015-07-14T00:07:59Z<p>1005167: /* Custom Power Cards */</p>
<hr />
<div>== Useful Macros for Players ==<br />
<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
=== D20 Based Systems ===<br />
<br />
Generic Roller:<br />
<br />
"20": '''/me rolls a [[1d20+?{modifier|0}]] for ?{reason|no reason}.'''<br />
<br />
When clicked, this macro will prompt the user to enter a number, which represents the skill modifier to be added to a d20 roll.<br /><br />
Then it will ask the user to explain why this die was rolled.<br />
<br />
For example, if the player is making a SWIM check with a swimming skill of 4, they'd type 4, enter, swimming, enter.<br /><br />
The results will look something like:<br /><br />
<br />
Phnord rolls a 17 for swimming!<br />
<br />
If the user enters nothing for both prompts, the results will look something like:<br /><br />
<br />
Phnord rolls a 13 for no reason!<br />
<br />
-Phnord Prephect--[[User:186177|186177]] ([[User talk:186177|talk]]) 21:01, 18 December 2013 (EST)<br />
<br />
=== Pathfinder ===<br />
useful Pathfinder macros here: Macros - [[Macros_-_Pathfinder_Examples|Pathfinder Examples]]<br />
<br />
== Useful Macros for GMs ==<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
<big>Initiative roller for d20 systems:</big><br />
<br />
''For GM-Controlled Tokens:''<br /><br />
"GM INIT": <br />
'''/emas @{selected|token_name} rolls a [[1d20+?{modifier|0}&{tracker}]] for initiative!'''<br /><br />
<br />
Make sure to select "Token Action" before saving!<br />
<br />
For GM use only; see below for players.<br /><br />
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.<br />
<br /><br />
<br /><br /><br />
<br />
''For Player-Controlled Tokens:''<br /><br />
"Initiative": '''@{selected|token_name} rolls a [[1d20+@{selected|initiative}&{tracker}]] for initiative!'''<br /><br />
<br />
Make sure to select "Token Action" before saving!<br /><br />
Make sure to select "Visible to Players: All Players" before saving!<br /><br />
<br />
For Player Use:<br /><br />
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.<br />
<br />
<br />
<br />
''Improved Version:''<br />
<br />
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.)<br />
<br />
Initiative: '''[[1d20+@{Initiative}+(@{initiative}/100)&{tracker} ]]'''<br />
<br />
<br />
<br />
<br />
-by Phnord Prephect--[[User:186177|186177]] ([[User talk:186177|talk]]) 19:15, 18 December 2013 (EST)<br />
<br />
=== Shadowrun v4/v5 (D6 based) ===<br />
<br /><br />
Generic roll that asks player / gm how many dice to throw to determine hits:<br />
<br /><br /><br />
/r ?{Modifier|0}d6>5<br />
<br /><br /><br />
Add as a macro and enable "in bar" so that the shortcut shows up below the player profiles. <br />
<br /><br /><br />
--[[User:110534|110534]] ([[User talk:110534|talk]]) 06:27, 7 February 2014 (EST)<br />
<br /><br />
/roll {@{Character Name|Attribute}d@{Character|Physique}}>4<br />
<br /><br /><br />
-- Below added by Steven G <br /><br />
These can all be added as macros on the third tab of the character sheet in the right hand column (Abilities):<br /><br /><br />
Dodge roll (because the button on the char sheet disappears sometimes)<br /><br />
/r (@{reaction} + @{Intuition} - (@{woundmod} - ?{Modifier|0}))d6>5 <br /> <br /><br />
Damage soak roll<br /><br />
/r (@{body} + @{armor} - (@{woundmod} + ?{AP|0}))d6>5<br /><br /><br />
Roll to resist mind control<br /><br />
/r (@{willpower} + @{Logic} - (@{woundmod} + ?{Force|0}))d6>5 <br/><br /><br />
Resist Drain for Shamanistic tradition<br /><br />
/r (@{willpower} + @{Charisma} - @{woundmod})d6>5 <br /><br /><br />
Resist Drain for Hermetic tradition<br /><br />
/r (@{willpower} + @{Logic} - @{woundmod})d6>5 <br ><br /><br />
<br />
== Other Macro Related Information ==<br />
Work in progress (use for general systems only, if system specific add to that page!)<br />
<br />
===Common Macro/Dice Issues===<br />
These are a list of common pitfalls when creating complex macros or dice rolls.<br />
====Subtracting a Negative Attribute====<br />
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. <br />
/r 1d20-@{THAC0} translates into /r 1d20--2, which is bad syntax and will fail.<br />
/r 1d20-(@{THAC0}) translates into /r 1d20-(-2), which is good syntax and will give you the desired result.<br />
<br />
=== Conditional Statements ===<br />
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)<br />
<br />
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.<br />
<br />
This can be written as a macro with<br />
<pre><br />
[[-1*floor((A-x-0.1)/(abs(A-x-0.1)+0.001))*T - floor((x+0.1-A)/(abs(x+0.1-A)+0.001))*F]]<br />
</pre><br />
<br />
Similarly, "x greater than A, then T; else F" is written<br />
<pre><br />
[[-1*floor((A-x+0.1)/(abs(A-x+0.1)+0.001))*T - floor((x-0.1-A)/(abs(x-0.1-A)+0.001))*F]]<br />
</pre><br />
<br />
"x equals A" is simpler, and works when x is a dice roll, but not when F is a dice roll<br />
<pre><br />
[[F + round((T-F)/(10*(x-A+.1)))]]<br />
</pre><br />
<br />
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."<br />
<br />
=== Custom Power Cards ===<br />
<br /><br />
[[Custom Power Cards]] are not macros, they are an API script for apply html and css to output of a macro in the chat pane.<br /><br />
<br />
'''Sample of a standard macro and its output.'''<br />
* Standard macro that will includ an emote, plus my attack and damage rolls it would look like this:<br />
:Macro Name: <br> <code>dagger</code><br><br />
:Macro Body: <br> <code>/me rams his dagger home</code><br> <br />
:<code>/roll 1d20+10 vs AC</code><br> <br />
:<code>/roll 1d4+9 Damage</code><br><br />
<br />
*The output would look like:<br />
<br />
:[[File:AttackMacro.JPG]]<br />
<br />
'''Sample of a standard macro action with Custom Power Cards.'''<br />
* With [[Custom Power Cards]] the macro would be constructed as an API command using Custom Power Cards markup tags:<br />
:Macro Name: <br> <code>dagger</code><br><br> <br />
:Macro Body: <br> <code>!power --emote|@{selected|token_name} rams his dagger home --name|Short Sword --leftsub|Melee --rightsub|Main Hand --attack|<nowiki>[[1d20+10]]</nowiki> --defense|AC --damage|<nowiki>[[1d4+9]]</nowiki> --dmgtype|piercing</code><br><br />
<br />
* The output would look like:<br />
<br />
[[File:AttackMacroPowerCard.jpeg]]<br />
<br />
For more information see: [[Custom Power Cards]]<br />
<br />
-Stephen S.--[[User:135636|135636]] ([[User talk:135636|talk]]) 03:57, 2 March 2014 (EST)<br />
<br />
: [[Category:Tips]]</div>1005167