SMBX Player Offsets

From PGE Wiki
Jump to navigation Jump to search

This is the memory map for the player struct. This struct is not fully analysed. Any help is appreciated! Please note that the data may not be fully 100% accurate.

PC Memory (0x184 bytes)
Name Memory address Memory type Description
Toad doublejump PC+0x00 FIELD_BOOL Toad doublejump ready (FFFF true)
Star sparkle effect PC+0x02 FIELD_WORD Star sparkling effect on player
Using airship vehicle PC+0x04 FIELD_BOOL Whether or not the player is using the unfinished airship vehicle NPC. Forcing to true results in disabling horizontal movement and ducking. Setting to '1' as 'FIELD_WORD' can result in only disabling ducking.
In quicksand) PC+0x06 FIELD_BOOL Whether or not the player is in quicksand.
Link bomb count PC+0x08 FIELD_WORD Number of bombs Link has in his inventory.
Slippery physics PC+0x0A FIELD_BOOL Is on slippery ground
Link Content Below N/A N/A N/A
Is fairy PC+0x0C FIELD_BOOL Is a fairy
Fairy jump PC+0x0E FIELD_BOOL Fairy already used this jump
Fairy time left PC+0x10 FIELD_WORD Frames until fairy runs out
Link has key PC+0x12 FIELD_BOOL Link has a key
Link slash timer PC+0x14 FIELD_WORD Link slash cooldown timer
Health PC+0x16 FIELD_WORD # of hearts (all characters)
Peach Content Below N/A N/A N/A
Peach can hover PC+0x18 FIELD_BOOL Princess hover is available
Jump button flag PC+0x1A FIELD_BOOL Holding jump button (labelled as 'FloatRelease' in source code? Most likely is used somewhere in releasing Peach's hover.)
Princess hover timer PC+0x1C FIELD_WORD Princess hover timer
Unknown PC+0x1E FIELD_WORD Unknown/Unused? (not cleared on level load)
Peach hover y-speed PC+0x20 FIELD_FLOAT Princess hover Y tremble speed
Peach hover PC+0x24 FIELD_WORD Princess hover Y tremble direction
Situation/Action Content Below N/A N/A N/A
Grass pull timer PC+0x26 FIELD_WORD Ground item pull-up timer
Grass pull saved momentum PC+0x28 FIELD_FLOAT Ground item pull-up momentum save
Unknown PC+0x2A FIELD_WORD Unknown/Unused? (not cleared on level load)
Climbed NPC index PC+0x2C FIELD_DFLOAT Index of NPC currently being climbed on (-1 if climbing on a net bgo) (Note: does not reset after jumping off. Using 0x40 for checking climbing state.)
Water physics PC+0x34 FIELD_WORD 2 when in water or quicksand; can be used to force the player into an underwater state
Underwater flag PC+0x36 FIELD_BOOL Is underwater
Water stroke timer PC+0x38 FIELD_WORD Water stroke timer (can't stroke again until 0)
No Gravity (?) PC+0x3A FIELD_WORD When forced to a value over zero, seemingly causes the player to not be affected by gravity. Possibly used for special states like Peach hover.
Sliding flag PC+0x3C FIELD_BOOL Is sliding
Sliding dust flag PC+0x3E FIELD_BOOL Is generating sliding dust puffs
Climbing state PC+0x40 FIELD_WORD Climbing state (3 climbing, 2 pushed up against edge of climbable area)
Unknown PC+0x42 FIELD_WORD Labelled as 'NoShellKick' in source code, seemingly has no effect?
Rainbow rider flag PC+0x44 FIELD_BOOL Flag for riding a rainbow shell
Powerup ID PC+0x46 FIELD_WORD ID of the NPC used to reach current powerup state
Index of slope stood on PC+0x48 FIELD_WORD Index of the slope that the player is standing on in the block array, or 0 for not standing on a slope.
Tanooki Suit Content Below N/A N/A N/A
Statue flag PC+0x4A FIELD_BOOL Tanooki suit statue flag
Statue cooldown timer PC+0x4C FIELD_WORD Frames left before you can transform into a statue again
Statue timer PC+0x4E FIELD_WORD Frames spent as statue
Spin jump Content Below N/A N/A N/A
Spinjump flag PC+0x50 FIELD_BOOL Spinjump flag
Spinjump animation timer PC+0x52 FIELD_WORD Timer used for the animation of the spinjump
Spinjump direction PC+0x54 FIELD_WORD The direction that the player was facing before spinjumping (used for shooting fireballs while spinjumping)
Misc Content Below N/A N/A N/A
Kill combo PC+0x56 FIELD_WORD Current enemy kill combo count
Sliding dust timer PC+0x58 FIELD_WORD Timer used to spawn sliding puff effects
Warp index PC+0x5A FIELD_WORD Index/id of an intersecting warp entrance
Mount Content Below N/A N/A N/A
Can Groundpound PC+0x60 FIELD_BOOL Whether or not the player can groundpound when using a purple yoshi.
Unknown PC+0x62 FIELD_WORD Unknown (purple yoshi groundpound related?)
Yoshi stomp flag PC+0x64 FIELD_BOOL Yoshi has earthquake stomp (yellow shell)
Yoshi flight flag PC+0x66 FIELD_BOOL Yoshi has flight/wings (blue shell)
Yoshi flame flag PC+0x68 FIELD_BOOL Yoshi has fire breath (red shell)
Wings animation state PC+0x6A FIELD_WORD Wings' current frame (Yoshi and Kuribo's Shoe))
Wings animation timer PC+0x6C FIELD_WORD Wings' animation timer (Yoshi and Kuribo's Shoe)
Yoshi head x-offset PC+0x6E FIELD_WORD Yoshi head's x-offset
Yoshi head y-offset PC+0x70 FIELD_WORD Yoshi head's y-offset
Yoshi head animation state PC+0x72 FIELD_WORD Yoshi head's animation state (0-4 is left, 5-9 is right)
Yoshi swallow timer PC+0x74 FIELD_WORD Yoshi swallow timer (not tongue, but swallowing)
Unknown PC+0x76 FIELD_WORD Unknown/Unused? (Seems to be a constant -4)
Unknown PC+0x78 FIELD_WORD Yoshi-related offset value
Yoshi body animation state PC+0x7A FIELD_WORD Yoshi body's animation frame (0-6 is left, 7-13 is right)
Yoshi animation timer PC+0x7C FIELD_WORD Yoshi animation frame timer (rapidly increments from 0 to 32, freezes in the air, resets to 0 when pressing down; probably used to to move body and head with the animation)
Unknown PC+0x7E FIELD_WORD Unknown/Unused?
Tongue x PC+0x80 FIELD_DFLOAT Tongue x-position
Tongue y PC+0x88 FIELD_DFLOAT Tongue y-position
Tongue width PC+0x90 FIELD_DFLOAT Tongue Width
Tongue height PC+0x98 FIELD_DFLOAT Tongue Height
Unknown PC+0xA0 FIELD_WORD Unknown/Unused?
Unknown PC+0xA8 FIELD_WORD Unknown/Unused?
Tongue x start/end PC+0xB0 FIELD_FLOAT Tongue x-start/end position
Tongue x offset PC+0xB4 FIELD_WORD Tongue x-offset from start/end
Tongue retracting flag PC+0xB6 FIELD_BOOL Whether tongue is retracting
Tongue contained NPC index PC+0xB8 FIELD_WORD Index of NPC currently on the tongue (0 if no NPC)
Tounge player index PC+0xBA FIELD_WORD Index of the player on yoshi's tongue/in yoshi's mouth.
Mounting cooldown PC+0xBC FIELD_WORD Time until the player is able to reenter a mount.
Unknown PC+0xBE FIELD_WORD Unknown/Unused?
Position Content Below N/A N/A N/A
Player x PC+0xC0 FIELD_DFLOAT Player x position (absolute coordinates within level)
Player y PC+0xC8 FIELD_DFLOAT Player y position (absolute coordinates within level)
Player height PC+0xD0 FIELD_DFLOAT Player height or hitbox related
Player width PC+0xD8 FIELD_DFLOAT Player width or hitbox related
Player x-speed PC+0xE0 FIELD_DFLOAT Player x speed
Player y-speed PC+0xE8 FIELD_DFLOAT Player y speed
Character PC+0xF0 FIELD_WORD Player identity index:
0: Nothing! Don't use
1: Mario/Demo
2: Luigi/Iris
3: Peach/Princess
4: Toad
5: Link/Sheath)
Input Content Below N/A N/A N/A
U key pressing PC+0xF2 FIELD_BOOL Pressing up key
D key pressing PC+0xF4 FIELD_BOOL Pressing down key
L key pressing PC+0xF6 FIELD_BOOL Pressing left key
R key pressing PC+0xF8 FIELD_BOOL Pressing right key
J key pressing PC+0xFA FIELD_BOOL Pressing jump key
SJ key pressing PC+0xFC FIELD_BOOL Pressing spin jump key
R key pressing PC+0xFE FIELD_BOOL Pressing run key
R or AR key pressing PC+0x100 FIELD_BOOL Pressing run or alt run key
SEL key pressing PC+0x102 FIELD_BOOL Pressing select key
SRT key pressing PC+0x104 FIELD_BOOL Pressing start key
Direction facing PC+0x106 FIELD_WORD Direction faced (-1 left, 1 right)
Mount Content Below N/A N/A N/A
Mount identity PC+0x108 FIELD_WORD Mount identity (0 no mount, 1 boot, 2 clowncar, 3 yoshi)
Mount color PC+0x10A FIELD_WORD Mount color/variant
Multi-purpose flag PC+0x10C FIELD_WORD Yoshi: Whether Yoshi's tongue is out.
Shoes: Whether player is able to jump while hopping
Unknown (?) PC+0x10E FIELD_WORD Yoshi: Y offset (Unknown reference).
Shoes: Turns 0 when ducking, goes 5 from -6 and its value is related with player Y speed. May be the shoe hopping velocity.
Shoe/clown car animation state PC+0x110 FIELD_WORD Current frame for shoe and clown car
State Content Below N/A N/A N/A
Powerup PC+0x112 FIELD_WORD Current powerup
Player animation frame index PC+0x114 FIELD_WORD Current player sprite index being displayed. Chart for values
Unknown PC+0x116 FIELD_WORD Unused
X momentum assumption PC+0x118 FIELD_FLOAT X momentum assumption (used when determining how to draw the sprite)
Jump force PC+0x11C FIELD_WORD Current upward jumping force (2 byte integer representation)
Can jump PC+0x11E FIELD_BOOL Used to stop the player jumping when holding the jump button.
Can spinjump PC+0x120 FIELD_BOOL Used to stop the player spinjumping when holding the spinjump button.
Forced animation state PC+0x122 FIELD_WORD Forced animation state:
1: Powering up to "Big" state
2: Powering down to "Small" state
3: Entering a pipe (Crashes if no valid target warp is provided)
4: Powering up to "Fire Flower" state
5: Powering up to "Leaf" state
6: Respawning in 2-Player mode (Careful with this one)
7: Entering a door (Crashes if no valid target warp is provided)
8: Invisible/Immobile/Intangible state (Turning into a fairy or a different character)
9: On another player's Yoshi's tongue
10: In another player's Yoshi's mouth
11: Powering up to "Tanooki" state
12: Powering up to "Hammer" state
41: Powering up to "Ice Flower" state
227: Powering down from "Fire Flower" state with 3 hearts to "Big" state
228: Powering down from "Ice Flower" state with 3 hearts to "Big" state
500: Tanooki Statue poof state
WARNING! BE CAREFUL WHEN SETTING THESE VALUES. SMBX will sometimes crash depending on which values are set or if certain values are set on the same tick as others. Also note that there are no additional states for powering down from "Leaf", "Tanooki", or "Hammer" states with 3 hearts to "Big".
Forced animation timer PC+0x124 FIELD_DFLOAT Forced animation timer
Unknown PC+0x12C FIELD_BOOL Down button mirror (redundant? Marked for unknown use)
Duck flag PC+0x12E FIELD_BOOL In ducking state
Unknown PC+0x130 FIELD_BOOL Select button mirror (redundant? Marked for unknown use)
Invincibility flag PC+0x132 FIELD_BOOL True when the invincibility frames end after collecting a powerup.
Down button pressed flag PC+0x134 FIELD_BOOL Down button pressed this frame (reset next frame)
Spit from Yoshi flag PC+0x136 FIELD_BOOL Was spit out of Yoshi's mouth
X-speed push PC+0x138 FIELD_FLOAT X momentum push (eg. pushed by a bully)
Player dead flag PC+0x13C FIELD_BOOL Player death state
Player death animation timer PC+0x13E FIELD_WORD Player death animation timer
Invincibility frames timer PC+0x140 FIELD_WORD Invincibility frames timer (Decrements from 50 (powerup get) or 150 (hurt) back to 0; player is invulnerable when this is > 0.)
Invincibility frames state PC+0x142 FIELD_BOOL Invincibility frames state (flickers between true and false, dictates player visibility. If used correctly in onDraw(), can be used to make player invisible)
Unknown PC+0x144 FIELD_WORD Unknown/Unused?
Collision Content Below N/A N/A N/A
Bottom state PC+0x146 FIELD_WORD Bottom state (0 not on the ground, standing on sprite, during power-up/power-down and foot contact with a slope, 2 foot contact with a solid layer)
Left state PC+0x148 FIELD_WORD Left state (0 no left contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
Top state PC+0x14A FIELD_WORD Top state (0 no top contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
Right state PC+0x14C FIELD_WORD Right state (0 no right contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
Layer push PC+0x14E FIELD_WORD Pushed by a moving layer (0 not pushed by any, 2 being pushed to the left or right)
Unknown PC+0x150 FIELD_WORD Unknown/Unused?
Unknown PC+0x152 FIELD_WORD Unknown/Unused?
Grab Content Below N/A N/A N/A
Holding sprite index PC+0x154 FIELD_WORD Index of sprite being held (index to a specific sprite object that was generated only, -1 can't carry anything)
Can grab PC+0x156 FIELD_BOOL Whether or not the player can grab anything
Section Content Below N/A N/A N/A
Reserve box contents (?) PC+0x158 FIELD_WORD Reserve box contents (0 is no item)
Section PC+0x15A FIELD_WORD Current section
Warp timer PC+0x15C FIELD_WORD Warp cooldown timer (can't warp / pipe until 0)
Exit warp index PC+0x15E FIELD_WORD Target warp exit index/id (not reset after warping)
Projectile Content Below N/A N/A N/A
Projectile timer PC+0x160 FIELD_WORD Projectile timer (fireballs, hammers, link slash..)
Link projectile timer PC+0x162 FIELD_WORD Projectile timer 2 (link projectiles)
Tail swipe timer PC+0x164 FIELD_WORD Tail swipe timer
Unknown PC+0x166 FIELD_WORD Unknown/Unused?
Flight Content Below N/A N/A N/A
Takeoff speed threshold PC+0x168 FIELD_FLOAT Run speed aggregate until flight achievable
Can fly PC+0x16C FIELD_BOOL Can fly
Flight flag PC+0x16E FIELD_BOOL Is flying
Flight time PC+0x170 FIELD_WORD Flight time remaining
Flight run button flag PC+0x172 FIELD_BOOL Holding flight run button
Fly button flag PC+0x174 FIELD_BOOL Holding flight button
Misc Content Below N/A N/A N/A
Standing NPC index PC+0x176 FIELD_WORD Index of sprite being stood on (stores the index into the NPC array + 1. 0 when not standing on an NPC)
Unknown PC+0x178 FIELD_WORD Unknown X momentum with sprites
Unknown PC+0x17A FIELD_BOOL Usually forced to true
Unknown Content Below N/A N/A N/A
Unknown PC+0x17C FIELD_WORD Unknown/Unused?
Unknown PC+0x17E FIELD_WORD Unknown/Unused?
Unknown PC+0x180 FIELD_WORD Unknown/Unused?
Unknown PC+0x182 FIELD_WORD Unknown/Unused?
Unknown PC+0x184 FIELD_WORD Unknown/Unused?