Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:HiddenRolls

From Roll20 Wiki

Revision as of 23:13, 12 June 2015 by manveti (Talk | contribs)

Jump to: navigation, search
API ScriptAuthor: manveti
Version: 0.2
Last Modified: 2015-05-09
Code: HiddenRolls
Dependencies: None
Conflicts: None

HiddenRolls is a package of commands for hiding roll information in various ways. Inline rolls can be modified to display only the total (hiding the formula), only the roll values (hiding the formula and totals), or only the formula (whispering the totals to the GM).

It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery.


Contents

Syntax

!hideroll [options] <command>
!hidetotal [options] <command>
!hideall [options] <command>
Formally:

S

→ hideroll options
string

S

→ hidetotal options
string

S

→ hideall options
string

options

option
options


options

→ ε

option

→ -string

option

→ --string
Parameter Values
options The above commands accept the following options:
  • -h, --help: Displays a help message and exits.
  • -v, --verbose: Generates additional output, depending on the command:
!hideroll: Whispers full results (including rolls and formulas) to the GM.
!hidetotal: Whispers full results to the sender in addition to the GM.
!hideall: Sends the stripped command to global chat instead of whispering it to the sender.

Use

  • !hideroll replaces all inline rolls in the given command with their respective totals.
  • !hiderolls is a synonym for !hideroll.
  • !hidetotal replaces all inline rolls in the given command with new expressions containing only the dice from the original (i.e. no bonuses or annotations). The full expression is whispered to the GM.
  • !hidetotals is a synonym for !hidetotal.
  • !hideall forwards the given command to the GM. The command is also whispered back to the sender, with inline rolls removed (and replaced with their respective formulas).


In order to guarantee the integrity of roll results, the Roll20 API does not provide a way to insert roll results into an inline roll. As a result, HiddenRolls displays dice results as "{1d0+V1+V2+...}[XdY] ", where V1, V2, etc. are roll values and XdY is the dice expression. For example, "[[1d20+7]]" would be displayed as "[[{1d0+12}[1d20] +7]]". The "1d0" allows the expression to function like a dice expression (otherwise the label would generate errors in certain conditions), and the label allows the GM to verify the roll formula.

Examples

Below are some example commands, along with the chat commands they will generate. Note that the whispers below are sent by the API, so they will not appear in the sender's chat log unless they are the target of the whisper.

!hideroll The ogre swings its club ([[1d20+7]] to hit), doing [[2d6+5]] damage
The ogre swings its club ([[19]] to hit), doing [[13]] damage
!hiderolls -v The fireball explodes for [[5d6]] damage
The fireball explodes for [[17]] damage
/w gm The fireball explodes for [[{1d0+1+3+6+5+2}[5d6] ]] damage
!hidetotal The troll makes a toughness save: [[1d20+8]]
The troll makes a toughness save: [[{1d0+15}[1d20] +0[hidden] ]]
/w gm The troll makes a toughness save: [[{1d0+15}[1d20] +8]]
!hidetotals -v The enchanter's spell does [[2d8+2]] damage
The enchanter's spell does [[{1d0+7+3}[2d8] +0[hidden] ]] damage
/w gm The enchanter's spell does [[{1d0+7+3}[2d8] +2]] damage
/w Tim The enchanter's spell does [[{1d0+7+3}[2d8] +2]] damage
!hideall Slipping stealthily into a sneaky stance: [[1d20+12]]
/w gm Slipping stealthily into a sneaky stance: [[1d20+12]]
/w Snake Slipping stealthily into a sneaky stance: [1d20+12]
Note the single brackets: the expression is not an inline roll, and is present only to display the formula being rolled.
!hideall -v Is it live or is it Magicex? [[1d20+8]] will save.
/w gm Is it live or is it Magicex? [[1d20+8]] will save.
Is it live or is it Magicex? [1d20+8] will save.
Note the single brackets: the expression is not an inline roll, and is present only to display the formula being rolled.

Changelog

v0.2 (2015-05-09)

  • Add workaround for roll templates


v0.1 (2015-05-08)

  • Initial release