Difference between revisions of "Rand"

From FreeSpace Wiki
Jump to: navigation, search
m
(rand-multiple)
 
Line 7: Line 7:
 
   2: High range of random number.  
 
   2: High range of random number.  
 
   3: (optional) A seed to use when generating numbers. (Setting this to 0 is the same as having no seed at all)
 
   3: (optional) A seed to use when generating numbers. (Setting this to 0 is the same as having no seed at all)
 +
 +
==Comments==
 +
If you want to randomize a different number every time a given event is triggered, use [[rand-multiple]].
  
 
[[Category:Retail SEXPs]]
 
[[Category:Retail SEXPs]]

Latest revision as of 02:08, 18 March 2021

rand 
 Rand (Arithmetic operator) 
 Gets a random number. This number will not change on successive calls to this sexp. 
 
 Returns a number. Takes 2 or 3 numeric arguments... 
 1: Low range of random number. 
 2: High range of random number. 
 3: (optional) A seed to use when generating numbers. (Setting this to 0 is the same as having no seed at all)

Comments

If you want to randomize a different number every time a given event is triggered, use rand-multiple.