Space Station 13 - Modules - TypesDefine Details

code/__DEFINES/_math.dm

SPT_PROB_RATEConverts a probability/second chance to probability/seconds_per_tick chance For example, if you want an event to happen with a 10% per second chance, but your proc only runs every 5 seconds, do if(prob(100*SPT_PROB_RATE(0.1, 5)))
SPT_PROBLike SPT_PROB_RATE but easier to use, simply put if(SPT_PROB(10, 5))
normal_distributionReturns probability based on deviation from the mean(m) and sigma(s)
IS_INTChecks if a number is an integer, or a float
hex2numReturns an integer given a hex input, supports negative values "-ff". Skips preceding invalid characters.
num2hexReturns the hex value of a decimal number. len == length of returned string.
IS_IN_BOUNDSTests if the value is in the given range.

Define Details

IS_INT

Checks if a number is an integer, or a float

IS_IN_BOUNDS

Tests if the value is in the given range.

SPT_PROB

Like SPT_PROB_RATE but easier to use, simply put if(SPT_PROB(10, 5))

SPT_PROB_RATE

Converts a probability/second chance to probability/seconds_per_tick chance For example, if you want an event to happen with a 10% per second chance, but your proc only runs every 5 seconds, do if(prob(100*SPT_PROB_RATE(0.1, 5)))

hex2num

Returns an integer given a hex input, supports negative values "-ff". Skips preceding invalid characters.

normal_distribution

Returns probability based on deviation from the mean(m) and sigma(s)

num2hex

Returns the hex value of a decimal number. len == length of returned string.