Eyeon:Script/Reference/Libraries/math/randomseed

From VFXPedia

Jump to: navigation, search

Contents

Math : math.randomseed()

Arguments

'math.randomseed( )

  • seed (required, numeric)

A numeric value used as a seed for initializing the pseudo random generator.

Returns

This function does not return a value

Remarks

The math.randomseed function initializes the pseudo random number generator used by the math.random() function. Normally, when a script begins to execute, the generator is automatically seeded with a fixed value. This will cause the sequence of values returned to be identical each time the generator is called.

By initializing the random seed generator with a specified number, a less predictable sequence can be produced.

Requirements

  • eyeonScript 5.0
  • Fusion 5.0

Examples

-- sets the randomseed to a concatenation of -- date, hour, minute and second -- -- this would cause the sequence of numbers generated by -- calls to random() to be repeated only if the script -- was called at the same second of the same day of the next month

math.randomseed(os.date("%d%H%M%S"))


Tips for randomseed (edit)

EyeonTips:Script/Reference/Libraries/math/randomseed