drop: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "source>" to "syntaxhighlight>")
 
Line 7: Line 7:
<syntaxhighlight lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
drop(times, sides, ignore)
drop(times, sides, ignore)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|times|The number of times to roll the dice.}}
{{param|times|The number of times to roll the dice.}}
Line 17: Line 17:
<syntaxhighlight lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[t: drop(10, 20, 5)]
[t: drop(10, 20, 5)]
</source>
</syntaxhighlight>
Returns a number that is between {{code|5}} and {{code|100}}, with a high average.
Returns a number that is between {{code|5}} and {{code|100}}, with a high average.


Line 26: Line 26:
[h: DiceIgnore = 2]
[h: DiceIgnore = 2]
[t: drop(DiceTimes, DiceSides, DiceIgnore)]
[t: drop(DiceTimes, DiceSides, DiceIgnore)]
</source>
</syntaxhighlight>
Returns a number than is between {{code|3}} and {{code|30}}, with a high average.
Returns a number than is between {{code|3}} and {{code|30}}, with a high average.



Latest revision as of 17:34, 14 March 2023

drop() Function

Generates random numbers to emulate dice rolls; returns the total of a dice roll that ignores a certain number of the lowest dice rolled.

Usage

drop(times, sides, ignore)

Parameters

  • times - The number of times to roll the dice.
  • sides - The number of sides the dice possess.
  • ignore - The number of lowest rolls that are ignored when totaling the roll.

Examples

Roll ten twenty-sided dice, ignoring the lowest five rolls.
[t: drop(10, 20, 5)]

Returns a number that is between 5 and 100, with a high average.

Roll five ten-sided dice ignoring the lowest two rolls, using variables.

[h: DiceTimes = 5]
[h: DiceSides = 10]
[h: DiceIgnore = 2]
[t: drop(DiceTimes, DiceSides, DiceIgnore)]
Returns a number than is between 3 and 30, with a high average.

See Also

For another method of rolling dice, see Dice Expressions.