SetVar

From PGE Wiki
Jump to navigation Jump to search

Prototype

SetVar,-,OPERATION,VALUE,-,Active time,VARIABLE NAME

Description

Manipulates permanent user variables (permanent until SMBX is closed). It performs OPERATION on a user variable using VALUE. VARIABLE NAME can be chosen by you to be whatever you wish. If no variable with the given name exists, it will be created.


Notes

There are 6 types of OPERATION to be performed on VALUE: OPERATION = 0 = Assign. VALUE will be set. OPERATION = 1 = Add. VALUE will be added to the current value. OPERATION = 2 = Subtract. VALUE will be subtracted from the current value. OPERATION = 3 = Multiply. The current value will be multiplied by VALUE. OPERATION = 4 = Divide. The current value will be divided by VALUE. OPERATION = 5 = XOR. The current value will have a bitwise exclusive-or operation performed on it against VALUE.

Examples

// Create variable "BossesBeaten" and set its value to 1
SetVar,0,0,1,0,1,BossesBeaten


// Add 1 to previously created variable
SetVar,0,1,1,0,1,BossesBeaten