Difference between revisions of "Rand-multiple"

From FreeSpace Wiki
Jump to: navigation, search
m (category added)
(comment)
 
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===
 +
Use this instead of [[rand]] if it will be called more than once in a mission. Unlike rand, this SEXP will re-randomize the number for each call.
 
[[Category:SCP SEXPs]]
 
[[Category:SCP SEXPs]]

Latest revision as of 02:50, 3 August 2007

rand-multiple 
    Rand-multiple (Arithmetic operator) 
    Gets a random number. This number can and will change between 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

Use this instead of rand if it will be called more than once in a mission. Unlike rand, this SEXP will re-randomize the number for each call.