Difference between revisions of "Randvar"

From EDukeWiki
Jump to navigation Jump to search
 
m
Line 1: Line 1:
'''randvar''' and '''randvarvar''' generate a random number and put it in a variable.
randvar <gamevar> <value>


randvar and randvarvar MUST NOT be used in unsynchronised code or you will get a desync. furthermore this desync is insiduous and won't appear immidiately but only the next time the random number generator is used for its proper function.
This function generates a random number from 0 to <value> and assigns it to <gamevar>.


in the official eduke releases and many modified versions (including current releases of eduke32) this is broken and use will desync multiplayer
This command should not be used in unsynchronized code.  See the list of [[unsynchronized events]] for  a full list.


we have now fixed it
In prior releases of DOS EDuke, randvar and randvarvar contained a flaw that would desynchronize multiplayer.  The bug has since been corrected for post-1.0 releases of EDuke32.

Revision as of 13:55, 1 February 2005

randvar <gamevar> <value>

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

This command should not be used in unsynchronized code. See the list of unsynchronized events for a full list.

In prior releases of DOS EDuke, randvar and randvarvar contained a flaw that would desynchronize multiplayer. The bug has since been corrected for post-1.0 releases of EDuke32.