Difference between revisions of "Rand"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Odessa
imported>Odessa
(note)
Line 13: Line 13:
  |example = float fCount
  |example = float fCount
  set fCount to Rand 1, 10
  set fCount to Rand 1, 10
int iRand
set iRand to Rand 0, 100 ; * equivalent to using GetRandomPercent
}}
}}
==Notes==
*To get an int, either use [[Floor]] or just store the return in an int variable.
==See Also==
==See Also==
*[[GetRandomPercent]]
*[[GetRandomPercent]]
*[[NX_GetRandom]]
*[[NX_GetRandom]]
[[Category:Functions_(NVSE)]]
[[Category:Functions_(NVSE)]]

Revision as of 08:39, 16 July 2014

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Returns a random float between specified minimum and maximum. Added by NVSE V1.6.

Syntax

[help]
(float) Rand Minimum:float Maximum:float

Example

float fCount
set fCount to Rand 1, 10
int iRand
set iRand to Rand 0, 100 ; * equivalent to using GetRandomPercent

Notes

  • To get an int, either use Floor or just store the return in an int variable.

See Also