Displayrand: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
"deprecate" displayrand.... this needs more research
Line 1: Line 1:
'''displayrand''' <gamevar><br>
'''displayrand''' <gamevar><br>
'''displayrandvar''' <gamevar> <value><br>
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.
'''displayrandvarvar''' <gamevar> <value>


This function generates a random number and assigns it to <gamevar>.
'''displayrandvar''' <gamevar> <maxvalue_constant><br>
'''displayrandvarvar''' <gamevar> <maxvalue_gamevar>


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


'''displayrandvarvar''' takes a [[gamevar]] rather than a constant or a [[define]]d label for <value>.
'''displayrandvarvar''' takes a [[gamevar]] rather than a constant or a [[define]]d label for <maxvalue>.


Since this function is sync safe, it can be used in unsynchronized code.
Since this function is sync safe, it can be used in unsynchronized code.

Revision as of 07:06, 4 November 2011

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>.

Since this function is sync safe, it can be used in unsynchronized code.

See randomseed.