herobody: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Herobody to herobody: Converting page titles to lowercase)
No edit summary
Line 5: Line 5:


|usage=
|usage=
<source lang="mtmacro" line>
<Has Sight lang="mtmacro" line>
herobody(times, sides)
herobody(times, sides)
</source>
</Has Sight>
'''Parameters'''
'''Parameters'''
{{param|times|The same {{code|times}} parameter that was used when calling {{func|herostun}}.}}
{{param|times|The same {{code|times}} parameter that was used when calling {{func|herostun}}.}}
Line 14: Line 14:
|examples=
|examples=
Roll a twenty-sided dice, and return the {{func|herobody}} result as well.
Roll a twenty-sided dice, and return the {{func|herobody}} result as well.
<source lang="mtmacro" line>
<Has Sight lang="mtmacro" line>
[t: herostun(1, 20)] - [t: herobody(1, 20)
[t: herostun(1, 20)] - [t: herobody(1, 20)
</source>
</Has Sight>
Returns a number that is between {{code|1}} and {{code|20}} for the herostun roll, and a number between {{code|0}} and {{code|2}} for the herobody roll.
Returns a number that is between {{code|1}} and {{code|20}} for the herostun roll, and a number between {{code|0}} and {{code|2}} for the herobody roll.


Roll five ten-sided dice, and return the {{func|herobody}} result as well, using variables.
Roll five ten-sided dice, and return the {{func|herobody}} result as well, using variables.
<source lang="mtmacro" line>
<Has Sight lang="mtmacro" line>
[h: DiceTimes = 5]
[h: DiceTimes = 5]
[h: DiceSides = 10]
[h: DiceSides = 10]
[t: herostun(DiceTimes, DiceSides)] - [t: herobody(DiceTimes, DiceSides)]
[t: herostun(DiceTimes, DiceSides)] - [t: herobody(DiceTimes, DiceSides)]
</source>
</Has Sight>
Returns a number than is between {{code|5}} and {{code|50}} for the herostun roll, and a number between {{code|0}} and {{code|10}} for the herobody roll.
Returns a number than is between {{code|5}} and {{code|50}} for the herostun roll, and a number between {{code|0}} and {{code|10}} for the herobody roll.



Revision as of 16:07, 15 March 2023

herobody() Function

Generates random numbers to emulate dice rolls; this is the partner function to herostun(). The parameters used when calling this function must be exactly the same as the parameters used when calling herostun(), and it must be called during the same macro as herostun() or an error will result. Refer to herostun() for full usage details.

Usage

<Has Sight lang="mtmacro" line> herobody(times, sides) </Has Sight> Parameters

  • times - The same times parameter that was used when calling herostun().
  • sides - The same sides parameter that was used when calling herostun().

Examples

Roll a twenty-sided dice, and return the herobody() result as well.

<Has Sight lang="mtmacro" line> [t: herostun(1, 20)] - [t: herobody(1, 20) </Has Sight> Returns a number that is between 1 and 20 for the herostun roll, and a number between 0 and 2 for the herobody roll.

Roll five ten-sided dice, and return the herobody() result as well, using variables. <Has Sight lang="mtmacro" line> [h: DiceTimes = 5] [h: DiceSides = 10] [t: herostun(DiceTimes, DiceSides)] - [t: herobody(DiceTimes, DiceSides)] </Has Sight>

Returns a number than is between 5 and 50 for the herostun roll, and a number between 0 and 10 for the herobody roll.

See Also

Used in conjunction with herostun()
For another method of rolling dice, see Dice Expressions.