rndm - ryzom/ryzomcore GitHub Wiki


title: Random description: published: true date: 2023-03-12T12:36:06.700Z tags: editor: markdown dateCreated: 2023-03-12T12:36:02.036Z

rndm

The rndm native AI script function is used to generate a random float value in the specified range [min; max). The max value is exclusive, meaning it is not included in the possible generated values.

Syntax

(random_value: f)rndm(min: f, max: f) // rndm_ff_f

Arguments

  • min (float): The lower bound of the possible returned values.
  • max (float): The upper bound of the possible returned values.

Return value

  • random_value (float): A random value between min and max.

Example

(val)rndm(0, 1);

This example code generates a random float value between 0 (inclusive) and 1 (exclusive), and returns the value as a float.

Note that the max value is not included in the range of possible generated values. In the example above, the function could return any value in the range [0;1[.

⚠️ **GitHub.com Fallback** ⚠️