Difference between revisions of "Displayrand"

From EDukeWiki
Jump to navigation Jump to search
Line 1: Line 1:
'''displayrand''' <gamevar>
'''displayrand''' <gamevar><br>
'''displayrandvar''' <gamevar> <value><br>
'''displayrandvarvar''' <gamevar> <value>


This function generates a random number and assigns it to <gamevar>.
This function generates a random number and assigns it to <gamevar>.
The '''displayrandvar''' commands limit the number to be between 0 and <value>.
'''displayrandvarvar''' takes a [[gamevar]] rather than a constant or a [[define]]d label for <value>.
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.


See [[displayrandvar]], [[displayrandvarvar]], [[randomseed]].
See [[randomseed]].


[[Category:EDuke32 specific commands]]
[[Category:EDuke32 specific commands]]
[[Category:Gamevar manipulation]]
[[Category:Gamevar manipulation]]

Revision as of 18:42, 24 February 2011

displayrand <gamevar>
displayrandvar <gamevar> <value>
displayrandvarvar <gamevar> <value>

This function generates a random number and assigns it to <gamevar>.

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

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

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

See randomseed.