Pages

sexta-feira, 25 de março de 2016

BP Compendium: Random Integer in Range

Random Integer in Range


Function that returns a random integer within a range of specified values.

Input
  • Min: The lowest value that can be generated.
  • Max: The highest value that can be generated.

Output

  • Return Value: Random integer value within Min and Max.


Example Usage

The custom event “Random Bonus” create a random type of bonus based on the result of the function “Random Integer in Range”.

Click to enlarge


The custom event below simulates an attack on a simple RPG based on two six-sided dice. If the sum of two dice is 12, the player does a critical hit. Note that each time the Random function is accessed, it generates a new random value.

Click to enlarge