A_UseCusValMemo

From SRB2 Wiki
Jump to navigation Jump to search

A_UseCusValMemo is an action that saves or reloads the actor's custom value. For this purpose, the custom value memory is used. The custom value memory is a buffer variable whose purpose is to save the current custom value so that it can be reloaded later, after the actual custom value has been changed.

If Var1 is 1, the custom value will be saved to memory; otherwise, it will be reloaded from memory, overwriting the current value. Var2 specifies additional calculations to be made:

Var2 Changes made if Var1 = 0 Changes made if Var1 = 1
0 New custom value is memory value New memory value is custom value
1 New memory value is custom value subtracted from old memory value New custom value is memory value subtracted from old custom value
2 New memory value is custom value added to old memory value New custom value is memory value added to old custom value
3 New memory value is custom value modulo old memory value New custom value is memory value modulo old custom value
4 New memory value is old memory value divided by custom value New custom value is old custom value divided by memory value
5 New memory value is old memory value multiplied with custom value New custom value is old custom value multiplied with memory value

Note that if an attempt is made to divide by zero (i.e.: Var2 is 4 and the divisor is 0), this action will do nothing.

This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.

  Actions – Custom value [view]
A_CheckCustomValueA_CheckCusValMemoA_CusValActionA_RelayCustomValueA_SetCustomValueA_UseCusValMemo