OnGlobalMem
Prototype
OnGlobalMem,ADDRESS,VALUE,COMPARISON TYPE (how many times the event runs),EVENT,Active Time,DATA SIZE
Description
Scans SMBX global memory at ADDRESS. Does COMPARISON to the VALUE at that ADDRESS, and if the compaison is true, it activates EVENT. DATA SIZE is what type of data it should look for at that offset.
Notes
The ADDRESS Is the memory location of some value stored by SMBX. Very few of them are fully understood. These are the ones I've found:
- ADDRESSES - 0x00B2C8B4 - w = P switch freeze effect on or off 0x00B2C5A8 - w = Current coin count 0x00B2C5AC - f = Player lives 0x00B2C8C4 - w = "You have cheated" variable. 0xFFFF = you've cheated, 0x0 = you haven't cheated
COMPARISON types compare the value at OFFSET to the VALUE in the command.
COMPARISON = 0 = EQUALS. If the VALUE is exactly equal, activate the event. COMPARISON = 1 = GREATER THAN. If the VALUE is bigger, activate the event. COMPARISON = 2 = LESS THAN. If the VALUE is smaller, activate the event.
There are 5 DATA SIZES used to change memory. The data size has to match the type the OFFSET uses. Check the in depth tutorial to actually understand this.
b = byte (1 byte of memory) w = word (2 bytes of memory) dw = double word (4 bytes of memory) f = float / decimal (4 bytes of memory) df = double float / double precision decimal (8 bytes of memory)
Examples
// If player has exactly 0 lives, activate event 1000 once
OnGlobalMem,0x00B2C5AC,0,0,1000,1,f
// If player has more than 50 coins, continuously activate event 1001
OnGlobalMem,0x00B2C5A8,50,1,1001,1,w
// If player has cheated, activate event 1002 once
OnGlobalMem,0x00B2C8C4,0xFFFF,0,1002,1,w