reroll: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Initial write-up.)
 
m (Fixing example to actually use reroll)
Line 25: Line 25:
[h: DiceSides = 10]
[h: DiceSides = 10]
[h: DiceMinimum = 5]
[h: DiceMinimum = 5]
[t: roll(DiceTimes, DiceSides, DiceMinimum)]
[t: reroll(DiceTimes, DiceSides, DiceMinimum)]
</source>
</source>
Returns a number than is between {{code|25}} and {{code|50}}.
Returns a number than is between {{code|25}} and {{code|50}}.

Revision as of 14:34, 28 April 2020

reroll() Function

Generates random numbers to emulate dice rolls; returns a dice roll similar to roll() with the difference being that each dice rolled that is lower than the minimum parameter is rerolled until it is at least the minimum.

Usage

reroll(times, sides, minimum)

Parameters

  • times - The number of times to roll the dice.
  • sides - The number of sides the dice possess.
  • minimum - The lowest number a dice rolled can return without being rerolled.

Examples

Roll five ten-sided dice, rerolling any dice rolled lower than five.
[t: reroll(5, 10, 5)]

Returns a number that is between 25 and 50.

Roll five ten-sided dice, rerolling any dice rolled lower than five, using variables.

[h: DiceTimes = 5]
[h: DiceSides = 10]
[h: DiceMinimum = 5]
[t: reroll(DiceTimes, DiceSides, DiceMinimum)]
Returns a number than is between 25 and 50.

See Also

For another method of rolling dice, see Dice Expressions.