From EDukeWiki
Revision as of 02:45, 10 November 2011 by Plugwash (talk | contribs)
Jump to navigation Jump to search

displayrand <gamevar>
generates a random number between 0 and a system-specific maximum value and assigns it to <gamevar>. Specifically, the maximum values may differ between EDuke32 builds produced with the GCC and MSVC compilers, and/or operating systems. Use of this function is thus discouraged.

displayrandvar <gamevar> <maxvalue_constant>
displayrandvarvar <gamevar> <maxvalue_gamevar>

The displayrandvar commands limit the number to be between 0 and <maxvalue>.

displayrandvarvar takes a gamevar rather than a constant or a defined label for <maxvalue>.

This function must ONLY be used in unsynchronized code. Use in syncronized code is almost certain to cause desyncs.

See randomseed.