Action: Difference between revisions

→‎Frame: expand set_mario_action explanation
(→‎Frame: add OOB step)
(→‎Frame: expand set_mario_action explanation)
 
Line 100: Line 100:
## If (not interacting with door) sDisplayingDoorText = FALSE
## If (not interacting with door) sDisplayingDoorText = FALSE
## If (not interacting with warp) sJustTeleported = FALSE
## If (not interacting with warp) sJustTeleported = FALSE
# '''Loop: Call the function that executes Mario's current action'''. Each action has associated code as stated above. Whenever the function is called, it can return <code>TRUE</code>, continuing the loop. Actions often call <code>set_mario_action</code>, which returns TRUE and processes yet another action. Theoretically, this could cause an infinite loop, however such a subframe transition sequence has not been found.<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario.c#L1717-L1747</ref>
# '''Loop: Call the function that executes Mario's current action'''. Each action has associated code as stated above. Whenever the function is called, it can return <code>TRUE</code>, continuing the loop. Theoretically, there could be an infinite loop, however such a subframe transition sequence has not been found.<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario.c#L1717-L1747</ref>
## To be more accurate, each action ''group'' has a function. That function is called. That group-action function may do behaviour shared across all actions of the group before calling the action function.
#* To be more accurate, each action ''group'' has a function. That function is called. That group-action function may do behaviour shared across all actions of the group before calling the action function.
#* Actions often call <code>set_mario_action</code>, which returns <code>TRUE</code> and processes yet another action.
#** Beyond merely setting the action, <code>set_mario_action</code> also gives some actions various side effects. These are: [[Walking]], [[Hold Walking]], [[Begin Sliding]], [[Hold Begin Sliding]], [[Double Jump]], [[Backflip]], [[Triple Jump]], [[Flying Triple Jump]], [[Water Jump]], [[Hold Water Jump]], [[Burning Jump]], [[Riding Shell Jump]], [[Jump]], [[Hold Jump]], [[Wall Kick Air]], [[Top of Pole Jump]], [[Side Flip]], [[Steep Jump]], [[Lava Boost]], [[Dive]], [[Long Jump]], [[Slide Kick]], [[Jump Kick]], [[Metal Water Jump]], [[Hold Metal Water Jump]], [[Emerge From Pipe]], [[Star Fall]], [[Spawn Spin Airborne]], [[Special Exit Airborne]], and [[Special Death Exit]].
#*** Additionally, for all airborne actions, Mario's peak height is set to his y position, and the <code>MARIO_UNKNOWN_08</code> flag is set.
#** Sometimes the action itself does not return the <code>TRUE</code> from this function; so it is possible for an action function to call <code>set_mario_action</code>.twice, which cancels the first action (but possibly with side effects)
# '''Update Mario's model''' for quicksand and squishing, adjust the '''camera''', when submerged adjust the camera and spawn '''bubbles''', update '''health''', update '''cap''' hitbox and model, process wind and infinite stairs '''music'''.
# '''Update Mario's model''' for quicksand and squishing, adjust the '''camera''', when submerged adjust the camera and spawn '''bubbles''', update '''health''', update '''cap''' hitbox and model, process wind and infinite stairs '''music'''.
# Set <code>oInteractionStatus</code> to 0.
# Set <code>oInteractionStatus</code> to 0.
208

edits