Ifrnd - EDukeWiki

# Ifrnd

From EDukeWiki

ifrnd <value> { do something } else { do something else }

An if condition stating the probability of it 'doin somethin!' in this case.

A <value> greater or equal to 255 corresponds to a 100% probability that the first block is taken. With a <value> of -1, the "else" block is taken every time. (A <value> of 0 means taking the "if" block once out of 256 on average).

This command must only be used in synchronised code or you will cause desyncs. for display code use displayrand instead.

Retrieved from "http://wiki.eduke32.com/w/index.php?title=Ifrnd&oldid=10946"
Categories:

- Duke3D 1.3/1.5 commands
- If conditions