diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua
index fca7f5be..ba8337af 100644
--- a/autogen/lua_definitions/functions.lua
+++ b/autogen/lua_definitions/functions.lua
@@ -4113,6 +4113,13 @@ function mario_set_forward_vel(m, speed)
-- ...
end
+--- @param m MarioState
+--- @param wcd WallCollisionData
+--- @return nil
+function mario_update_wall(m, wcd)
+ -- ...
+end
+
--- @param m MarioState
--- @param soundBits integer
--- @param waveParticleType integer
diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua
index 1702b569..7371637f 100644
--- a/autogen/lua_definitions/structs.lua
+++ b/autogen/lua_definitions/structs.lua
@@ -699,6 +699,7 @@
--- @field public vel Vec3f
--- @field public wall Surface
--- @field public wallKickTimer integer
+--- @field public wallNormal Vec3f
--- @field public wasNetworkVisible integer
--- @field public waterLevel integer
@@ -1678,6 +1679,8 @@
--- @field public posYaw integer
--- @class WallCollisionData
+--- @field public normalAddition Vec3f
+--- @field public normalCount integer
--- @field public numWalls integer
--- @field public offsetY number
--- @field public radius number
diff --git a/docs/lua/functions-3.md b/docs/lua/functions-3.md
index b81657c1..c74d03ed 100644
--- a/docs/lua/functions-3.md
+++ b/docs/lua/functions-3.md
@@ -3720,6 +3720,27 @@
+## [mario_update_wall](#mario_update_wall)
+
+### Lua Example
+`mario_update_wall(m, wcd)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| wcd | [WallCollisionData](structs.md#WallCollisionData) |
+
+### Returns
+- None
+
+### C Prototype
+`void mario_update_wall(struct MarioState* m, struct WallCollisionData* wcd);`
+
+[:arrow_up_small:](#)
+
+
+
## [play_mario_action_sound](#play_mario_action_sound)
### Lua Example
@@ -7641,974 +7662,6 @@
[:arrow_up_small:](#)
-
-
----
-# functions from obj_behaviors_2.c
-
-
-
-
-## [approach_f32_ptr](#approach_f32_ptr)
-
-### Lua Example
-`local integerValue = approach_f32_ptr(px, target, delta)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| px | `Pointer` <`number`> |
-| target | `number` |
-| delta | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 approach_f32_ptr(f32 *px, f32 target, f32 delta);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_anim_and_check_if_end](#cur_obj_init_anim_and_check_if_end)
-
-### Lua Example
-`local integerValue = cur_obj_init_anim_and_check_if_end(arg0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_init_anim_and_check_if_end(s32 arg0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_anim_check_frame](#cur_obj_init_anim_check_frame)
-
-### Lua Example
-`local integerValue = cur_obj_init_anim_check_frame(arg0, arg1)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `integer` |
-| arg1 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_init_anim_check_frame(s32 arg0, s32 arg1);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_anim_extend](#cur_obj_init_anim_extend)
-
-### Lua Example
-`cur_obj_init_anim_extend(arg0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_anim_extend(s32 arg0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_play_sound_at_anim_range](#cur_obj_play_sound_at_anim_range)
-
-### Lua Example
-`local integerValue = cur_obj_play_sound_at_anim_range(arg0, arg1, sound)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `integer` |
-| arg1 | `integer` |
-| sound | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_play_sound_at_anim_range(s8 arg0, s8 arg1, u32 sound);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_anim_if_at_end](#cur_obj_set_anim_if_at_end)
-
-### Lua Example
-`local integerValue = cur_obj_set_anim_if_at_end(arg0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_set_anim_if_at_end(s32 arg0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_spin_all_dimensions](#cur_obj_spin_all_dimensions)
-
-### Lua Example
-`cur_obj_spin_all_dimensions(arg0, arg1)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| arg0 | `number` |
-| arg1 | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_spin_all_dimensions(f32 arg0, f32 arg1);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_act_knockback](#obj_act_knockback)
-
-### Lua Example
-`obj_act_knockback(baseScale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| baseScale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_act_knockback(UNUSED f32 baseScale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_act_squished](#obj_act_squished)
-
-### Lua Example
-`obj_act_squished(baseScale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| baseScale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_act_squished(f32 baseScale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_bounce_off_walls_edges_objects](#obj_bounce_off_walls_edges_objects)
-
-### Lua Example
-`local integerValue = obj_bounce_off_walls_edges_objects(targetYaw)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_check_attacks](#obj_check_attacks)
-
-### Lua Example
-`local integerValue = obj_check_attacks(hitbox, attackedMarioAction)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
-| attackedMarioAction | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_compute_vel_from_move_pitch](#obj_compute_vel_from_move_pitch)
-
-### Lua Example
-`obj_compute_vel_from_move_pitch(speed)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| speed | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_compute_vel_from_move_pitch(f32 speed);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_die_if_above_lava_and_health_non_positive](#obj_die_if_above_lava_and_health_non_positive)
-
-### Lua Example
-`local integerValue = obj_die_if_above_lava_and_health_non_positive()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_die_if_above_lava_and_health_non_positive(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_die_if_health_non_positive](#obj_die_if_health_non_positive)
-
-### Lua Example
-`obj_die_if_health_non_positive()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void obj_die_if_health_non_positive(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_face_pitch_approach](#obj_face_pitch_approach)
-
-### Lua Example
-`local integerValue = obj_face_pitch_approach(targetPitch, deltaPitch)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetPitch | `integer` |
-| deltaPitch | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_face_pitch_approach(s16 targetPitch, s16 deltaPitch);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_face_roll_approach](#obj_face_roll_approach)
-
-### Lua Example
-`local integerValue = obj_face_roll_approach(targetRoll, deltaRoll)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetRoll | `integer` |
-| deltaRoll | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_face_roll_approach(s16 targetRoll, s16 deltaRoll);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_face_yaw_approach](#obj_face_yaw_approach)
-
-### Lua Example
-`local integerValue = obj_face_yaw_approach(targetYaw, deltaYaw)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `integer` |
-| deltaYaw | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_face_yaw_approach(s16 targetYaw, s16 deltaYaw);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_forward_vel_approach](#obj_forward_vel_approach)
-
-### Lua Example
-`local integerValue = obj_forward_vel_approach(target, delta)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| target | `number` |
-| delta | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_forward_vel_approach(f32 target, f32 delta);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_pitch_from_vel](#obj_get_pitch_from_vel)
-
-### Lua Example
-`local integerValue = obj_get_pitch_from_vel()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_get_pitch_from_vel(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_pitch_to_home](#obj_get_pitch_to_home)
-
-### Lua Example
-`local integerValue = obj_get_pitch_to_home(latDistToHome)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| latDistToHome | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_get_pitch_to_home(f32 latDistToHome);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_grow_then_shrink](#obj_grow_then_shrink)
-
-### Lua Example
-`local integerValue = obj_grow_then_shrink(scaleVel, shootFireScale, endScale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| scaleVel | `Pointer` <`number`> |
-| shootFireScale | `number` |
-| endScale | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_handle_attacks](#obj_handle_attacks)
-
-### Lua Example
-`local integerValue = obj_handle_attacks(hitbox, attackedMarioAction, attackHandlers)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
-| attackedMarioAction | `integer` |
-| attackHandlers | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction, u8 *attackHandlers);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_near_to_and_facing_mario](#obj_is_near_to_and_facing_mario)
-
-### Lua Example
-`local integerValue = obj_is_near_to_and_facing_mario(m, maxDist, maxAngleDiff)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| maxDist | `number` |
-| maxAngleDiff | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_is_near_to_and_facing_mario(struct MarioState* m, f32 maxDist, s16 maxAngleDiff);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_rendering_enabled](#obj_is_rendering_enabled)
-
-### Lua Example
-`local integerValue = obj_is_rendering_enabled()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_is_rendering_enabled(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_move_for_one_second](#obj_move_for_one_second)
-
-### Lua Example
-`local integerValue = obj_move_for_one_second(endAction)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| endAction | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_move_for_one_second(s32 endAction);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_move_pitch_approach](#obj_move_pitch_approach)
-
-### Lua Example
-`local integerValue = obj_move_pitch_approach(target, delta)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| target | `integer` |
-| delta | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_move_pitch_approach(s16 target, s16 delta);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_random_fixed_turn](#obj_random_fixed_turn)
-
-### Lua Example
-`local integerValue = obj_random_fixed_turn(delta)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| delta | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_random_fixed_turn(s16 delta);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_resolve_collisions_and_turn](#obj_resolve_collisions_and_turn)
-
-### Lua Example
-`local integerValue = obj_resolve_collisions_and_turn(targetYaw, turnSpeed)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `integer` |
-| turnSpeed | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_resolve_collisions_and_turn(s16 targetYaw, s16 turnSpeed);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_resolve_object_collisions](#obj_resolve_object_collisions)
-
-### Lua Example
-`local integerValue = obj_resolve_object_collisions(targetYaw)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_resolve_object_collisions(s32 *targetYaw);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_roll_to_match_yaw_turn](#obj_roll_to_match_yaw_turn)
-
-### Lua Example
-`obj_roll_to_match_yaw_turn(targetYaw, maxRoll, rollSpeed)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `integer` |
-| maxRoll | `integer` |
-| rollSpeed | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_roll_to_match_yaw_turn(s16 targetYaw, s16 maxRoll, s16 rollSpeed);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_rotate_yaw_and_bounce_off_walls](#obj_rotate_yaw_and_bounce_off_walls)
-
-### Lua Example
-`obj_rotate_yaw_and_bounce_off_walls(targetYaw, turnAmount)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetYaw | `integer` |
-| turnAmount | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_rotate_yaw_and_bounce_off_walls(s16 targetYaw, s16 turnAmount);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_dist_from_home](#obj_set_dist_from_home)
-
-### Lua Example
-`obj_set_dist_from_home(distFromHome)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| distFromHome | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_dist_from_home(f32 distFromHome);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_knockback_action](#obj_set_knockback_action)
-
-### Lua Example
-`obj_set_knockback_action(attackType)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| attackType | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_knockback_action(s32 attackType);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_squished_action](#obj_set_squished_action)
-
-### Lua Example
-`obj_set_squished_action()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_squished_action(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_smooth_turn](#obj_smooth_turn)
-
-### Lua Example
-`local integerValue = obj_smooth_turn(angleVel, angle, targetAngle, targetSpeedProportion, accel, minSpeed, maxSpeed)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| angleVel | `Pointer` <`integer`> |
-| angle | `Pointer` <`integer`> |
-| targetAngle | `integer` |
-| targetSpeedProportion | `number` |
-| accel | `integer` |
-| minSpeed | `integer` |
-| maxSpeed | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_smooth_turn(s16 *angleVel, s32 *angle, s16 targetAngle, f32 targetSpeedProportion, s16 accel, s16 minSpeed, s16 maxSpeed);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_spit_fire](#obj_spit_fire)
-
-### Lua Example
-`local ObjectValue = obj_spit_fire(relativePosX, relativePosY, relativePosZ, scale, model, startSpeed, endSpeed, movePitch)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| relativePosX | `integer` |
-| relativePosY | `integer` |
-| relativePosZ | `integer` |
-| scale | `number` |
-| model | `integer` |
-| startSpeed | `number` |
-| endSpeed | `number` |
-| movePitch | `integer` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object* obj_spit_fire(s16 relativePosX, s16 relativePosY, s16 relativePosZ, f32 scale, s32 model, f32 startSpeed, f32 endSpeed, s16 movePitch);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_turn_pitch_toward_mario](#obj_turn_pitch_toward_mario)
-
-### Lua Example
-`local integerValue = obj_turn_pitch_toward_mario(m, targetOffsetY, turnAmount)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| targetOffsetY | `number` |
-| turnAmount | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_turn_pitch_toward_mario(struct MarioState* m, f32 targetOffsetY, s16 turnAmount);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_unused_die](#obj_unused_die)
-
-### Lua Example
-`obj_unused_die()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void obj_unused_die(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_update_blinking](#obj_update_blinking)
-
-### Lua Example
-`obj_update_blinking(blinkTimer, baseCycleLength, cycleLengthRange, blinkLength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| blinkTimer | `Pointer` <`integer`> |
-| baseCycleLength | `integer` |
-| cycleLengthRange | `integer` |
-| blinkLength | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_update_standard_actions](#obj_update_standard_actions)
-
-### Lua Example
-`local integerValue = obj_update_standard_actions(scale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| scale | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_update_standard_actions(f32 scale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_y_vel_approach](#obj_y_vel_approach)
-
-### Lua Example
-`local integerValue = obj_y_vel_approach(target, delta)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| target | `number` |
-| delta | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_y_vel_approach(f32 target, f32 delta);`
-
-[:arrow_up_small:](#)
-
-
-
-## [oscillate_toward](#oscillate_toward)
-
-### Lua Example
-`local integerValue = oscillate_toward(value, vel, target, velCloseToZero, accel, slowdown)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `Pointer` <`integer`> |
-| vel | `Pointer` <`number`> |
-| target | `integer` |
-| velCloseToZero | `number` |
-| accel | `number` |
-| slowdown | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero, f32 accel, f32 slowdown);`
-
-[:arrow_up_small:](#)
-
-
-
-## [platform_on_track_update_pos_or_spawn_ball](#platform_on_track_update_pos_or_spawn_ball)
-
-### Lua Example
-`platform_on_track_update_pos_or_spawn_ball(ballIndex, x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| ballIndex | `integer` |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32 y, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [random_linear_offset](#random_linear_offset)
-
-### Lua Example
-`local integerValue = random_linear_offset(base, range)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| base | `integer` |
-| range | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 random_linear_offset(s16 base, s16 range);`
-
-[:arrow_up_small:](#)
-
-
-
-## [random_mod_offset](#random_mod_offset)
-
-### Lua Example
-`local integerValue = random_mod_offset(base, step, mod)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| base | `integer` |
-| step | `integer` |
-| mod | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 random_mod_offset(s16 base, s16 step, s16 mod);`
-
-[:arrow_up_small:](#)
-
-
-
-## [treat_far_home_as_mario](#treat_far_home_as_mario)
-
-### Lua Example
-`treat_far_home_as_mario(threshold, distanceToPlayer, angleToPlayer)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| threshold | `number` |
-| distanceToPlayer | `Pointer` <`integer`> |
-| angleToPlayer | `Pointer` <`integer`> |
-
-### Returns
-- None
-
-### C Prototype
-`void treat_far_home_as_mario(f32 threshold, s32* distanceToPlayer, s32* angleToPlayer);`
-
-[:arrow_up_small:](#)
-
---
diff --git a/docs/lua/functions-4.md b/docs/lua/functions-4.md
index 06a86e9b..78dc61be 100644
--- a/docs/lua/functions-4.md
+++ b/docs/lua/functions-4.md
@@ -5,6 +5,974 @@
[< prev](functions-3.md) | [1](functions.md) | [2](functions-2.md) | [3](functions-3.md) | 4]
+---
+# functions from obj_behaviors_2.c
+
+
+
+
+## [approach_f32_ptr](#approach_f32_ptr)
+
+### Lua Example
+`local integerValue = approach_f32_ptr(px, target, delta)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| px | `Pointer` <`number`> |
+| target | `number` |
+| delta | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 approach_f32_ptr(f32 *px, f32 target, f32 delta);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_anim_and_check_if_end](#cur_obj_init_anim_and_check_if_end)
+
+### Lua Example
+`local integerValue = cur_obj_init_anim_and_check_if_end(arg0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_init_anim_and_check_if_end(s32 arg0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_anim_check_frame](#cur_obj_init_anim_check_frame)
+
+### Lua Example
+`local integerValue = cur_obj_init_anim_check_frame(arg0, arg1)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `integer` |
+| arg1 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_init_anim_check_frame(s32 arg0, s32 arg1);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_anim_extend](#cur_obj_init_anim_extend)
+
+### Lua Example
+`cur_obj_init_anim_extend(arg0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_anim_extend(s32 arg0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_play_sound_at_anim_range](#cur_obj_play_sound_at_anim_range)
+
+### Lua Example
+`local integerValue = cur_obj_play_sound_at_anim_range(arg0, arg1, sound)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `integer` |
+| arg1 | `integer` |
+| sound | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_play_sound_at_anim_range(s8 arg0, s8 arg1, u32 sound);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_anim_if_at_end](#cur_obj_set_anim_if_at_end)
+
+### Lua Example
+`local integerValue = cur_obj_set_anim_if_at_end(arg0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_set_anim_if_at_end(s32 arg0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_spin_all_dimensions](#cur_obj_spin_all_dimensions)
+
+### Lua Example
+`cur_obj_spin_all_dimensions(arg0, arg1)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| arg0 | `number` |
+| arg1 | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_spin_all_dimensions(f32 arg0, f32 arg1);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_act_knockback](#obj_act_knockback)
+
+### Lua Example
+`obj_act_knockback(baseScale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| baseScale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_act_knockback(UNUSED f32 baseScale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_act_squished](#obj_act_squished)
+
+### Lua Example
+`obj_act_squished(baseScale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| baseScale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_act_squished(f32 baseScale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_bounce_off_walls_edges_objects](#obj_bounce_off_walls_edges_objects)
+
+### Lua Example
+`local integerValue = obj_bounce_off_walls_edges_objects(targetYaw)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_check_attacks](#obj_check_attacks)
+
+### Lua Example
+`local integerValue = obj_check_attacks(hitbox, attackedMarioAction)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
+| attackedMarioAction | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_compute_vel_from_move_pitch](#obj_compute_vel_from_move_pitch)
+
+### Lua Example
+`obj_compute_vel_from_move_pitch(speed)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| speed | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_compute_vel_from_move_pitch(f32 speed);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_die_if_above_lava_and_health_non_positive](#obj_die_if_above_lava_and_health_non_positive)
+
+### Lua Example
+`local integerValue = obj_die_if_above_lava_and_health_non_positive()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_die_if_above_lava_and_health_non_positive(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_die_if_health_non_positive](#obj_die_if_health_non_positive)
+
+### Lua Example
+`obj_die_if_health_non_positive()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void obj_die_if_health_non_positive(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_face_pitch_approach](#obj_face_pitch_approach)
+
+### Lua Example
+`local integerValue = obj_face_pitch_approach(targetPitch, deltaPitch)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetPitch | `integer` |
+| deltaPitch | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_face_pitch_approach(s16 targetPitch, s16 deltaPitch);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_face_roll_approach](#obj_face_roll_approach)
+
+### Lua Example
+`local integerValue = obj_face_roll_approach(targetRoll, deltaRoll)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetRoll | `integer` |
+| deltaRoll | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_face_roll_approach(s16 targetRoll, s16 deltaRoll);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_face_yaw_approach](#obj_face_yaw_approach)
+
+### Lua Example
+`local integerValue = obj_face_yaw_approach(targetYaw, deltaYaw)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `integer` |
+| deltaYaw | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_face_yaw_approach(s16 targetYaw, s16 deltaYaw);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_forward_vel_approach](#obj_forward_vel_approach)
+
+### Lua Example
+`local integerValue = obj_forward_vel_approach(target, delta)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| target | `number` |
+| delta | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_forward_vel_approach(f32 target, f32 delta);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_pitch_from_vel](#obj_get_pitch_from_vel)
+
+### Lua Example
+`local integerValue = obj_get_pitch_from_vel()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_get_pitch_from_vel(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_pitch_to_home](#obj_get_pitch_to_home)
+
+### Lua Example
+`local integerValue = obj_get_pitch_to_home(latDistToHome)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| latDistToHome | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_get_pitch_to_home(f32 latDistToHome);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_grow_then_shrink](#obj_grow_then_shrink)
+
+### Lua Example
+`local integerValue = obj_grow_then_shrink(scaleVel, shootFireScale, endScale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| scaleVel | `Pointer` <`number`> |
+| shootFireScale | `number` |
+| endScale | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_handle_attacks](#obj_handle_attacks)
+
+### Lua Example
+`local integerValue = obj_handle_attacks(hitbox, attackedMarioAction, attackHandlers)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
+| attackedMarioAction | `integer` |
+| attackHandlers | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction, u8 *attackHandlers);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_near_to_and_facing_mario](#obj_is_near_to_and_facing_mario)
+
+### Lua Example
+`local integerValue = obj_is_near_to_and_facing_mario(m, maxDist, maxAngleDiff)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| maxDist | `number` |
+| maxAngleDiff | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_is_near_to_and_facing_mario(struct MarioState* m, f32 maxDist, s16 maxAngleDiff);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_rendering_enabled](#obj_is_rendering_enabled)
+
+### Lua Example
+`local integerValue = obj_is_rendering_enabled()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_is_rendering_enabled(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_move_for_one_second](#obj_move_for_one_second)
+
+### Lua Example
+`local integerValue = obj_move_for_one_second(endAction)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| endAction | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_move_for_one_second(s32 endAction);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_move_pitch_approach](#obj_move_pitch_approach)
+
+### Lua Example
+`local integerValue = obj_move_pitch_approach(target, delta)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| target | `integer` |
+| delta | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_move_pitch_approach(s16 target, s16 delta);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_random_fixed_turn](#obj_random_fixed_turn)
+
+### Lua Example
+`local integerValue = obj_random_fixed_turn(delta)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| delta | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_random_fixed_turn(s16 delta);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_resolve_collisions_and_turn](#obj_resolve_collisions_and_turn)
+
+### Lua Example
+`local integerValue = obj_resolve_collisions_and_turn(targetYaw, turnSpeed)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `integer` |
+| turnSpeed | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_resolve_collisions_and_turn(s16 targetYaw, s16 turnSpeed);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_resolve_object_collisions](#obj_resolve_object_collisions)
+
+### Lua Example
+`local integerValue = obj_resolve_object_collisions(targetYaw)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_resolve_object_collisions(s32 *targetYaw);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_roll_to_match_yaw_turn](#obj_roll_to_match_yaw_turn)
+
+### Lua Example
+`obj_roll_to_match_yaw_turn(targetYaw, maxRoll, rollSpeed)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `integer` |
+| maxRoll | `integer` |
+| rollSpeed | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_roll_to_match_yaw_turn(s16 targetYaw, s16 maxRoll, s16 rollSpeed);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_rotate_yaw_and_bounce_off_walls](#obj_rotate_yaw_and_bounce_off_walls)
+
+### Lua Example
+`obj_rotate_yaw_and_bounce_off_walls(targetYaw, turnAmount)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetYaw | `integer` |
+| turnAmount | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_rotate_yaw_and_bounce_off_walls(s16 targetYaw, s16 turnAmount);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_dist_from_home](#obj_set_dist_from_home)
+
+### Lua Example
+`obj_set_dist_from_home(distFromHome)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| distFromHome | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_dist_from_home(f32 distFromHome);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_knockback_action](#obj_set_knockback_action)
+
+### Lua Example
+`obj_set_knockback_action(attackType)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| attackType | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_knockback_action(s32 attackType);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_squished_action](#obj_set_squished_action)
+
+### Lua Example
+`obj_set_squished_action()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_squished_action(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_smooth_turn](#obj_smooth_turn)
+
+### Lua Example
+`local integerValue = obj_smooth_turn(angleVel, angle, targetAngle, targetSpeedProportion, accel, minSpeed, maxSpeed)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| angleVel | `Pointer` <`integer`> |
+| angle | `Pointer` <`integer`> |
+| targetAngle | `integer` |
+| targetSpeedProportion | `number` |
+| accel | `integer` |
+| minSpeed | `integer` |
+| maxSpeed | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_smooth_turn(s16 *angleVel, s32 *angle, s16 targetAngle, f32 targetSpeedProportion, s16 accel, s16 minSpeed, s16 maxSpeed);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_spit_fire](#obj_spit_fire)
+
+### Lua Example
+`local ObjectValue = obj_spit_fire(relativePosX, relativePosY, relativePosZ, scale, model, startSpeed, endSpeed, movePitch)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| relativePosX | `integer` |
+| relativePosY | `integer` |
+| relativePosZ | `integer` |
+| scale | `number` |
+| model | `integer` |
+| startSpeed | `number` |
+| endSpeed | `number` |
+| movePitch | `integer` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object* obj_spit_fire(s16 relativePosX, s16 relativePosY, s16 relativePosZ, f32 scale, s32 model, f32 startSpeed, f32 endSpeed, s16 movePitch);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_turn_pitch_toward_mario](#obj_turn_pitch_toward_mario)
+
+### Lua Example
+`local integerValue = obj_turn_pitch_toward_mario(m, targetOffsetY, turnAmount)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| targetOffsetY | `number` |
+| turnAmount | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_turn_pitch_toward_mario(struct MarioState* m, f32 targetOffsetY, s16 turnAmount);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_unused_die](#obj_unused_die)
+
+### Lua Example
+`obj_unused_die()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void obj_unused_die(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_update_blinking](#obj_update_blinking)
+
+### Lua Example
+`obj_update_blinking(blinkTimer, baseCycleLength, cycleLengthRange, blinkLength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| blinkTimer | `Pointer` <`integer`> |
+| baseCycleLength | `integer` |
+| cycleLengthRange | `integer` |
+| blinkLength | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_update_standard_actions](#obj_update_standard_actions)
+
+### Lua Example
+`local integerValue = obj_update_standard_actions(scale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| scale | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_update_standard_actions(f32 scale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_y_vel_approach](#obj_y_vel_approach)
+
+### Lua Example
+`local integerValue = obj_y_vel_approach(target, delta)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| target | `number` |
+| delta | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_y_vel_approach(f32 target, f32 delta);`
+
+[:arrow_up_small:](#)
+
+
+
+## [oscillate_toward](#oscillate_toward)
+
+### Lua Example
+`local integerValue = oscillate_toward(value, vel, target, velCloseToZero, accel, slowdown)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `Pointer` <`integer`> |
+| vel | `Pointer` <`number`> |
+| target | `integer` |
+| velCloseToZero | `number` |
+| accel | `number` |
+| slowdown | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero, f32 accel, f32 slowdown);`
+
+[:arrow_up_small:](#)
+
+
+
+## [platform_on_track_update_pos_or_spawn_ball](#platform_on_track_update_pos_or_spawn_ball)
+
+### Lua Example
+`platform_on_track_update_pos_or_spawn_ball(ballIndex, x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| ballIndex | `integer` |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32 y, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [random_linear_offset](#random_linear_offset)
+
+### Lua Example
+`local integerValue = random_linear_offset(base, range)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| base | `integer` |
+| range | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 random_linear_offset(s16 base, s16 range);`
+
+[:arrow_up_small:](#)
+
+
+
+## [random_mod_offset](#random_mod_offset)
+
+### Lua Example
+`local integerValue = random_mod_offset(base, step, mod)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| base | `integer` |
+| step | `integer` |
+| mod | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 random_mod_offset(s16 base, s16 step, s16 mod);`
+
+[:arrow_up_small:](#)
+
+
+
+## [treat_far_home_as_mario](#treat_far_home_as_mario)
+
+### Lua Example
+`treat_far_home_as_mario(threshold, distanceToPlayer, angleToPlayer)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| threshold | `number` |
+| distanceToPlayer | `Pointer` <`integer`> |
+| angleToPlayer | `Pointer` <`integer`> |
+
+### Returns
+- None
+
+### C Prototype
+`void treat_far_home_as_mario(f32 threshold, s32* distanceToPlayer, s32* angleToPlayer);`
+
+[:arrow_up_small:](#)
+
+
+
---
# functions from object_helpers.c
diff --git a/docs/lua/functions.md b/docs/lua/functions.md
index e9d11c00..9fb095fe 100644
--- a/docs/lua/functions.md
+++ b/docs/lua/functions.md
@@ -805,6 +805,7 @@
- [mario_get_terrain_sound_addend](functions-3.md#mario_get_terrain_sound_addend)
- [mario_set_bubbled](functions-3.md#mario_set_bubbled)
- [mario_set_forward_vel](functions-3.md#mario_set_forward_vel)
+ - [mario_update_wall](functions-3.md#mario_update_wall)
- [play_mario_action_sound](functions-3.md#play_mario_action_sound)
- [play_mario_heavy_landing_sound](functions-3.md#play_mario_heavy_landing_sound)
- [play_mario_heavy_landing_sound_once](functions-3.md#play_mario_heavy_landing_sound_once)
@@ -1042,52 +1043,52 @@
- obj_behaviors_2.c
- - [approach_f32_ptr](functions-3.md#approach_f32_ptr)
- - [cur_obj_init_anim_and_check_if_end](functions-3.md#cur_obj_init_anim_and_check_if_end)
- - [cur_obj_init_anim_check_frame](functions-3.md#cur_obj_init_anim_check_frame)
- - [cur_obj_init_anim_extend](functions-3.md#cur_obj_init_anim_extend)
- - [cur_obj_play_sound_at_anim_range](functions-3.md#cur_obj_play_sound_at_anim_range)
- - [cur_obj_set_anim_if_at_end](functions-3.md#cur_obj_set_anim_if_at_end)
- - [cur_obj_spin_all_dimensions](functions-3.md#cur_obj_spin_all_dimensions)
- - [obj_act_knockback](functions-3.md#obj_act_knockback)
- - [obj_act_squished](functions-3.md#obj_act_squished)
- - [obj_bounce_off_walls_edges_objects](functions-3.md#obj_bounce_off_walls_edges_objects)
- - [obj_check_attacks](functions-3.md#obj_check_attacks)
- - [obj_compute_vel_from_move_pitch](functions-3.md#obj_compute_vel_from_move_pitch)
- - [obj_die_if_above_lava_and_health_non_positive](functions-3.md#obj_die_if_above_lava_and_health_non_positive)
- - [obj_die_if_health_non_positive](functions-3.md#obj_die_if_health_non_positive)
- - [obj_face_pitch_approach](functions-3.md#obj_face_pitch_approach)
- - [obj_face_roll_approach](functions-3.md#obj_face_roll_approach)
- - [obj_face_yaw_approach](functions-3.md#obj_face_yaw_approach)
- - [obj_forward_vel_approach](functions-3.md#obj_forward_vel_approach)
- - [obj_get_pitch_from_vel](functions-3.md#obj_get_pitch_from_vel)
- - [obj_get_pitch_to_home](functions-3.md#obj_get_pitch_to_home)
- - [obj_grow_then_shrink](functions-3.md#obj_grow_then_shrink)
- - [obj_handle_attacks](functions-3.md#obj_handle_attacks)
- - [obj_is_near_to_and_facing_mario](functions-3.md#obj_is_near_to_and_facing_mario)
- - [obj_is_rendering_enabled](functions-3.md#obj_is_rendering_enabled)
- - [obj_move_for_one_second](functions-3.md#obj_move_for_one_second)
- - [obj_move_pitch_approach](functions-3.md#obj_move_pitch_approach)
- - [obj_random_fixed_turn](functions-3.md#obj_random_fixed_turn)
- - [obj_resolve_collisions_and_turn](functions-3.md#obj_resolve_collisions_and_turn)
- - [obj_resolve_object_collisions](functions-3.md#obj_resolve_object_collisions)
- - [obj_roll_to_match_yaw_turn](functions-3.md#obj_roll_to_match_yaw_turn)
- - [obj_rotate_yaw_and_bounce_off_walls](functions-3.md#obj_rotate_yaw_and_bounce_off_walls)
- - [obj_set_dist_from_home](functions-3.md#obj_set_dist_from_home)
- - [obj_set_knockback_action](functions-3.md#obj_set_knockback_action)
- - [obj_set_squished_action](functions-3.md#obj_set_squished_action)
- - [obj_smooth_turn](functions-3.md#obj_smooth_turn)
- - [obj_spit_fire](functions-3.md#obj_spit_fire)
- - [obj_turn_pitch_toward_mario](functions-3.md#obj_turn_pitch_toward_mario)
- - [obj_unused_die](functions-3.md#obj_unused_die)
- - [obj_update_blinking](functions-3.md#obj_update_blinking)
- - [obj_update_standard_actions](functions-3.md#obj_update_standard_actions)
- - [obj_y_vel_approach](functions-3.md#obj_y_vel_approach)
- - [oscillate_toward](functions-3.md#oscillate_toward)
- - [platform_on_track_update_pos_or_spawn_ball](functions-3.md#platform_on_track_update_pos_or_spawn_ball)
- - [random_linear_offset](functions-3.md#random_linear_offset)
- - [random_mod_offset](functions-3.md#random_mod_offset)
- - [treat_far_home_as_mario](functions-3.md#treat_far_home_as_mario)
+ - [approach_f32_ptr](functions-4.md#approach_f32_ptr)
+ - [cur_obj_init_anim_and_check_if_end](functions-4.md#cur_obj_init_anim_and_check_if_end)
+ - [cur_obj_init_anim_check_frame](functions-4.md#cur_obj_init_anim_check_frame)
+ - [cur_obj_init_anim_extend](functions-4.md#cur_obj_init_anim_extend)
+ - [cur_obj_play_sound_at_anim_range](functions-4.md#cur_obj_play_sound_at_anim_range)
+ - [cur_obj_set_anim_if_at_end](functions-4.md#cur_obj_set_anim_if_at_end)
+ - [cur_obj_spin_all_dimensions](functions-4.md#cur_obj_spin_all_dimensions)
+ - [obj_act_knockback](functions-4.md#obj_act_knockback)
+ - [obj_act_squished](functions-4.md#obj_act_squished)
+ - [obj_bounce_off_walls_edges_objects](functions-4.md#obj_bounce_off_walls_edges_objects)
+ - [obj_check_attacks](functions-4.md#obj_check_attacks)
+ - [obj_compute_vel_from_move_pitch](functions-4.md#obj_compute_vel_from_move_pitch)
+ - [obj_die_if_above_lava_and_health_non_positive](functions-4.md#obj_die_if_above_lava_and_health_non_positive)
+ - [obj_die_if_health_non_positive](functions-4.md#obj_die_if_health_non_positive)
+ - [obj_face_pitch_approach](functions-4.md#obj_face_pitch_approach)
+ - [obj_face_roll_approach](functions-4.md#obj_face_roll_approach)
+ - [obj_face_yaw_approach](functions-4.md#obj_face_yaw_approach)
+ - [obj_forward_vel_approach](functions-4.md#obj_forward_vel_approach)
+ - [obj_get_pitch_from_vel](functions-4.md#obj_get_pitch_from_vel)
+ - [obj_get_pitch_to_home](functions-4.md#obj_get_pitch_to_home)
+ - [obj_grow_then_shrink](functions-4.md#obj_grow_then_shrink)
+ - [obj_handle_attacks](functions-4.md#obj_handle_attacks)
+ - [obj_is_near_to_and_facing_mario](functions-4.md#obj_is_near_to_and_facing_mario)
+ - [obj_is_rendering_enabled](functions-4.md#obj_is_rendering_enabled)
+ - [obj_move_for_one_second](functions-4.md#obj_move_for_one_second)
+ - [obj_move_pitch_approach](functions-4.md#obj_move_pitch_approach)
+ - [obj_random_fixed_turn](functions-4.md#obj_random_fixed_turn)
+ - [obj_resolve_collisions_and_turn](functions-4.md#obj_resolve_collisions_and_turn)
+ - [obj_resolve_object_collisions](functions-4.md#obj_resolve_object_collisions)
+ - [obj_roll_to_match_yaw_turn](functions-4.md#obj_roll_to_match_yaw_turn)
+ - [obj_rotate_yaw_and_bounce_off_walls](functions-4.md#obj_rotate_yaw_and_bounce_off_walls)
+ - [obj_set_dist_from_home](functions-4.md#obj_set_dist_from_home)
+ - [obj_set_knockback_action](functions-4.md#obj_set_knockback_action)
+ - [obj_set_squished_action](functions-4.md#obj_set_squished_action)
+ - [obj_smooth_turn](functions-4.md#obj_smooth_turn)
+ - [obj_spit_fire](functions-4.md#obj_spit_fire)
+ - [obj_turn_pitch_toward_mario](functions-4.md#obj_turn_pitch_toward_mario)
+ - [obj_unused_die](functions-4.md#obj_unused_die)
+ - [obj_update_blinking](functions-4.md#obj_update_blinking)
+ - [obj_update_standard_actions](functions-4.md#obj_update_standard_actions)
+ - [obj_y_vel_approach](functions-4.md#obj_y_vel_approach)
+ - [oscillate_toward](functions-4.md#oscillate_toward)
+ - [platform_on_track_update_pos_or_spawn_ball](functions-4.md#platform_on_track_update_pos_or_spawn_ball)
+ - [random_linear_offset](functions-4.md#random_linear_offset)
+ - [random_mod_offset](functions-4.md#random_mod_offset)
+ - [treat_far_home_as_mario](functions-4.md#treat_far_home_as_mario)
diff --git a/docs/lua/structs.md b/docs/lua/structs.md
index 4b64d5e9..2f8d4190 100644
--- a/docs/lua/structs.md
+++ b/docs/lua/structs.md
@@ -999,6 +999,7 @@
| vel | [Vec3f](structs.md#Vec3f) | read-only |
| wall | [Surface](structs.md#Surface) | |
| wallKickTimer | `integer` | |
+| wallNormal | [Vec3f](structs.md#Vec3f) | read-only |
| wasNetworkVisible | `integer` | |
| waterLevel | `integer` | |
@@ -2171,6 +2172,8 @@
| Field | Type | Access |
| ----- | ---- | ------ |
+| normalAddition | [Vec3f](structs.md#Vec3f) | read-only |
+| normalCount | `integer` | |
| numWalls | `integer` | |
| offsetY | `number` | |
| radius | `number` | |
diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c
index 6d722937..7025acb9 100644
--- a/src/pc/lua/smlua_cobject_autogen.c
+++ b/src/pc/lua/smlua_cobject_autogen.c
@@ -738,7 +738,7 @@ static struct LuaObjectField sMarioBodyStateFields[LUA_MARIO_BODY_STATE_FIELD_CO
{ "wingFlutter", LVT_S8, offsetof(struct MarioBodyState, wingFlutter), false, LOT_NONE },
};
-#define LUA_MARIO_STATE_FIELD_COUNT 74
+#define LUA_MARIO_STATE_FIELD_COUNT 75
static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "action", LVT_U32, offsetof(struct MarioState, action), false, LOT_NONE },
{ "actionArg", LVT_U32, offsetof(struct MarioState, actionArg), false, LOT_NONE },
@@ -813,6 +813,7 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F },
{ "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE },
{ "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE },
+ { "wallNormal", LVT_COBJECT, offsetof(struct MarioState, wallNormal), true, LOT_VEC3F },
{ "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE },
{ "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE },
};
@@ -1855,14 +1856,16 @@ static struct LuaObjectField sTransitionInfoFields[LUA_TRANSITION_INFO_FIELD_COU
{ "posYaw", LVT_S16, offsetof(struct TransitionInfo, posYaw), false, LOT_NONE },
};
-#define LUA_WALL_COLLISION_DATA_FIELD_COUNT 4
+#define LUA_WALL_COLLISION_DATA_FIELD_COUNT 6
static struct LuaObjectField sWallCollisionDataFields[LUA_WALL_COLLISION_DATA_FIELD_COUNT] = {
- { "numWalls", LVT_S16, offsetof(struct WallCollisionData, numWalls), false, LOT_NONE },
- { "offsetY", LVT_F32, offsetof(struct WallCollisionData, offsetY), false, LOT_NONE },
- { "radius", LVT_F32, offsetof(struct WallCollisionData, radius), false, LOT_NONE },
- { "unused", LVT_S16, offsetof(struct WallCollisionData, unused), false, LOT_NONE },
-// { "walls", LOT_???, offsetof(struct WallCollisionData, walls), false, LOT_??? }, <--- UNIMPLEMENTED
-// { "z", LVT_???, offsetof(struct WallCollisionData, z), false, LOT_??? }, <--- UNIMPLEMENTED
+ { "normalAddition", LVT_COBJECT, offsetof(struct WallCollisionData, normalAddition), true, LOT_VEC3F },
+ { "normalCount", LVT_U8, offsetof(struct WallCollisionData, normalCount), false, LOT_NONE },
+ { "numWalls", LVT_S16, offsetof(struct WallCollisionData, numWalls), false, LOT_NONE },
+ { "offsetY", LVT_F32, offsetof(struct WallCollisionData, offsetY), false, LOT_NONE },
+ { "radius", LVT_F32, offsetof(struct WallCollisionData, radius), false, LOT_NONE },
+ { "unused", LVT_S16, offsetof(struct WallCollisionData, unused), false, LOT_NONE },
+// { "walls", LOT_???, offsetof(struct WallCollisionData, walls), false, LOT_??? }, <--- UNIMPLEMENTED
+// { "z", LVT_???, offsetof(struct WallCollisionData, z), false, LOT_??? }, <--- UNIMPLEMENTED
};
#define LUA_WARP_NODE_FIELD_COUNT 4
diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c
index e336c4a1..35598f99 100644
--- a/src/pc/lua/smlua_functions_autogen.c
+++ b/src/pc/lua/smlua_functions_autogen.c
@@ -8259,6 +8259,19 @@ int smlua_func_mario_set_forward_vel(lua_State* L) {
return 1;
}
+int smlua_func_mario_update_wall(lua_State* L) {
+ if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
+
+ struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
+ struct WallCollisionData* wcd = (struct WallCollisionData*)smlua_to_cobject(L, 2, LOT_WALLCOLLISIONDATA);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
+
+ mario_update_wall(m, wcd);
+
+ return 1;
+}
+
int smlua_func_play_mario_action_sound(lua_State* L) {
if(!smlua_functions_valid_param_count(L, 3)) { return 0; }
@@ -17283,6 +17296,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "mario_get_terrain_sound_addend", smlua_func_mario_get_terrain_sound_addend);
smlua_bind_function(L, "mario_set_bubbled", smlua_func_mario_set_bubbled);
smlua_bind_function(L, "mario_set_forward_vel", smlua_func_mario_set_forward_vel);
+ smlua_bind_function(L, "mario_update_wall", smlua_func_mario_update_wall);
smlua_bind_function(L, "play_mario_action_sound", smlua_func_play_mario_action_sound);
smlua_bind_function(L, "play_mario_heavy_landing_sound", smlua_func_play_mario_heavy_landing_sound);
smlua_bind_function(L, "play_mario_heavy_landing_sound_once", smlua_func_play_mario_heavy_landing_sound_once);