* Document functions in Camera.h This is the complete documentation for Camera.h * Fix some grammar and formatting mistakes.
145 KiB
⏪ Lua Functions
< prev | 1 | 2 | 3 | 4 | 5 | 6 | next >]
functions from behavior_script.h
draw_distance_scalar
Description
Gets the draw distance scalar
Lua Example
local numberValue = draw_distance_scalar()
Parameters
- None
Returns
number
C Prototype
f32 draw_distance_scalar(void);
obj_update_gfx_pos_and_angle
Description
Updates an object's graphical position and angle
Lua Example
obj_update_gfx_pos_and_angle(obj)
Parameters
| Field | Type |
|---|---|
| obj | Object |
Returns
- None
C Prototype
void obj_update_gfx_pos_and_angle(struct Object *obj);
position_based_random_float_position
Description
Sets the current object's position to random floats between 0.0 and 1.0
Lua Example
local numberValue = position_based_random_float_position()
Parameters
- None
Returns
number
C Prototype
f32 position_based_random_float_position(void);
position_based_random_u16
Description
Sets the current object's position to random integers between 0 and 65536
Lua Example
local integerValue = position_based_random_u16()
Parameters
- None
Returns
integer
C Prototype
u16 position_based_random_u16(void);
random_float
Description
Generates a pseudo random float between 0.0 and 1.0
Lua Example
local numberValue = random_float()
Parameters
- None
Returns
number
C Prototype
float random_float(void);
random_sign
Description
Returns either 1 or -1 with a pseudo 50:50 chance
Lua Example
local integerValue = random_sign()
Parameters
- None
Returns
integer
C Prototype
s32 random_sign(void);
random_u16
Description
Generates a pseudo random integer between 0 and 65535
Lua Example
local integerValue = random_u16()
Parameters
- None
Returns
integer
C Prototype
u16 random_u16(void);
functions from behavior_table.h
get_behavior_from_id
Description
Gets a behavior script from a behavior ID
Lua Example
local PointerValue = get_behavior_from_id(id)
Parameters
| Field | Type |
|---|---|
| id | enum BehaviorId |
Returns
Pointer<BehaviorScript>
C Prototype
const BehaviorScript* get_behavior_from_id(enum BehaviorId id);
get_behavior_name_from_id
Description
Gets a behavior name from a behavior ID (bhvMyGreatMODCustom004)
Lua Example
local stringValue = get_behavior_name_from_id(id)
Parameters
| Field | Type |
|---|---|
| id | enum BehaviorId |
Returns
string
C Prototype
const char* get_behavior_name_from_id(enum BehaviorId id);
get_id_from_behavior
Description
Gets a behavior ID from a behavior script
Lua Example
local enumValue = get_id_from_behavior(behavior)
Parameters
| Field | Type |
|---|---|
| behavior | Pointer <BehaviorScript> |
Returns
C Prototype
enum BehaviorId get_id_from_behavior(const BehaviorScript* behavior);
get_id_from_behavior_name
Description
gets a behavior ID from a behavior name
Lua Example
local enumValue = get_id_from_behavior_name(name)
Parameters
| Field | Type |
|---|---|
| name | string |
Returns
C Prototype
enum BehaviorId get_id_from_behavior_name(const char* name);
get_id_from_vanilla_behavior
Description
Gets a behavior ID from only vanilla behavior scripts
Lua Example
local enumValue = get_id_from_vanilla_behavior(behavior)
Parameters
| Field | Type |
|---|---|
| behavior | Pointer <BehaviorScript> |
Returns
C Prototype
enum BehaviorId get_id_from_vanilla_behavior(const BehaviorScript* behavior);
functions from camera.h
approach_camera_height
Description
Adjusts the camera's height toward a target value (goalHeight) while respecting terrain and obstructions. This is really wonky and probably shouldn't be used, prefer gLakituStates
Lua Example
approach_camera_height(c, goal, inc)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| goal | number |
| inc | number |
Returns
- None
C Prototype
void approach_camera_height(struct Camera *c, f32 goal, f32 inc);
approach_f32_asymptotic
Description
Gradually approaches a floating-point value (target) using asymptotic smoothing. The rate of approach is controlled by the multiplier. Useful for smoothly adjusting camera parameters like field-of-view or position
Lua Example
local numberValue = approach_f32_asymptotic(current, target, multiplier)
Parameters
| Field | Type |
|---|---|
| current | number |
| target | number |
| multiplier | number |
Returns
number
C Prototype
f32 approach_f32_asymptotic(f32 current, f32 target, f32 multiplier);
approach_f32_asymptotic_bool
Description
Gradually adjusts a floating-point value (current) towards a target (target) using asymptotic smoothing. Returns true if current reaches the target and false otherwise
Lua Example
local integerValue = approach_f32_asymptotic_bool(current, target, multiplier)
Parameters
| Field | Type |
|---|---|
| current | Pointer <number> |
| target | number |
| multiplier | number |
Returns
integer
C Prototype
s32 approach_f32_asymptotic_bool(f32 *current, f32 target, f32 multiplier);
approach_s16_asymptotic
Description
Gradually approaches a signed 16-bit integer (target) using asymptotic smoothing. The divisor controls the rate of the adjustment. Useful for adjusting angles or positions smoothly
Lua Example
local integerValue = approach_s16_asymptotic(current, target, divisor)
Parameters
| Field | Type |
|---|---|
| current | integer |
| target | integer |
| divisor | integer |
Returns
integer
C Prototype
s32 approach_s16_asymptotic(s16 current, s16 target, s16 divisor);
approach_s16_asymptotic_bool
Description
Gradually adjusts a signed 16-bit integer (current) towards a target (target) using asymptotic smoothing. Returns true if current reaches target and false otherwise
Lua Example
local integerValue = approach_s16_asymptotic_bool(current, target, divisor)
Parameters
| Field | Type |
|---|---|
| current | Pointer <integer> |
| target | integer |
| divisor | integer |
Returns
integer
C Prototype
s32 approach_s16_asymptotic_bool(s16 *current, s16 target, s16 divisor);
approach_vec3f_asymptotic
Description
Smoothly transitions a 3D vector (current) towards a target vector (target) using asymptotic scaling. Scaling values (the Mul variables) for x, y, and z axes determine the speed of adjustment for each component
Lua Example
approach_vec3f_asymptotic(current, target, xMul, yMul, zMul)
Parameters
| Field | Type |
|---|---|
| current | Vec3f |
| target | Vec3f |
| xMul | number |
| yMul | number |
| zMul | number |
Returns
- None
C Prototype
void approach_vec3f_asymptotic(Vec3f current, Vec3f target, f32 xMul, f32 yMul, f32 zMul);
calc_abs_dist
Description
Calculates the absolute distance between two 3D points (a and b). Returns the distance as a floating-point value. Useful for determining proximity between objects in 3D space
Lua Example
local numberValue = calc_abs_dist(a, b)
Parameters
| Field | Type |
|---|---|
| a | Vec3f |
| b | Vec3f |
Returns
number
C Prototype
f32 calc_abs_dist(Vec3f a, Vec3f b);
calc_hor_dist
Description
Calculates the horizontal (XZ-plane) distance between two 3D points (a and b). Returns the distance as a floating-point value. Useful for terrain navigation or collision detection
Lua Example
local numberValue = calc_hor_dist(a, b)
Parameters
| Field | Type |
|---|---|
| a | Vec3f |
| b | Vec3f |
Returns
number
C Prototype
f32 calc_hor_dist(Vec3f a, Vec3f b);
calculate_angles
Description
Calculates the pitch and yaw angles from one 3D position (from) to another (to). Updates the provided pointers with the computed pitch and yaw values
Lua Example
calculate_angles(from, to, pitch, yaw)
Parameters
| Field | Type |
|---|---|
| from | Vec3f |
| to | Vec3f |
| pitch | Pointer <integer> |
| yaw | Pointer <integer> |
Returns
- None
C Prototype
void calculate_angles(Vec3f from, Vec3f to, s16 *pitch, s16 *yaw);
calculate_pitch
Description
Calculates the pitch angle (rotation around the X-axis) from one 3D point (from) to another (to). Returns the pitch as a signed 16-bit integer
Lua Example
local integerValue = calculate_pitch(from, to)
Parameters
| Field | Type |
|---|---|
| from | Vec3f |
| to | Vec3f |
Returns
integer
C Prototype
s16 calculate_pitch(Vec3f from, Vec3f to);
calculate_yaw
Description
Determines the yaw angle (rotation around the Y-axis) from one 3D position (from) to another (to). Returns the yaw as a signed 16-bit integer
Lua Example
local integerValue = calculate_yaw(from, to)
Parameters
| Field | Type |
|---|---|
| from | Vec3f |
| to | Vec3f |
Returns
integer
C Prototype
s16 calculate_yaw(Vec3f from, Vec3f to);
cam_select_alt_mode
Description
Selects an alternate camera mode based on the given angle. Used to toggle between predefined camera modes dynamically
Lua Example
local integerValue = cam_select_alt_mode(angle)
Parameters
| Field | Type |
|---|---|
| angle | integer |
Returns
integer
C Prototype
s32 cam_select_alt_mode(s32 angle);
camera_approach_f32_symmetric
Description
Symmetrically approaches a floating-point value (target) with a fixed increment (increment) per frame. Limits the rate of change to ensure gradual transitions
Lua Example
local numberValue = camera_approach_f32_symmetric(value, target, increment)
Parameters
| Field | Type |
|---|---|
| value | number |
| target | number |
| increment | number |
Returns
number
C Prototype
f32 camera_approach_f32_symmetric(f32 value, f32 target, f32 increment);
camera_approach_f32_symmetric_bool
Description
Adjusts a floating-point value (current) towards a target (target) symmetrically with a fixed increment (increment). Returns true if the value reaches the target and false otherwise
Lua Example
local integerValue = camera_approach_f32_symmetric_bool(current, target, increment)
Parameters
| Field | Type |
|---|---|
| current | Pointer <number> |
| target | number |
| increment | number |
Returns
integer
C Prototype
s32 camera_approach_f32_symmetric_bool(f32 *current, f32 target, f32 increment);
camera_approach_s16_symmetric_bool
Description
Adjusts a signed 16-bit integer (current) towards a target (target) symmetrically with a fixed increment (increment). Returns true if the value reaches the target and false otherwise
Lua Example
local integerValue = camera_approach_s16_symmetric_bool(current, target, increment)
Parameters
| Field | Type |
|---|---|
| current | Pointer <integer> |
| target | integer |
| increment | integer |
Returns
integer
C Prototype
s32 camera_approach_s16_symmetric_bool(s16 *current, s16 target, s16 increment);
camera_course_processing
Description
Processes course-specific camera settings, such as predefined positions or modes. Adjusts the camera to match the design and gameplay requirements of the current course
Lua Example
local integerValue = camera_course_processing(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
integer
C Prototype
s16 camera_course_processing(struct Camera *c);
camera_set_use_course_specific_settings
Description
Toggles whether the camera uses course-specific settings. This is useful for enabling or disabling custom behaviors in specific courses or areas
Lua Example
camera_set_use_course_specific_settings(enable)
Parameters
| Field | Type |
|---|---|
| enable | integer |
Returns
- None
C Prototype
void camera_set_use_course_specific_settings(u8 enable);
center_rom_hack_camera
Description
Centers the ROM hack camera. This function is designed for non-standard level layouts and modded game environments
Lua Example
center_rom_hack_camera()
Parameters
- None
Returns
- None
C Prototype
void center_rom_hack_camera(void);
clamp_pitch
Description
Clamps the camera's pitch angle between a maximum and minimum value. Prevents over-rotation and maintains a consistent viewing angle
Lua Example
local integerValue = clamp_pitch(from, to, maxPitch, minPitch)
Parameters
| Field | Type |
|---|---|
| from | Vec3f |
| to | Vec3f |
| maxPitch | integer |
| minPitch | integer |
Returns
integer
C Prototype
s32 clamp_pitch(Vec3f from, Vec3f to, s16 maxPitch, s16 minPitch);
clamp_positions_and_find_yaw
Description
Clamps a position within specified X and Z bounds and calculates the yaw angle from the origin. Prevents the camera from moving outside of the designated area
Lua Example
local integerValue = clamp_positions_and_find_yaw(pos, origin, xMax, xMin, zMax, zMin)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| origin | Vec3f |
| xMax | number |
| xMin | number |
| zMax | number |
| zMin | number |
Returns
integer
C Prototype
s32 clamp_positions_and_find_yaw(Vec3f pos, Vec3f origin, f32 xMax, f32 xMin, f32 zMax, f32 zMin);
collide_with_walls
Description
Checks for collisions between the camera and level geometry. Adjusts the camera's position to avoid clipping into walls or obstacles
Lua Example
local integerValue = collide_with_walls(pos, offsetY, radius)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| offsetY | number |
| radius | number |
Returns
integer
C Prototype
s32 collide_with_walls(Vec3f pos, f32 offsetY, f32 radius);
cutscene_object
Description
Initiates a cutscene focusing on a specific object in the game world. The camera transitions smoothly to the object, adapting its position as needed
Lua Example
local integerValue = cutscene_object(cutscene, o)
Parameters
| Field | Type |
|---|---|
| cutscene | integer |
| o | Object |
Returns
integer
C Prototype
s16 cutscene_object(u8 cutscene, struct Object *o);
cutscene_object_with_dialog
Description
Starts a cutscene involving an object and displays dialog during the sequence. The camera focuses on the object while synchronizing dialog with the scene
Lua Example
local integerValue = cutscene_object_with_dialog(cutscene, o, dialogID)
Parameters
| Field | Type |
|---|---|
| cutscene | integer |
| o | Object |
| dialogID | integer |
Returns
integer
C Prototype
s16 cutscene_object_with_dialog(u8 cutscene, struct Object *o, s16 dialogID);
cutscene_object_without_dialog
Description
Starts a cutscene involving an object without dialog. The camera transitions smoothly to focus on the object
Lua Example
local integerValue = cutscene_object_without_dialog(cutscene, o)
Parameters
| Field | Type |
|---|---|
| cutscene | integer |
| o | Object |
Returns
integer
C Prototype
s16 cutscene_object_without_dialog(u8 cutscene, struct Object *o);
cutscene_set_fov_shake_preset
Description
Applies a preset field-of-view shake effect during a cutscene. This creates dynamic visual effects, such as zoom or focus disruptions
Lua Example
cutscene_set_fov_shake_preset(preset)
Parameters
| Field | Type |
|---|---|
| preset | integer |
Returns
- None
C Prototype
void cutscene_set_fov_shake_preset(u8 preset);
cutscene_spawn_obj
Description
Spawns an object as part of a cutscene, such as props or interactive elements. Returns the spawned object's reference for further manipulation
Lua Example
local integerValue = cutscene_spawn_obj(obj, frame)
Parameters
| Field | Type |
|---|---|
| obj | integer |
| frame | integer |
Returns
integer
C Prototype
s32 cutscene_spawn_obj(u32 obj, s16 frame);
find_c_buttons_pressed
Description
Determines which C-buttons are currently pressed by the player. Returns a bitmask indicating the active buttons for camera control
Lua Example
local integerValue = find_c_buttons_pressed(currentState, buttonsPressed, buttonsDown)
Parameters
| Field | Type |
|---|---|
| currentState | integer |
| buttonsPressed | integer |
| buttonsDown | integer |
Returns
integer
C Prototype
s32 find_c_buttons_pressed(u16 currentState, u16 buttonsPressed, u16 buttonsDown);
find_mario_floor_and_ceil
Description
Finds the floor and ceiling directly above and below Mario's position. Updates Mario's geometry information for camera calculations
Lua Example
find_mario_floor_and_ceil(pg)
Parameters
| Field | Type |
|---|---|
| pg | PlayerGeometry |
Returns
- None
C Prototype
void find_mario_floor_and_ceil(struct PlayerGeometry *pg);
get_cutscene_from_mario_status
Description
Gets the appropriate cutscene to play based on Mario's current gameplay state. This function helps determine transitions for cinematic or scripted sequences
Lua Example
local integerValue = get_cutscene_from_mario_status(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
integer
C Prototype
u8 get_cutscene_from_mario_status(struct Camera *c);
handle_c_button_movement
Description
Handles camera movement based on input from the C-buttons. Updates the camera's position or angle to match directional player input
Lua Example
handle_c_button_movement(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
- None
C Prototype
void handle_c_button_movement(struct Camera *c);
is_range_behind_surface
Description
Determines if a range is obstructed by a surface relative to the camera. Returns true if the range is behind the specified surface
Lua Example
local integerValue = is_range_behind_surface(from, to, surf, range, surfType)
Parameters
| Field | Type |
|---|---|
| from | Vec3f |
| to | Vec3f |
| surf | Surface |
| range | integer |
| surfType | integer |
Returns
integer
C Prototype
s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface *surf, s16 range, s16 surfType);
is_within_100_units_of_mario
Description
Checks if a position is within 100 units of Mario's current position. Returns true if the position is within the specified radius and false otherwise
Lua Example
local integerValue = is_within_100_units_of_mario(posX, posY, posZ)
Parameters
| Field | Type |
|---|---|
| posX | number |
| posY | number |
| posZ | number |
Returns
integer
C Prototype
s32 is_within_100_units_of_mario(f32 posX, f32 posY, f32 posZ);
move_mario_head_c_up
Description
Moves Mario's head slightly upward when the C-Up button is pressed. This function aligns the camera to match the head movement for consistency
Lua Example
move_mario_head_c_up(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
- None
C Prototype
void move_mario_head_c_up(UNUSED struct Camera *c);
next_lakitu_state
Description
Transitions the camera to the next Lakitu state, updating position and focus. This function handles smooth transitions between different gameplay scenarios
Lua Example
local integerValue = next_lakitu_state(newPos, newFoc, curPos, curFoc, oldPos, oldFoc, yaw)
Parameters
| Field | Type |
|---|---|
| newPos | Vec3f |
| newFoc | Vec3f |
| curPos | Vec3f |
| curFoc | Vec3f |
| oldPos | Vec3f |
| oldFoc | Vec3f |
| yaw | integer |
Returns
integer
C Prototype
s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, Vec3f oldPos, Vec3f oldFoc, s16 yaw);
obj_rotate_towards_point
Description
Rotates an object toward a specific point in 3D space. Gradually updates the object's pitch and yaw angles to face the target
Lua Example
obj_rotate_towards_point(o, point, pitchOff, yawOff, pitchDiv, yawDiv)
Parameters
| Field | Type |
|---|---|
| o | Object |
| point | Vec3f |
| pitchOff | integer |
| yawOff | integer |
| pitchDiv | integer |
| yawDiv | integer |
Returns
- None
C Prototype
void obj_rotate_towards_point(struct Object *o, Vec3f point, s16 pitchOff, s16 yawOff, s16 pitchDiv, s16 yawDiv);
object_pos_to_vec3f
Description
Converts an object's position to a Vec3f format. Useful for aligning object behaviors or interactions with the camera system
Lua Example
object_pos_to_vec3f(dst, o)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| o | Object |
Returns
- None
C Prototype
void object_pos_to_vec3f(Vec3f dst, struct Object *o);
offset_rotated
Description
Offsets a vector by rotating it in 3D space relative to a reference position. This is useful for creating radial effects or dynamic transformations
Lua Example
offset_rotated(dst, from, to, rotation)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| from | Vec3f |
| to | Vec3f |
| rotation | Vec3s |
Returns
- None
C Prototype
void offset_rotated(Vec3f dst, Vec3f from, Vec3f to, Vec3s rotation);
offset_yaw_outward_radial
Description
Calculates an outward radial offset based on the camera's yaw angle. Returns the offset yaw, used for positioning or alignment
Lua Example
local integerValue = offset_yaw_outward_radial(c, areaYaw)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| areaYaw | integer |
Returns
integer
C Prototype
s32 offset_yaw_outward_radial(struct Camera *c, s16 areaYaw);
play_camera_buzz_if_c_sideways
Description
Plays a buzzing sound effect when the camera's position is misaligned with the player's perspective. Used as audio feedback for incorrect camera behavior
Lua Example
play_camera_buzz_if_c_sideways()
Parameters
- None
Returns
- None
C Prototype
void play_camera_buzz_if_c_sideways(void);
play_camera_buzz_if_cbutton
Description
Plays a buzzing sound effect when a blocked C-button action is attempted. Used to signal invalid input or restricted camera movement
Lua Example
play_camera_buzz_if_cbutton()
Parameters
- None
Returns
- None
C Prototype
void play_camera_buzz_if_cbutton(void);
play_camera_buzz_if_cdown
Description
Plays a buzzing sound effect when the camera attempts to move downward but is restricted. Provides feedback for invalid C-Down input actions
Lua Example
play_camera_buzz_if_cdown()
Parameters
- None
Returns
- None
C Prototype
void play_camera_buzz_if_cdown(void);
play_cutscene
Description
Starts the execution of a predefined cutscene. The camera transitions dynamically to follow the scripted sequence
Lua Example
play_cutscene(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
- None
C Prototype
void play_cutscene(struct Camera *c);
play_sound_button_change_blocked
Description
Plays a sound effect when a blocked action changes the camera mode. This provides feedback for invalid attempts to switch the camera state
Lua Example
play_sound_button_change_blocked()
Parameters
- None
Returns
- None
C Prototype
void play_sound_button_change_blocked(void);
play_sound_cbutton_down
Description
Plays a sound effect when the C-Down button is pressed for camera movement. Provides auditory feedback for valid camera input
Lua Example
play_sound_cbutton_down()
Parameters
- None
Returns
- None
C Prototype
void play_sound_cbutton_down(void);
play_sound_cbutton_side
Description
Plays a sound effect when the C-Side button (left or right) is pressed for camera movement. Used as audio feedback for horizontal adjustments to the camera
Lua Example
play_sound_cbutton_side()
Parameters
- None
Returns
- None
C Prototype
void play_sound_cbutton_side(void);
play_sound_cbutton_up
Description
Plays a sound effect when the C-Up button is pressed for camera movement. Provides feedback for vertical camera adjustments
Lua Example
play_sound_cbutton_up()
Parameters
- None
Returns
- None
C Prototype
void play_sound_cbutton_up(void);
play_sound_if_cam_switched_to_lakitu_or_mario
Description
Plays a sound effect when the camera switches between Lakitu and Mario perspectives. Signals a successful change in camera mode
Lua Example
play_sound_if_cam_switched_to_lakitu_or_mario()
Parameters
- None
Returns
- None
C Prototype
void play_sound_if_cam_switched_to_lakitu_or_mario(void);
play_sound_rbutton_changed
Description
Plays a sound effect when the R-Button camera mode is changed. Provides feedback for toggling camera behaviors
Lua Example
play_sound_rbutton_changed()
Parameters
- None
Returns
- None
C Prototype
void play_sound_rbutton_changed(void);
radial_camera_input
Description
Handles radial camera movement based on player input. Updates the camera's position or orientation accordingly
Lua Example
local integerValue = radial_camera_input(c, unused)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| unused | number |
Returns
integer
C Prototype
s32 radial_camera_input(struct Camera *c, UNUSED f32 unused);
random_vec3s
Description
Generates a random 3D vector with short integer components. Useful for randomized offsets or environmental effects
Lua Example
random_vec3s(dst, xRange, yRange, zRange)
Parameters
| Field | Type |
|---|---|
| dst | Vec3s |
| xRange | integer |
| yRange | integer |
| zRange | integer |
Returns
- None
C Prototype
void random_vec3s(Vec3s dst, s16 xRange, s16 yRange, s16 zRange);
reset_camera
Description
Fully resets the camera to its default state and reinitializes all settings. This is typically used when restarting gameplay or loading a new area
Lua Example
reset_camera(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
- None
C Prototype
void reset_camera(struct Camera *c);
resolve_geometry_collisions
Description
Resolves collisions between the camera and level geometry. Adjusts the camera's position to prevent clipping or intersecting with objects
Lua Example
resolve_geometry_collisions(pos, lastGood)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| lastGood | Vec3f |
Returns
- None
C Prototype
void resolve_geometry_collisions(Vec3f pos, UNUSED Vec3f lastGood);
rom_hack_cam_set_collisions
Description
Toggles collision settings for the ROM hack camera. This enables or disables specific collision behaviors in modded levels
Lua Example
rom_hack_cam_set_collisions(enable)
Parameters
| Field | Type |
|---|---|
| enable | integer |
Returns
- None
C Prototype
void rom_hack_cam_set_collisions(u8 enable);
rotate_camera_around_walls
Description
Rotates the camera to avoid walls or other obstructions. Ensures clear visibility of the player or target objects
Lua Example
local integerValue = rotate_camera_around_walls(c, cPos, avoidYaw, yawRange)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| cPos | Vec3f |
| avoidYaw | Pointer <integer> |
| yawRange | integer |
Returns
integer
C Prototype
s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 yawRange);
rotate_in_xz
Description
Rotates a vector around the XZ-plane by a specified yaw angle. The result is stored in the destination vector (dst). Useful for rotating camera positions or object coordinates horizontally
Lua Example
rotate_in_xz(dst, src, yaw)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| src | Vec3f |
| yaw | integer |
Returns
- None
C Prototype
void rotate_in_xz(Vec3f dst, Vec3f src, s16 yaw);
rotate_in_yz
Description
Rotates a vector around the YZ-plane by a specified pitch angle. The result is stored in the destination vector (dst). Useful for vertical camera rotations or object transformations
Lua Example
rotate_in_yz(dst, src, pitch)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| src | Vec3f |
| pitch | integer |
Returns
- None
C Prototype
void rotate_in_yz(Vec3f dst, Vec3f src, s16 pitch);
scale_along_line
Description
Scales a point along a line between two 3D points (from and to). The scaling factor determines how far along the line the resulting point will be. The result is stored in the destination vector (dest)
Lua Example
scale_along_line(dest, from, to, scale)
Parameters
| Field | Type |
|---|---|
| dest | Vec3f |
| from | Vec3f |
| to | Vec3f |
| scale | number |
Returns
- None
C Prototype
void scale_along_line(Vec3f dest, Vec3f from, Vec3f to, f32 scale);
select_mario_cam_mode
Description
Selects the appropriate camera mode for Mario based on the current gameplay context. Adapts camera behavior dynamically to match Mario's environment or state
Lua Example
select_mario_cam_mode()
Parameters
- None
Returns
- None
C Prototype
void select_mario_cam_mode(void);
set_cam_angle
Description
Sets the camera's angle based on the specified mode. Handles rotation and focus adjustments for predefined camera behaviors
Lua Example
local integerValue = set_cam_angle(mode)
Parameters
| Field | Type |
|---|---|
| mode | integer |
Returns
integer
C Prototype
s32 set_cam_angle(s32 mode);
set_camera_mode
Description
Changes the camera to a new mode, optionally interpolating over a specified number of frames. Useful for transitioning between different camera behaviors dynamically
Lua Example
set_camera_mode(c, mode, frames)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| mode | integer |
| frames | integer |
Returns
- None
C Prototype
void set_camera_mode(struct Camera *c, s16 mode, s16 frames);
set_camera_mode_fixed
Description
Activates a fixed camera mode and aligns the camera to specific X, Y, Z coordinates. This is useful for predefined static views in specific areas
Lua Example
local integerValue = set_camera_mode_fixed(c, x, y, z)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| x | integer |
| y | integer |
| z | integer |
Returns
integer
C Prototype
s32 set_camera_mode_fixed(struct Camera* c, s16 x, s16 y, s16 z);
set_camera_pitch_shake
Description
Applies a pitch-based shake effect to the camera. The shake's magnitude, decay, and increment are configurable. Simulates vertical disturbances like impacts or explosions
Lua Example
set_camera_pitch_shake(mag, decay, inc)
Parameters
| Field | Type |
|---|---|
| mag | integer |
| decay | integer |
| inc | integer |
Returns
- None
C Prototype
void set_camera_pitch_shake(s16 mag, s16 decay, s16 inc);
set_camera_roll_shake
Description
Applies a roll-based shake effect to the camera. Simulates rotational disturbances for dynamic camera effects
Lua Example
set_camera_roll_shake(mag, decay, inc)
Parameters
| Field | Type |
|---|---|
| mag | integer |
| decay | integer |
| inc | integer |
Returns
- None
C Prototype
void set_camera_roll_shake(s16 mag, s16 decay, s16 inc);
set_camera_shake_from_hit
Description
Applies a shake effect to the camera based on a hit type. Different shake types simulate various impacts, such as attacks, falls, or shocks
Lua Example
set_camera_shake_from_hit(shake)
Parameters
| Field | Type |
|---|---|
| shake | integer |
Returns
- None
C Prototype
void set_camera_shake_from_hit(s16 shake);
set_camera_shake_from_point
Description
Applies a shake effect to the camera, scaled by its proximity to a specified point. The intensity decreases with distance from the point
Lua Example
set_camera_shake_from_point(shake, posX, posY, posZ)
Parameters
| Field | Type |
|---|---|
| shake | integer |
| posX | number |
| posY | number |
| posZ | number |
Returns
- None
C Prototype
void set_camera_shake_from_point(s16 shake, f32 posX, f32 posY, f32 posZ);
set_camera_yaw_shake
Description
Applies a yaw-based shake effect to the camera. Simulates horizontal vibrations or rotational impacts
Lua Example
set_camera_yaw_shake(mag, decay, inc)
Parameters
| Field | Type |
|---|---|
| mag | integer |
| decay | integer |
| inc | integer |
Returns
- None
C Prototype
void set_camera_yaw_shake(s16 mag, s16 decay, s16 inc);
set_environmental_camera_shake
Description
Applies an environmental shake effect to the camera. Handles predefined shake types triggered by environmental events like explosions or platform movements
Lua Example
set_environmental_camera_shake(shake)
Parameters
| Field | Type |
|---|---|
| shake | integer |
Returns
- None
C Prototype
void set_environmental_camera_shake(s16 shake);
set_fixed_cam_axis_sa_lobby
Description
Transitions the camera to the next Lakitu state, updating position and focus. This function handles smooth transitions between different gameplay scenarios
Lua Example
set_fixed_cam_axis_sa_lobby(preset)
Parameters
| Field | Type |
|---|---|
| preset | integer |
Returns
- None
C Prototype
void set_fixed_cam_axis_sa_lobby(UNUSED s16 preset);
set_fov_function
Description
Assigns a custom function for dynamic field-of-view adjustments. This allows precise control over the camera's zoom behavior during gameplay
Lua Example
set_fov_function(func)
Parameters
| Field | Type |
|---|---|
| func | integer |
Returns
- None
C Prototype
void set_fov_function(u8 func);
set_fov_shake
Description
Applies a field-of-view shake effect to simulate zoom or focus disruptions. Shake parameters, such as amplitude and decay, control the intensity
Lua Example
set_fov_shake(amplitude, decay, shakeSpeed)
Parameters
| Field | Type |
|---|---|
| amplitude | integer |
| decay | integer |
| shakeSpeed | integer |
Returns
- None
C Prototype
void set_fov_shake(s16 amplitude, s16 decay, s16 shakeSpeed);
set_fov_shake_from_point_preset
Description
Applies a preset field-of-view shake effect relative to a specific point. The intensity diminishes as the distance from the point increases
Lua Example
set_fov_shake_from_point_preset(preset, posX, posY, posZ)
Parameters
| Field | Type |
|---|---|
| preset | integer |
| posX | number |
| posY | number |
| posZ | number |
Returns
- None
C Prototype
void set_fov_shake_from_point_preset(u8 preset, f32 posX, f32 posY, f32 posZ);
set_handheld_shake
Description
Applies a handheld camera shake effect with configurable parameters. Can be used to simulate dynamic, realistic camera movement
Lua Example
set_handheld_shake(mode)
Parameters
| Field | Type |
|---|---|
| mode | integer |
Returns
- None
C Prototype
void set_handheld_shake(u8 mode);
set_or_approach_f32_asymptotic
Description
Smoothly transitions or directly sets a floating-point value (dst) to approach a target (goal). Uses asymptotic scaling for gradual adjustments or direct assignment
Lua Example
local integerValue = set_or_approach_f32_asymptotic(dst, goal, scale)
Parameters
| Field | Type |
|---|---|
| dst | Pointer <number> |
| goal | number |
| scale | number |
Returns
integer
C Prototype
s32 set_or_approach_f32_asymptotic(f32 *dst, f32 goal, f32 scale);
set_or_approach_s16_symmetric
Description
Smoothly transitions or directly sets a signed 16-bit value (current) to approach a target (target). Uses symmetric scaling for gradual or immediate adjustments
Lua Example
local integerValue = set_or_approach_s16_symmetric(current, target, increment)
Parameters
| Field | Type |
|---|---|
| current | Pointer <integer> |
| target | integer |
| increment | integer |
Returns
integer
C Prototype
s32 set_or_approach_s16_symmetric(s16 *current, s16 target, s16 increment);
set_or_approach_vec3f_asymptotic
Description
Smoothly transitions a 3D vector (current) toward a target vector (goal) using asymptotic scaling. Allows gradual or instantaneous alignment of 3D positions. Scaling values (the Mul variables) for x, y, and z axes determine the speed of adjustment for each component
Lua Example
set_or_approach_vec3f_asymptotic(dst, goal, xMul, yMul, zMul)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| goal | Vec3f |
| xMul | number |
| yMul | number |
| zMul | number |
Returns
- None
C Prototype
void set_or_approach_vec3f_asymptotic(Vec3f dst, Vec3f goal, f32 xMul, f32 yMul, f32 zMul);
set_pitch_shake_from_point
Description
Applies a pitch shake effect to the camera, scaled by proximity to a specified point. Simulates vibrations with intensity decreasing further from the point
Lua Example
set_pitch_shake_from_point(mag, decay, inc, maxDist, posX, posY, posZ)
Parameters
| Field | Type |
|---|---|
| mag | integer |
| decay | integer |
| inc | integer |
| maxDist | number |
| posX | number |
| posY | number |
| posZ | number |
Returns
- None
C Prototype
void set_pitch_shake_from_point(s16 mag, s16 decay, s16 inc, f32 maxDist, f32 posX, f32 posY, f32 posZ);
shake_camera_handheld
Description
Activates a handheld camera shake effect. Calculates positional and focus adjustments to simulate manual movement
Lua Example
shake_camera_handheld(pos, focus)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| focus | Vec3f |
Returns
- None
C Prototype
void shake_camera_handheld(Vec3f pos, Vec3f focus);
shake_camera_pitch
Description
Activates a pitch-based shake effect. Adds vertical vibrational movement to the camera's behavior
Lua Example
shake_camera_pitch(pos, focus)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| focus | Vec3f |
Returns
- None
C Prototype
void shake_camera_pitch(Vec3f pos, Vec3f focus);
shake_camera_roll
Description
Applies a roll-based shake effect to the camera. Simulates rotational disturbances caused by impacts or other events
Lua Example
shake_camera_roll(roll)
Parameters
| Field | Type |
|---|---|
| roll | Pointer <integer> |
Returns
- None
C Prototype
void shake_camera_roll(s16 *roll);
shake_camera_yaw
Description
Activates a yaw-based shake effect. Adds horizontal vibrational movement to the camera's behavior
Lua Example
shake_camera_yaw(pos, focus)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| focus | Vec3f |
Returns
- None
C Prototype
void shake_camera_yaw(Vec3f pos, Vec3f focus);
skip_camera_interpolation
Description
Skips camera interpolation for a frame, locking the camera instantly to the target position. Useful for immediate changes in camera state or position without smooth transitions
Lua Example
skip_camera_interpolation()
Parameters
- None
Returns
- None
C Prototype
void skip_camera_interpolation(void);
soft_reset_camera
Description
Resets the camera's state while retaining some settings, such as position or mode. This is often used when soft-resetting gameplay without reinitialization
Lua Example
soft_reset_camera(c)
Parameters
| Field | Type |
|---|---|
| c | Camera |
Returns
- None
C Prototype
void soft_reset_camera(struct Camera* c);
start_cutscene
Description
Starts a cutscene based on the provided ID. The camera transitions to predefined behaviors for the duration of the cutscene
Lua Example
start_cutscene(c, cutscene)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| cutscene | integer |
Returns
- None
C Prototype
void start_cutscene(struct Camera *c, u8 cutscene);
start_object_cutscene_without_focus
Description
Starts a cutscene focused on an object without requiring focus to remain locked. This is useful for dynamic events where the camera adjusts freely
Lua Example
local integerValue = start_object_cutscene_without_focus(cutscene)
Parameters
| Field | Type |
|---|---|
| cutscene | integer |
Returns
integer
C Prototype
u8 start_object_cutscene_without_focus(u8 cutscene);
transition_next_state
Description
Transitions the camera to the next state over a specified number of frames. This is typically used for cutscenes or scripted sequences
Lua Example
transition_next_state(c, frames)
Parameters
| Field | Type |
|---|---|
| c | Camera |
| frames | integer |
Returns
- None
C Prototype
void transition_next_state(UNUSED struct Camera *c, s16 frames);
trigger_cutscene_dialog
Description
Triggers a dialog sequence during a cutscene. The dialog is synchronized with the camera's position and movement
Lua Example
local integerValue = trigger_cutscene_dialog(trigger)
Parameters
| Field | Type |
|---|---|
| trigger | integer |
Returns
integer
C Prototype
s32 trigger_cutscene_dialog(s32 trigger);
vec3f_sub
Description
Subtracts one 3D vector (src) from another (dst). Stores the result in the destination vector
Lua Example
vec3f_sub(dst, src)
Parameters
| Field | Type |
|---|---|
| dst | Vec3f |
| src | Vec3f |
Returns
- None
C Prototype
void vec3f_sub(Vec3f dst, Vec3f src);
vec3f_to_object_pos
Description
Converts a Vec3f position to an object's internal format. Useful for syncing 3D positions between objects and the game world
Lua Example
vec3f_to_object_pos(o, src)
Parameters
| Field | Type |
|---|---|
| o | Object |
| src | Vec3f |
Returns
- None
C Prototype
void vec3f_to_object_pos(struct Object *o, Vec3f src);
warp_camera
Description
Moves the camera to a specified warp destination. This function handles transitions between levels or areas seamlessly
Lua Example
warp_camera(displacementX, displacementY, displacementZ)
Parameters
| Field | Type |
|---|---|
| displacementX | number |
| displacementY | number |
| displacementZ | number |
Returns
- None
C Prototype
void warp_camera(f32 displacementX, f32 displacementY, f32 displacementZ);
functions from characters.h
get_character
Lua Example
local CharacterValue = get_character(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
C Prototype
struct Character* get_character(struct MarioState* m);
get_character_anim
Description
Gets the animation ID to use for a specific character and animation combination. The ID is based on characterAnim and the character currently controlled by Mario (m). Useful for determining which animation to play for actions like walking, jumping, or idle states
Lua Example
local integerValue = get_character_anim(m, characterAnim)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| characterAnim | enum CharacterAnimID |
Returns
integer
C Prototype
s32 get_character_anim(struct MarioState* m, enum CharacterAnimID characterAnim);
get_character_anim_offset
Description
Calculates the animation offset for Mario's current animation. The offset is determined by the type of animation being played (e.g., hand, feet, or torso movement). Useful for smoothly syncing Mario's model height or positional adjustments during animations
Lua Example
local numberValue = get_character_anim_offset(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
number
C Prototype
f32 get_character_anim_offset(struct MarioState* m);
play_character_sound
Description
Plays a character-specific sound based on the given characterSound value. The sound is tied to Mario's current state (m). Useful for triggering sound effects for actions like jumping or interacting with the environment
Lua Example
play_character_sound(m, characterSound)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| characterSound | enum CharacterSound |
Returns
- None
C Prototype
void play_character_sound(struct MarioState* m, enum CharacterSound characterSound);
play_character_sound_if_no_flag
Description
Plays a character-specific sound only if certain flags are not set. This ensures that sounds are not repeated unnecessarily. The sound is based on characterSound, and the flags are checked using flags. Useful for avoiding duplicate sound effects in rapid succession or conditional actions
Lua Example
play_character_sound_if_no_flag(m, characterSound, flags)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| characterSound | enum CharacterSound |
| flags | integer |
Returns
- None
C Prototype
void play_character_sound_if_no_flag(struct MarioState* m, enum CharacterSound characterSound, u32 flags);
play_character_sound_offset
Description
Plays a character-specific sound with an additional offset, allowing variations or delays in the sound effect. Uses Mario's current state (m). Useful for adding dynamic sound effects or syncing sounds to specific animations or events
Lua Example
play_character_sound_offset(m, characterSound, offset)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| characterSound | enum CharacterSound |
| offset | integer |
Returns
- None
C Prototype
void play_character_sound_offset(struct MarioState* m, enum CharacterSound characterSound, u32 offset);
update_character_anim_offset
Description
Updates Mario's current animation offset. This adjusts Mario's position based on the calculated offset to ensure animations appear smooth and natural. Useful for keeping Mario's animations visually aligned, particularly when transitioning between animations
Lua Example
update_character_anim_offset(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_character_anim_offset(struct MarioState* m);
functions from djui_chat_message.h
djui_chat_message_create
Description
Creates a message in the game's chat box
Lua Example
djui_chat_message_create(message)
Parameters
| Field | Type |
|---|---|
| message | string |
Returns
- None
C Prototype
void djui_chat_message_create(const char* message);
functions from djui_console.h
djui_console_toggle
Description
Toggles the visibility of the DJUI console
Lua Example
djui_console_toggle()
Parameters
- None
Returns
- None
C Prototype
void djui_console_toggle(void);
functions from djui_hud_utils.h
djui_hud_get_color
Description
Gets the current DJUI HUD color
Lua Example
local DjuiColorValue = djui_hud_get_color()
Parameters
- None
Returns
C Prototype
struct DjuiColor* djui_hud_get_color(void);
djui_hud_get_filter
Description
Gets the current DJUI HUD texture filter
Lua Example
local integerValue = djui_hud_get_filter()
Parameters
- None
Returns
integer
C Prototype
u8 djui_hud_get_filter(void);
djui_hud_get_font
Description
Gets the current DJUI HUD font
Lua Example
local integerValue = djui_hud_get_font()
Parameters
- None
Returns
integer
C Prototype
u8 djui_hud_get_font(void);
djui_hud_get_fov_coeff
Description
Gets the camera FOV coefficient
Lua Example
local numberValue = djui_hud_get_fov_coeff()
Parameters
- None
Returns
number
C Prototype
f32 djui_hud_get_fov_coeff();
djui_hud_get_mouse_x
Description
Returns the x coordinate of the mouse relative to the window
Lua Example
local numberValue = djui_hud_get_mouse_x()
Parameters
- None
Returns
number
C Prototype
f32 djui_hud_get_mouse_x(void);
djui_hud_get_mouse_y
Description
Returns the y coordinate of the mouse relative to the window
Lua Example
local numberValue = djui_hud_get_mouse_y()
Parameters
- None
Returns
number
C Prototype
f32 djui_hud_get_mouse_y(void);
djui_hud_get_raw_mouse_x
Description
Returns the x coordinate of the mouse relative to the screen
Lua Example
local numberValue = djui_hud_get_raw_mouse_x()
Parameters
- None
Returns
number
C Prototype
f32 djui_hud_get_raw_mouse_x(void);
djui_hud_get_raw_mouse_y
Description
Returns the y coordinate of the mouse relative to the screen
Lua Example
local numberValue = djui_hud_get_raw_mouse_y()
Parameters
- None
Returns
number
C Prototype
f32 djui_hud_get_raw_mouse_y(void);
djui_hud_get_resolution
Description
Gets the current DJUI HUD resolution
Lua Example
local integerValue = djui_hud_get_resolution()
Parameters
- None
Returns
integer
C Prototype
u8 djui_hud_get_resolution(void);
djui_hud_get_rotation
Description
Gets the current DJUI HUD rotation
Lua Example
local HudUtilsRotationValue = djui_hud_get_rotation()
Parameters
- None
Returns
C Prototype
struct HudUtilsRotation* djui_hud_get_rotation(void);
djui_hud_get_screen_height
Description
Gets the screen height in the current DJUI HUD resolution
Lua Example
local integerValue = djui_hud_get_screen_height()
Parameters
- None
Returns
integer
C Prototype
u32 djui_hud_get_screen_height(void);
djui_hud_get_screen_width
Description
Gets the screen width in the current DJUI HUD resolution
Lua Example
local integerValue = djui_hud_get_screen_width()
Parameters
- None
Returns
integer
C Prototype
u32 djui_hud_get_screen_width(void);
djui_hud_is_pause_menu_created
Description
Checks if the DJUI pause menu is created
Lua Example
local booleanValue = djui_hud_is_pause_menu_created()
Parameters
- None
Returns
boolean
C Prototype
bool djui_hud_is_pause_menu_created(void);
djui_hud_measure_text
Description
Measures the length of message in the current font
Lua Example
local numberValue = djui_hud_measure_text(message)
Parameters
| Field | Type |
|---|---|
| message | string |
Returns
number
C Prototype
f32 djui_hud_measure_text(const char* message);
djui_hud_print_text
Description
Prints DJUI HUD text onto the screen
Lua Example
djui_hud_print_text(message, x, y, scale)
Parameters
| Field | Type |
|---|---|
| message | string |
| x | number |
| y | number |
| scale | number |
Returns
- None
C Prototype
void djui_hud_print_text(const char* message, f32 x, f32 y, f32 scale);
djui_hud_print_text_interpolated
Description
Prints interpolated DJUI HUD text onto the screen
Lua Example
djui_hud_print_text_interpolated(message, prevX, prevY, prevScale, x, y, scale)
Parameters
| Field | Type |
|---|---|
| message | string |
| prevX | number |
| prevY | number |
| prevScale | number |
| x | number |
| y | number |
| scale | number |
Returns
- None
C Prototype
void djui_hud_print_text_interpolated(const char* message, f32 prevX, f32 prevY, f32 prevScale, f32 x, f32 y, f32 scale);
djui_hud_render_rect
Description
Renders a DJUI HUD rect onto the screen
Lua Example
djui_hud_render_rect(x, y, width, height)
Parameters
| Field | Type |
|---|---|
| x | number |
| y | number |
| width | number |
| height | number |
Returns
- None
C Prototype
void djui_hud_render_rect(f32 x, f32 y, f32 width, f32 height);
djui_hud_render_rect_interpolated
Description
Renders an interpolated DJUI HUD rect onto the screen
Lua Example
djui_hud_render_rect_interpolated(prevX, prevY, prevWidth, prevHeight, x, y, width, height)
Parameters
| Field | Type |
|---|---|
| prevX | number |
| prevY | number |
| prevWidth | number |
| prevHeight | number |
| x | number |
| y | number |
| width | number |
| height | number |
Returns
- None
C Prototype
void djui_hud_render_rect_interpolated(f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height);
djui_hud_reset_color
Description
Resets the current DJUI HUD color
Lua Example
djui_hud_reset_color()
Parameters
- None
Returns
- None
C Prototype
void djui_hud_reset_color(void);
djui_hud_set_color
Description
Sets the current DJUI HUD color
Lua Example
djui_hud_set_color(r, g, b, a)
Parameters
| Field | Type |
|---|---|
| r | integer |
| g | integer |
| b | integer |
| a | integer |
Returns
- None
C Prototype
void djui_hud_set_color(u8 r, u8 g, u8 b, u8 a);
djui_hud_set_filter
Description
Sets the current DJUI HUD texture filter
Lua Example
djui_hud_set_filter(filterType)
Parameters
| Field | Type |
|---|---|
| filterType | enum HudUtilsFilter |
Returns
- None
C Prototype
void djui_hud_set_filter(enum HudUtilsFilter filterType);
djui_hud_set_font
Description
Sets the current DJUI HUD font
Lua Example
djui_hud_set_font(fontType)
Parameters
| Field | Type |
|---|---|
| fontType | integer |
Returns
- None
C Prototype
void djui_hud_set_font(s8 fontType);
djui_hud_set_mouse_locked
Description
Sets if the cursor is hidden and constrainted to the window
Lua Example
djui_hud_set_mouse_locked(locked)
Parameters
| Field | Type |
|---|---|
| locked | boolean |
Returns
- None
C Prototype
void djui_hud_set_mouse_locked(bool locked);
djui_hud_set_resolution
Description
Sets the current DJUI HUD resolution
Lua Example
djui_hud_set_resolution(resolutionType)
Parameters
| Field | Type |
|---|---|
| resolutionType | enum HudUtilsResolution |
Returns
- None
C Prototype
void djui_hud_set_resolution(enum HudUtilsResolution resolutionType);
djui_hud_set_rotation
Description
Sets the current DJUI HUD rotation
Lua Example
djui_hud_set_rotation(rotation, pivotX, pivotY)
Parameters
| Field | Type |
|---|---|
| rotation | integer |
| pivotX | number |
| pivotY | number |
Returns
- None
C Prototype
void djui_hud_set_rotation(s16 rotation, f32 pivotX, f32 pivotY);
djui_hud_set_rotation_interpolated
Description
Sets the current DJUI HUD rotation interpolated
Lua Example
djui_hud_set_rotation_interpolated(prevRotation, prevPivotX, prevPivotY, rotation, pivotX, pivotY)
Parameters
| Field | Type |
|---|---|
| prevRotation | integer |
| prevPivotX | number |
| prevPivotY | number |
| rotation | integer |
| pivotX | number |
| pivotY | number |
Returns
- None
C Prototype
void djui_hud_set_rotation_interpolated(s32 prevRotation, f32 prevPivotX, f32 prevPivotY, s32 rotation, f32 pivotX, f32 pivotY);
djui_hud_world_pos_to_screen_pos
Description
Converts a world position to screen position
Lua Example
local booleanValue = djui_hud_world_pos_to_screen_pos(pos, out)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| out | Vec3f |
Returns
boolean
C Prototype
bool djui_hud_world_pos_to_screen_pos(Vec3f pos, Vec3f out);
djui_open_pause_menu
Description
Opens the DJUI pause menu
Lua Example
djui_open_pause_menu()
Parameters
- None
Returns
- None
C Prototype
void djui_open_pause_menu(void);
get_current_fov
Description
Gets the current camera FOV
Lua Example
local numberValue = get_current_fov()
Parameters
- None
Returns
number
C Prototype
f32 get_current_fov();
functions from djui_language.h
djui_language_get
Description
Gets a language key from a section
Lua Example
local stringValue = djui_language_get(section, key)
Parameters
| Field | Type |
|---|---|
| section | string |
| key | string |
Returns
string
C Prototype
char* djui_language_get(const char *section, const char *key);
functions from djui_popup.h
djui_popup_create
Description
Creates a popup that says message and has lines
Lua Example
djui_popup_create(message, lines)
Parameters
| Field | Type |
|---|---|
| message | string |
| lines | integer |
Returns
- None
C Prototype
void djui_popup_create(const char* message, int lines);
functions from external.h
drop_queued_background_music
Lua Example
drop_queued_background_music()
Parameters
- None
Returns
- None
C Prototype
void drop_queued_background_music(void);
fade_volume_scale
Lua Example
fade_volume_scale(player, targetScale, fadeDuration)
Parameters
| Field | Type |
|---|---|
| player | integer |
| targetScale | integer |
| fadeDuration | integer |
Returns
- None
C Prototype
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeDuration);
fadeout_background_music
Lua Example
fadeout_background_music(arg0, fadeOut)
Parameters
| Field | Type |
|---|---|
| arg0 | integer |
| fadeOut | integer |
Returns
- None
C Prototype
void fadeout_background_music(u16 arg0, u16 fadeOut);
get_current_background_music
Lua Example
local integerValue = get_current_background_music()
Parameters
- None
Returns
integer
C Prototype
u16 get_current_background_music(void);
get_current_background_music_default_volume
Lua Example
local integerValue = get_current_background_music_default_volume()
Parameters
- None
Returns
integer
C Prototype
u8 get_current_background_music_default_volume(void);
get_current_background_music_max_target_volume
Lua Example
local integerValue = get_current_background_music_max_target_volume()
Parameters
- None
Returns
integer
C Prototype
u8 get_current_background_music_max_target_volume(void);
get_current_background_music_target_volume
Lua Example
local integerValue = get_current_background_music_target_volume()
Parameters
- None
Returns
integer
C Prototype
u8 get_current_background_music_target_volume(void);
is_current_background_music_volume_lowered
Lua Example
local integerValue = is_current_background_music_volume_lowered()
Parameters
- None
Returns
integer
C Prototype
u8 is_current_background_music_volume_lowered(void);
play_course_clear
Lua Example
play_course_clear()
Parameters
- None
Returns
- None
C Prototype
void play_course_clear(void);
play_dialog_sound
Lua Example
play_dialog_sound(dialogID)
Parameters
| Field | Type |
|---|---|
| dialogID | integer |
Returns
- None
C Prototype
void play_dialog_sound(u8 dialogID);
play_music
Lua Example
play_music(player, seqArgs, fadeTimer)
Parameters
| Field | Type |
|---|---|
| player | integer |
| seqArgs | integer |
| fadeTimer | integer |
Returns
- None
C Prototype
void play_music(u8 player, u16 seqArgs, u16 fadeTimer);
play_peachs_jingle
Lua Example
play_peachs_jingle()
Parameters
- None
Returns
- None
C Prototype
void play_peachs_jingle(void);
play_power_star_jingle
Lua Example
play_power_star_jingle(arg0)
Parameters
| Field | Type |
|---|---|
| arg0 | integer |
Returns
- None
C Prototype
void play_power_star_jingle(u8 arg0);
play_puzzle_jingle
Lua Example
play_puzzle_jingle()
Parameters
- None
Returns
- None
C Prototype
void play_puzzle_jingle(void);
play_race_fanfare
Lua Example
play_race_fanfare()
Parameters
- None
Returns
- None
C Prototype
void play_race_fanfare(void);
play_secondary_music
Lua Example
play_secondary_music(seqId, bgMusicVolume, volume, fadeTimer)
Parameters
| Field | Type |
|---|---|
| seqId | integer |
| bgMusicVolume | integer |
| volume | integer |
| fadeTimer | integer |
Returns
- None
C Prototype
void play_secondary_music(u8 seqId, u8 bgMusicVolume, u8 volume, u16 fadeTimer);
play_sound
Lua Example
play_sound(soundBits, pos)
Parameters
| Field | Type |
|---|---|
| soundBits | integer |
| pos | Vec3f |
Returns
- None
C Prototype
void play_sound(s32 soundBits, f32 *pos);
play_sound_with_freq_scale
Lua Example
play_sound_with_freq_scale(soundBits, pos, freqScale)
Parameters
| Field | Type |
|---|---|
| soundBits | integer |
| pos | Vec3f |
| freqScale | number |
Returns
- None
C Prototype
void play_sound_with_freq_scale(s32 soundBits, f32* pos, f32 freqScale);
play_star_fanfare
Lua Example
play_star_fanfare()
Parameters
- None
Returns
- None
C Prototype
void play_star_fanfare(void);
play_toads_jingle
Lua Example
play_toads_jingle()
Parameters
- None
Returns
- None
C Prototype
void play_toads_jingle(void);
seq_player_fade_out
Lua Example
seq_player_fade_out(player, fadeDuration)
Parameters
| Field | Type |
|---|---|
| player | integer |
| fadeDuration | integer |
Returns
- None
C Prototype
void seq_player_fade_out(u8 player, u16 fadeDuration);
seq_player_lower_volume
Lua Example
seq_player_lower_volume(player, fadeDuration, percentage)
Parameters
| Field | Type |
|---|---|
| player | integer |
| fadeDuration | integer |
| percentage | integer |
Returns
- None
C Prototype
void seq_player_lower_volume(u8 player, u16 fadeDuration, u8 percentage);
seq_player_unlower_volume
Lua Example
seq_player_unlower_volume(player, fadeDuration)
Parameters
| Field | Type |
|---|---|
| player | integer |
| fadeDuration | integer |
Returns
- None
C Prototype
void seq_player_unlower_volume(u8 player, u16 fadeDuration);
set_audio_fadeout
Lua Example
set_audio_fadeout(fadeOutTime)
Parameters
| Field | Type |
|---|---|
| fadeOutTime | integer |
Returns
- None
C Prototype
void set_audio_fadeout(u16 fadeOutTime);
sound_banks_disable
Lua Example
sound_banks_disable(player, bankMask)
Parameters
| Field | Type |
|---|---|
| player | integer |
| bankMask | integer |
Returns
- None
C Prototype
void sound_banks_disable(u8 player, u16 bankMask);
sound_banks_enable
Lua Example
sound_banks_enable(player, bankMask)
Parameters
| Field | Type |
|---|---|
| player | integer |
| bankMask | integer |
Returns
- None
C Prototype
void sound_banks_enable(u8 player, u16 bankMask);
sound_get_level_intensity
Lua Example
local numberValue = sound_get_level_intensity(distance)
Parameters
| Field | Type |
|---|---|
| distance | number |
Returns
number
C Prototype
f32 sound_get_level_intensity(f32 distance);
stop_background_music
Lua Example
stop_background_music(seqId)
Parameters
| Field | Type |
|---|---|
| seqId | integer |
Returns
- None
C Prototype
void stop_background_music(u16 seqId);
stop_secondary_music
Lua Example
stop_secondary_music(fadeTimer)
Parameters
| Field | Type |
|---|---|
| fadeTimer | integer |
Returns
- None
C Prototype
void stop_secondary_music(u16 fadeTimer);
stop_sound
Lua Example
stop_sound(soundBits, pos)
Parameters
| Field | Type |
|---|---|
| soundBits | integer |
| pos | Vec3f |
Returns
- None
C Prototype
void stop_sound(u32 soundBits, f32 *pos);
stop_sounds_from_source
Lua Example
stop_sounds_from_source(pos)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
Returns
- None
C Prototype
void stop_sounds_from_source(f32 *pos);
stop_sounds_in_continuous_banks
Lua Example
stop_sounds_in_continuous_banks()
Parameters
- None
Returns
- None
C Prototype
void stop_sounds_in_continuous_banks(void);
functions from first_person_cam.h
first_person_check_cancels
Description
Checks common cancels for first person
Lua Example
local booleanValue = first_person_check_cancels(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
boolean
C Prototype
bool first_person_check_cancels(struct MarioState *m);
first_person_reset
Description
Resets first person
Lua Example
first_person_reset()
Parameters
- None
Returns
- None
C Prototype
void first_person_reset(void);
get_first_person_enabled
Description
Checks if first person is enabled
Lua Example
local booleanValue = get_first_person_enabled()
Parameters
- None
Returns
boolean
C Prototype
bool get_first_person_enabled(void);
set_first_person_enabled
Description
Sets if first person is enabled
Lua Example
set_first_person_enabled(enable)
Parameters
| Field | Type |
|---|---|
| enable | boolean |
Returns
- None
C Prototype
void set_first_person_enabled(bool enable);
functions from ingame_menu.h
create_dialog_box
Lua Example
create_dialog_box(dialog)
Parameters
| Field | Type |
|---|---|
| dialog | integer |
Returns
- None
C Prototype
void create_dialog_box(s16 dialog);
create_dialog_box_with_response
Lua Example
create_dialog_box_with_response(dialog)
Parameters
| Field | Type |
|---|---|
| dialog | integer |
Returns
- None
C Prototype
void create_dialog_box_with_response(s16 dialog);
create_dialog_box_with_var
Lua Example
create_dialog_box_with_var(dialog, dialogVar)
Parameters
| Field | Type |
|---|---|
| dialog | integer |
| dialogVar | integer |
Returns
- None
C Prototype
void create_dialog_box_with_var(s16 dialog, s32 dialogVar);
create_dialog_inverted_box
Lua Example
create_dialog_inverted_box(dialog)
Parameters
| Field | Type |
|---|---|
| dialog | integer |
Returns
- None
C Prototype
void create_dialog_inverted_box(s16 dialog);
reset_dialog_override_color
Lua Example
reset_dialog_override_color()
Parameters
- None
Returns
- None
C Prototype
void reset_dialog_override_color();
reset_dialog_override_pos
Lua Example
reset_dialog_override_pos()
Parameters
- None
Returns
- None
C Prototype
void reset_dialog_override_pos();
reset_dialog_render_state
Lua Example
reset_dialog_render_state()
Parameters
- None
Returns
- None
C Prototype
void reset_dialog_render_state(void);
set_dialog_override_color
Lua Example
set_dialog_override_color(bgR, bgG, bgB, bgA, textR, textG, textB, textA)
Parameters
| Field | Type |
|---|---|
| bgR | integer |
| bgG | integer |
| bgB | integer |
| bgA | integer |
| textR | integer |
| textG | integer |
| textB | integer |
| textA | integer |
Returns
- None
C Prototype
void set_dialog_override_color(u8 bgR, u8 bgG, u8 bgB, u8 bgA, u8 textR, u8 textG, u8 textB, u8 textA);
set_dialog_override_pos
Lua Example
set_dialog_override_pos(x, y)
Parameters
| Field | Type |
|---|---|
| x | integer |
| y | integer |
Returns
- None
C Prototype
void set_dialog_override_pos(s16 x, s16 y);
set_menu_mode
Lua Example
set_menu_mode(mode)
Parameters
| Field | Type |
|---|---|
| mode | integer |
Returns
- None
C Prototype
void set_menu_mode(s16 mode);
set_min_dialog_width
Lua Example
set_min_dialog_width(width)
Parameters
| Field | Type |
|---|---|
| width | integer |
Returns
- None
C Prototype
void set_min_dialog_width(s16 width);
functions from interaction.h
determine_interaction
Lua Example
local integerValue = determine_interaction(m, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| o | Object |
Returns
integer
C Prototype
u32 determine_interaction(struct MarioState *m, struct Object *o);
does_mario_have_normal_cap_on_head
Lua Example
local integerValue = does_mario_have_normal_cap_on_head(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
u32 does_mario_have_normal_cap_on_head(struct MarioState *m);
get_door_save_file_flag
Lua Example
local integerValue = get_door_save_file_flag(door)
Parameters
| Field | Type |
|---|---|
| door | Object |
Returns
integer
C Prototype
u32 get_door_save_file_flag(struct Object *door);
get_mario_cap_flag
Lua Example
local integerValue = get_mario_cap_flag(capObject)
Parameters
| Field | Type |
|---|---|
| capObject | Object |
Returns
integer
C Prototype
u32 get_mario_cap_flag(struct Object *capObject);
interact_bbh_entrance
Lua Example
local integerValue = interact_bbh_entrance(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_bbh_entrance(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_bounce_top
Lua Example
local integerValue = interact_bounce_top(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_breakable
Lua Example
local integerValue = interact_breakable(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_breakable(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_bully
Lua Example
local integerValue = interact_bully(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_cannon_base
Lua Example
local integerValue = interact_cannon_base(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_cannon_base(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_cap
Lua Example
local integerValue = interact_cap(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_clam_or_bubba
Lua Example
local integerValue = interact_clam_or_bubba(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_clam_or_bubba(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_coin
Lua Example
local integerValue = interact_coin(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_coin(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_damage
Lua Example
local integerValue = interact_damage(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_damage(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_door
Lua Example
local integerValue = interact_door(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_flame
Lua Example
local integerValue = interact_flame(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_grabbable
Lua Example
local integerValue = interact_grabbable(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_grabbable(struct MarioState *m, u32 interactType, struct Object *o);
interact_hit_from_below
Lua Example
local integerValue = interact_hit_from_below(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_hoot
Lua Example
local integerValue = interact_hoot(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_hoot(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_igloo_barrier
Lua Example
local integerValue = interact_igloo_barrier(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_igloo_barrier(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_koopa_shell
Lua Example
local integerValue = interact_koopa_shell(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_mr_blizzard
Lua Example
local integerValue = interact_mr_blizzard(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_mr_blizzard(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_player
Lua Example
local integerValue = interact_player(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_player(struct MarioState* m, UNUSED u32 interactType, struct Object* o);
interact_pole
Lua Example
local integerValue = interact_pole(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_shock
Lua Example
local integerValue = interact_shock(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_snufit_bullet
Lua Example
local integerValue = interact_snufit_bullet(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_snufit_bullet(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_spiny_walking
Lua Example
local integerValue = interact_spiny_walking(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_spiny_walking(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_star_or_key
Lua Example
local integerValue = interact_star_or_key(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_strong_wind
Lua Example
local integerValue = interact_strong_wind(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_text
Lua Example
local integerValue = interact_text(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_text(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_tornado
Lua Example
local integerValue = interact_tornado(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_warp
Lua Example
local integerValue = interact_warp(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_warp_door
Lua Example
local integerValue = interact_warp_door(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_water_ring
Lua Example
local integerValue = interact_water_ring(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_water_ring(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
interact_whirlpool
Lua Example
local integerValue = interact_whirlpool(m, interactType, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
| o | Object |
Returns
integer
C Prototype
u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Object *o);
mario_blow_off_cap
Lua Example
mario_blow_off_cap(m, capSpeed)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| capSpeed | number |
Returns
- None
C Prototype
void mario_blow_off_cap(struct MarioState *m, f32 capSpeed);
mario_check_object_grab
Lua Example
local integerValue = mario_check_object_grab(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
u32 mario_check_object_grab(struct MarioState *m);
mario_drop_held_object
Lua Example
mario_drop_held_object(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_drop_held_object(struct MarioState *m);
mario_get_collided_object
Lua Example
local ObjectValue = mario_get_collided_object(m, interactType)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| interactType | integer |
Returns
C Prototype
struct Object *mario_get_collided_object(struct MarioState *m, u32 interactType);
mario_grab_used_object
Lua Example
mario_grab_used_object(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_grab_used_object(struct MarioState *m);
mario_lose_cap_to_enemy
Lua Example
local integerValue = mario_lose_cap_to_enemy(m, arg)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| arg | integer |
Returns
integer
C Prototype
u32 mario_lose_cap_to_enemy(struct MarioState* m, u32 arg);
mario_obj_angle_to_object
Lua Example
local integerValue = mario_obj_angle_to_object(m, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| o | Object |
Returns
integer
C Prototype
s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o);
mario_retrieve_cap
Lua Example
mario_retrieve_cap(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_retrieve_cap(struct MarioState* m);
mario_stop_riding_and_holding
Lua Example
mario_stop_riding_and_holding(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_stop_riding_and_holding(struct MarioState *m);
mario_stop_riding_object
Lua Example
mario_stop_riding_object(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_stop_riding_object(struct MarioState *m);
mario_throw_held_object
Lua Example
mario_throw_held_object(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_throw_held_object(struct MarioState *m);
passes_pvp_interaction_checks
Lua Example
local integerValue = passes_pvp_interaction_checks(attacker, victim)
Parameters
| Field | Type |
|---|---|
| attacker | MarioState |
| victim | MarioState |
Returns
integer
C Prototype
u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* victim);
should_push_or_pull_door
Lua Example
local integerValue = should_push_or_pull_door(m, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| o | Object |
Returns
integer
C Prototype
u32 should_push_or_pull_door(struct MarioState *m, struct Object *o);
take_damage_and_knock_back
Lua Example
local integerValue = take_damage_and_knock_back(m, o)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| o | Object |
Returns
integer
C Prototype
u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o);
functions from lag_compensation.h
lag_compensation_get_local_state
Description
Gets the local Mario's state stored in lag compensation history
Lua Example
local MarioStateValue = lag_compensation_get_local_state(otherNp)
Parameters
| Field | Type |
|---|---|
| otherNp | NetworkPlayer |
Returns
C Prototype
struct MarioState* lag_compensation_get_local_state(struct NetworkPlayer* otherNp);
lag_compensation_get_local_state_index
Description
Gets the local Mario's state index
Lua Example
local integerValue = lag_compensation_get_local_state_index()
Parameters
- None
Returns
integer
C Prototype
u32 lag_compensation_get_local_state_index(void);
lag_compensation_get_local_state_ready
Description
Checks if lag compensation history is ready
Lua Example
local booleanValue = lag_compensation_get_local_state_ready()
Parameters
- None
Returns
boolean
C Prototype
bool lag_compensation_get_local_state_ready(void);
lag_compensation_store
Description
Stores the local Mario's current state in lag compensation history
Lua Example
lag_compensation_store()
Parameters
- None
Returns
- None
C Prototype
void lag_compensation_store(void);
functions from level_info.h
get_level_name
Description
Returns the name of the level corresponding to courseNum, levelNum and areaIndex as a decapitalized ASCII (human readable) string
Lua Example
local stringValue = get_level_name(courseNum, levelNum, areaIndex)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| levelNum | integer |
| areaIndex | integer |
Returns
string
C Prototype
const char *get_level_name(s16 courseNum, s16 levelNum, s16 areaIndex);
get_level_name_ascii
Description
Returns the name of the level corresponding to courseNum, levelNum and areaIndex as an ASCII (human readable) string. Set charCase to 1 to capitalize or -1 to decapitalize the returned string
Lua Example
local stringValue = get_level_name_ascii(courseNum, levelNum, areaIndex, charCase)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| levelNum | integer |
| areaIndex | integer |
| charCase | integer |
Returns
string
C Prototype
const char *get_level_name_ascii(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase);
get_level_name_sm64
Lua Example
local PointerValue = get_level_name_sm64(courseNum, levelNum, areaIndex, charCase)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| levelNum | integer |
| areaIndex | integer |
| charCase | integer |
Returns
Pointer<integer>
C Prototype
const u8 *get_level_name_sm64(s16 courseNum, s16 levelNum, s16 areaIndex, s16 charCase);
get_star_name
Description
Returns the name of the star corresponding to courseNum and starNum as a decapitalized ASCII (human readable) string
Lua Example
local stringValue = get_star_name(courseNum, starNum)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| starNum | integer |
Returns
string
C Prototype
const char *get_star_name(s16 courseNum, s16 starNum);
get_star_name_ascii
Description
Returns the name of the star corresponding to courseNum and starNum as an ASCII (human readable) string. Set charCase to 1 to capitalize or -1 to decapitalize the returned string
Lua Example
local stringValue = get_star_name_ascii(courseNum, starNum, charCase)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| starNum | integer |
| charCase | integer |
Returns
string
C Prototype
const char *get_star_name_ascii(s16 courseNum, s16 starNum, s16 charCase);
get_star_name_sm64
Lua Example
local PointerValue = get_star_name_sm64(courseNum, starNum, charCase)
Parameters
| Field | Type |
|---|---|
| courseNum | integer |
| starNum | integer |
| charCase | integer |
Returns
Pointer<integer>
C Prototype
const u8 *get_star_name_sm64(s16 courseNum, s16 starNum, s16 charCase);
functions from level_script.h
area_create_warp_node
Description
Creates a warp node in the current level and area with id id that goes to the warp node destNode in level destLevel and area destArea, and attach it to the object o. To work properly, object o must be able to trigger a warp (for example, with interact type set to INTERACT_WARP.) checkpoint should be set only to WARP_NO_CHECKPOINT (0x00) or WARP_CHECKPOINT (0x80.) If checkpoint is set to 0x80, Mario will warp directly to this node if he enters the level again (after a death for example)
Lua Example
local ObjectWarpNodeValue = area_create_warp_node(id, destLevel, destArea, destNode, checkpoint, o)
Parameters
| Field | Type |
|---|---|
| id | integer |
| destLevel | integer |
| destArea | integer |
| destNode | integer |
| checkpoint | integer |
| o | Object |
Returns
C Prototype
struct ObjectWarpNode *area_create_warp_node(u8 id, u8 destLevel, u8 destArea, u8 destNode, u8 checkpoint, struct Object *o);
functions from level_update.h
fade_into_special_warp
Lua Example
fade_into_special_warp(arg, color)
Parameters
| Field | Type |
|---|---|
| arg | integer |
| color | integer |
Returns
- None
C Prototype
void fade_into_special_warp(u32 arg, u32 color);
get_painting_warp_node
Lua Example
local WarpNodeValue = get_painting_warp_node()
Parameters
- None
Returns
C Prototype
struct WarpNode *get_painting_warp_node(void);
initiate_painting_warp
Lua Example
initiate_painting_warp(paintingIndex)
Parameters
| Field | Type |
|---|---|
| paintingIndex | integer |
Returns
- None
C Prototype
void initiate_painting_warp(s16 paintingIndex);
level_control_timer_running
Lua Example
local integerValue = level_control_timer_running()
Parameters
- None
Returns
integer
C Prototype
u8 level_control_timer_running(void);
level_trigger_warp
Lua Example
local integerValue = level_trigger_warp(m, warpOp)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| warpOp | integer |
Returns
integer
C Prototype
s16 level_trigger_warp(struct MarioState *m, s32 warpOp);
lvl_set_current_level
Lua Example
local integerValue = lvl_set_current_level(arg0, levelNum)
Parameters
| Field | Type |
|---|---|
| arg0 | integer |
| levelNum | integer |
Returns
integer
C Prototype
s32 lvl_set_current_level(s16 arg0, s16 levelNum);
warp_special
Lua Example
warp_special(arg)
Parameters
| Field | Type |
|---|---|
| arg | integer |
Returns
- None
C Prototype
void warp_special(s32 arg);
functions from mario.h
adjust_sound_for_speed
Lua Example
adjust_sound_for_speed(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void adjust_sound_for_speed(struct MarioState *m);
check_common_action_exits
Lua Example
local integerValue = check_common_action_exits(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_common_action_exits(struct MarioState *m);
check_common_hold_action_exits
Lua Example
local integerValue = check_common_hold_action_exits(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_common_hold_action_exits(struct MarioState *m);
drop_and_set_mario_action
Lua Example
local integerValue = drop_and_set_mario_action(m, action, actionArg)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| action | integer |
| actionArg | integer |
Returns
integer
C Prototype
s32 drop_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg);
execute_mario_action
Lua Example
local integerValue = execute_mario_action(o)
Parameters
| Field | Type |
|---|---|
| o | Object |
Returns
integer
C Prototype
s32 execute_mario_action(UNUSED struct Object *o);
find_floor_height_relative_polar
Lua Example
local numberValue = find_floor_height_relative_polar(m, angleFromMario, distFromMario)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| angleFromMario | integer |
| distFromMario | number |
Returns
number
C Prototype
f32 find_floor_height_relative_polar(struct MarioState *m, s16 angleFromMario, f32 distFromMario);
find_floor_slope
Lua Example
local integerValue = find_floor_slope(m, yawOffset)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| yawOffset | integer |
Returns
integer
C Prototype
s16 find_floor_slope(struct MarioState *m, s16 yawOffset);
find_mario_anim_flags_and_translation
Lua Example
local integerValue = find_mario_anim_flags_and_translation(o, yaw, translation)
Parameters
| Field | Type |
|---|---|
| o | Object |
| yaw | integer |
| translation | Vec3s |
Returns
integer
C Prototype
s16 find_mario_anim_flags_and_translation(struct Object *o, s32 yaw, Vec3s translation);
force_idle_state
Lua Example
local integerValue = force_idle_state(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 force_idle_state(struct MarioState* m);
hurt_and_set_mario_action
Lua Example
local integerValue = hurt_and_set_mario_action(m, action, actionArg, hurtCounter)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| action | integer |
| actionArg | integer |
| hurtCounter | integer |
Returns
integer
C Prototype
s32 hurt_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg, s16 hurtCounter);
init_single_mario
Lua Example
init_single_mario(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void init_single_mario(struct MarioState* m);
is_anim_at_end
Lua Example
local integerValue = is_anim_at_end(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 is_anim_at_end(struct MarioState *m);
is_anim_past_end
Lua Example
local integerValue = is_anim_past_end(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 is_anim_past_end(struct MarioState *m);
is_anim_past_frame
Lua Example
local integerValue = is_anim_past_frame(m, animFrame)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| animFrame | integer |
Returns
integer
C Prototype
s32 is_anim_past_frame(struct MarioState *m, s16 animFrame);
mario_can_bubble
Lua Example
local booleanValue = mario_can_bubble(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
boolean
C Prototype
bool mario_can_bubble(struct MarioState* m);
mario_facing_downhill
Lua Example
local integerValue = mario_facing_downhill(m, turnYaw)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| turnYaw | integer |
Returns
integer
C Prototype
s32 mario_facing_downhill(struct MarioState *m, s32 turnYaw);
mario_floor_is_slippery
Lua Example
local integerValue = mario_floor_is_slippery(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
u32 mario_floor_is_slippery(struct MarioState *m);
mario_floor_is_slope
Lua Example
local integerValue = mario_floor_is_slope(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_floor_is_slope(struct MarioState *m);
mario_floor_is_steep
Lua Example
local integerValue = mario_floor_is_steep(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_floor_is_steep(struct MarioState *m);
mario_get_floor_class
Lua Example
local integerValue = mario_get_floor_class(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_get_floor_class(struct MarioState *m);
mario_get_terrain_sound_addend
Lua Example
local integerValue = mario_get_terrain_sound_addend(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
u32 mario_get_terrain_sound_addend(struct MarioState *m);
mario_is_crouching
Lua Example
local booleanValue = mario_is_crouching(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
boolean
C Prototype
bool mario_is_crouching(struct MarioState *m);
mario_set_bubbled
Lua Example
mario_set_bubbled(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void mario_set_bubbled(struct MarioState* m);
mario_set_forward_vel
Lua Example
mario_set_forward_vel(m, speed)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| speed | number |
Returns
- None
C Prototype
void mario_set_forward_vel(struct MarioState *m, f32 speed);
mario_update_wall
Lua Example
mario_update_wall(m, wcd)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| wcd | WallCollisionData |
Returns
- None
C Prototype
void mario_update_wall(struct MarioState* m, struct WallCollisionData* wcd);
play_mario_action_sound
Lua Example
play_mario_action_sound(m, soundBits, waveParticleType)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
| waveParticleType | integer |
Returns
- None
C Prototype
void play_mario_action_sound(struct MarioState *m, u32 soundBits, u32 waveParticleType);
play_mario_heavy_landing_sound
Lua Example
play_mario_heavy_landing_sound(m, soundBits)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
Returns
- None
C Prototype
void play_mario_heavy_landing_sound(struct MarioState *m, u32 soundBits);
play_mario_heavy_landing_sound_once
Lua Example
play_mario_heavy_landing_sound_once(m, soundBits)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
Returns
- None
C Prototype
void play_mario_heavy_landing_sound_once(struct MarioState *m, u32 soundBits);
play_mario_jump_sound
Lua Example
play_mario_jump_sound(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void play_mario_jump_sound(struct MarioState *m);
play_mario_landing_sound
Lua Example
play_mario_landing_sound(m, soundBits)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
Returns
- None
C Prototype
void play_mario_landing_sound(struct MarioState *m, u32 soundBits);
play_mario_landing_sound_once
Lua Example
play_mario_landing_sound_once(m, soundBits)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
Returns
- None
C Prototype
void play_mario_landing_sound_once(struct MarioState *m, u32 soundBits);
play_mario_sound
Lua Example
play_mario_sound(m, primarySoundBits, scondarySoundBits)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| primarySoundBits | integer |
| scondarySoundBits | integer |
Returns
- None
C Prototype
void play_mario_sound(struct MarioState *m, s32 primarySoundBits, s32 scondarySoundBits);
play_sound_and_spawn_particles
Lua Example
play_sound_and_spawn_particles(m, soundBits, waveParticleType)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
| waveParticleType | integer |
Returns
- None
C Prototype
void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 waveParticleType);
play_sound_if_no_flag
Lua Example
play_sound_if_no_flag(m, soundBits, flags)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| soundBits | integer |
| flags | integer |
Returns
- None
C Prototype
void play_sound_if_no_flag(struct MarioState *m, u32 soundBits, u32 flags);
resolve_and_return_wall_collisions
Lua Example
local SurfaceValue = resolve_and_return_wall_collisions(pos, offset, radius)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| offset | number |
| radius | number |
Returns
C Prototype
struct Surface *resolve_and_return_wall_collisions(Vec3f pos, f32 offset, f32 radius);
resolve_and_return_wall_collisions_data
Lua Example
resolve_and_return_wall_collisions_data(pos, offset, radius, collisionData)
Parameters
| Field | Type |
|---|---|
| pos | Vec3f |
| offset | number |
| radius | number |
| collisionData | WallCollisionData |
Returns
- None
C Prototype
void resolve_and_return_wall_collisions_data(Vec3f pos, f32 offset, f32 radius, struct WallCollisionData* collisionData);
return_mario_anim_y_translation
Lua Example
local integerValue = return_mario_anim_y_translation(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s16 return_mario_anim_y_translation(struct MarioState *m);
set_anim_to_frame
Lua Example
set_anim_to_frame(m, animFrame)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| animFrame | integer |
Returns
- None
C Prototype
void set_anim_to_frame(struct MarioState *m, s16 animFrame);
set_character_anim_with_accel
Lua Example
local integerValue = set_character_anim_with_accel(m, targetAnimID, accel)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| targetAnimID | integer |
| accel | integer |
Returns
integer
C Prototype
s16 set_character_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel);
set_character_animation
Lua Example
local integerValue = set_character_animation(m, targetAnimID)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| targetAnimID | integer |
Returns
integer
C Prototype
s16 set_character_animation(struct MarioState *m, s32 targetAnimID);
set_jump_from_landing
Lua Example
local integerValue = set_jump_from_landing(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 set_jump_from_landing(struct MarioState *m);
set_jumping_action
Lua Example
local integerValue = set_jumping_action(m, action, actionArg)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| action | integer |
| actionArg | integer |
Returns
integer
C Prototype
s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg);
set_mario_action
Lua Example
local integerValue = set_mario_action(m, action, actionArg)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| action | integer |
| actionArg | integer |
Returns
integer
C Prototype
u32 set_mario_action(struct MarioState *m, u32 action, u32 actionArg);
set_mario_anim_with_accel
Lua Example
local integerValue = set_mario_anim_with_accel(m, targetAnimID, accel)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| targetAnimID | integer |
| accel | integer |
Returns
integer
C Prototype
s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel);
set_mario_animation
Lua Example
local integerValue = set_mario_animation(m, targetAnimID)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| targetAnimID | integer |
Returns
integer
C Prototype
s16 set_mario_animation(struct MarioState *m, s32 targetAnimID);
set_mario_particle_flags
Lua Example
set_mario_particle_flags(m, flags, clear)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| flags | integer |
| clear | integer |
Returns
- None
C Prototype
void set_mario_particle_flags(struct MarioState* m, u32 flags, u8 clear);
set_mario_y_vel_based_on_fspeed
Lua Example
set_mario_y_vel_based_on_fspeed(m, initialVelY, multiplier)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| initialVelY | number |
| multiplier | number |
Returns
- None
C Prototype
void set_mario_y_vel_based_on_fspeed(struct MarioState *m, f32 initialVelY, f32 multiplier);
set_steep_jump_action
Lua Example
set_steep_jump_action(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void set_steep_jump_action(struct MarioState *m);
set_water_plunge_action
Lua Example
local integerValue = set_water_plunge_action(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 set_water_plunge_action(struct MarioState *m);
transition_submerged_to_walking
Lua Example
local integerValue = transition_submerged_to_walking(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 transition_submerged_to_walking(struct MarioState *m);
update_mario_pos_for_anim
Lua Example
update_mario_pos_for_anim(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_mario_pos_for_anim(struct MarioState *m);
update_mario_sound_and_camera
Lua Example
update_mario_sound_and_camera(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_mario_sound_and_camera(struct MarioState *m);
functions from mario_actions_airborne.c
check_common_airborne_cancels
Lua Example
local integerValue = check_common_airborne_cancels(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_common_airborne_cancels(struct MarioState *m);
check_fall_damage
Lua Example
local integerValue = check_fall_damage(m, hardFallAction)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| hardFallAction | integer |
Returns
integer
C Prototype
s32 check_fall_damage(struct MarioState *m, u32 hardFallAction);
check_fall_damage_or_get_stuck
Lua Example
local integerValue = check_fall_damage_or_get_stuck(m, hardFallAction)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| hardFallAction | integer |
Returns
integer
C Prototype
s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction);
check_horizontal_wind
Lua Example
local integerValue = check_horizontal_wind(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_horizontal_wind(struct MarioState *m);
check_kick_or_dive_in_air
Lua Example
local integerValue = check_kick_or_dive_in_air(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_kick_or_dive_in_air(struct MarioState *m);
check_wall_kick
Lua Example
local integerValue = check_wall_kick(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_wall_kick(struct MarioState *m);
common_air_action_step
Lua Example
local integerValue = common_air_action_step(m, landAction, animation, stepArg)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| landAction | integer |
| animation | integer |
| stepArg | integer |
Returns
integer
C Prototype
u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, u32 stepArg);
common_air_knockback_step
Lua Example
local integerValue = common_air_knockback_step(m, landAction, hardFallAction, animation, speed)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| landAction | integer |
| hardFallAction | integer |
| animation | integer |
| speed | number |
Returns
integer
C Prototype
u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFallAction, s32 animation, f32 speed);
lava_boost_on_wall
Lua Example
local integerValue = lava_boost_on_wall(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 lava_boost_on_wall(struct MarioState *m);
mario_execute_airborne_action
Lua Example
local integerValue = mario_execute_airborne_action(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_execute_airborne_action(struct MarioState *m);
play_far_fall_sound
Lua Example
play_far_fall_sound(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void play_far_fall_sound(struct MarioState *m);
play_flip_sounds
Lua Example
play_flip_sounds(m, frame1, frame2, frame3)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| frame1 | integer |
| frame2 | integer |
| frame3 | integer |
Returns
- None
C Prototype
void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3);
play_knockback_sound
Lua Example
play_knockback_sound(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void play_knockback_sound(struct MarioState *m);
should_get_stuck_in_ground
Lua Example
local integerValue = should_get_stuck_in_ground(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 should_get_stuck_in_ground(struct MarioState *m);
update_air_with_turn
Lua Example
update_air_with_turn(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_air_with_turn(struct MarioState *m);
update_air_without_turn
Lua Example
update_air_without_turn(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_air_without_turn(struct MarioState *m);
update_flying
Lua Example
update_flying(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_flying(struct MarioState *m);
update_flying_pitch
Lua Example
update_flying_pitch(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_flying_pitch(struct MarioState *m);
update_flying_yaw
Lua Example
update_flying_yaw(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_flying_yaw(struct MarioState *m);
update_lava_boost_or_twirling
Lua Example
update_lava_boost_or_twirling(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_lava_boost_or_twirling(struct MarioState *m);
functions from mario_actions_automatic.c
add_tree_leaf_particles
Lua Example
add_tree_leaf_particles(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void add_tree_leaf_particles(struct MarioState *m);
check_common_automatic_cancels
Lua Example
local integerValue = check_common_automatic_cancels(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 check_common_automatic_cancels(struct MarioState *m);
climb_up_ledge
Lua Example
climb_up_ledge(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void climb_up_ledge(struct MarioState *m);
let_go_of_ledge
Lua Example
local integerValue = let_go_of_ledge(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 let_go_of_ledge(struct MarioState *m);
mario_execute_automatic_action
Lua Example
local integerValue = mario_execute_automatic_action(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_execute_automatic_action(struct MarioState *m);
perform_hanging_step
Lua Example
local integerValue = perform_hanging_step(m, nextPos)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| nextPos | Vec3f |
Returns
integer
C Prototype
s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos);
play_climbing_sounds
Lua Example
play_climbing_sounds(m, b)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| b | integer |
Returns
- None
C Prototype
void play_climbing_sounds(struct MarioState *m, s32 b);
set_pole_position
Lua Example
local integerValue = set_pole_position(m, offsetY)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| offsetY | number |
Returns
integer
C Prototype
s32 set_pole_position(struct MarioState *m, f32 offsetY);
update_hang_moving
Lua Example
local integerValue = update_hang_moving(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 update_hang_moving(struct MarioState *m);
update_hang_stationary
Lua Example
update_hang_stationary(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_hang_stationary(struct MarioState *m);
update_ledge_climb
Lua Example
update_ledge_climb(m, animation, endAction)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| animation | integer |
| endAction | integer |
Returns
- None
C Prototype
void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction);
update_ledge_climb_camera
Lua Example
update_ledge_climb_camera(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void update_ledge_climb_camera(struct MarioState *m);
functions from mario_actions_cutscene.c
bhv_end_peach_loop
Lua Example
bhv_end_peach_loop()
Parameters
- None
Returns
- None
C Prototype
void bhv_end_peach_loop(void);
bhv_end_toad_loop
Lua Example
bhv_end_toad_loop()
Parameters
- None
Returns
- None
C Prototype
void bhv_end_toad_loop(void);
common_death_handler
Lua Example
local integerValue = common_death_handler(m, animation, frameToDeathWarp)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| animation | integer |
| frameToDeathWarp | integer |
Returns
integer
C Prototype
s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWarp);
cutscene_put_cap_on
Lua Example
cutscene_put_cap_on(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void cutscene_put_cap_on(struct MarioState *m);
cutscene_take_cap_off
Lua Example
cutscene_take_cap_off(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void cutscene_take_cap_off(struct MarioState *m);
general_star_dance_handler
Lua Example
general_star_dance_handler(m, isInWater)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| isInWater | integer |
Returns
- None
C Prototype
void general_star_dance_handler(struct MarioState *m, s32 isInWater);
generate_yellow_sparkles
Lua Example
generate_yellow_sparkles(x, y, z, radius)
Parameters
| Field | Type |
|---|---|
| x | integer |
| y | integer |
| z | integer |
| radius | number |
Returns
- None
C Prototype
void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius);
get_credits_str_width
Lua Example
local integerValue = get_credits_str_width(str)
Parameters
| Field | Type |
|---|---|
| str | Pointer <integer> |
Returns
integer
C Prototype
s32 get_credits_str_width(char *str);
get_star_collection_dialog
Lua Example
local integerValue = get_star_collection_dialog(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 get_star_collection_dialog(struct MarioState *m);
handle_save_menu
Lua Example
handle_save_menu(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
- None
C Prototype
void handle_save_menu(struct MarioState *m);
launch_mario_until_land
Lua Example
local integerValue = launch_mario_until_land(m, endAction, animation, forwardVel)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| endAction | integer |
| animation | integer |
| forwardVel | number |
Returns
integer
C Prototype
s32 launch_mario_until_land(struct MarioState *m, s32 endAction, s32 animation, f32 forwardVel);
mario_execute_cutscene_action
Lua Example
local integerValue = mario_execute_cutscene_action(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_execute_cutscene_action(struct MarioState *m);
mario_ready_to_speak
Lua Example
local integerValue = mario_ready_to_speak(m)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
Returns
integer
C Prototype
s32 mario_ready_to_speak(struct MarioState* m);
should_start_or_continue_dialog
Lua Example
local integerValue = should_start_or_continue_dialog(m, object)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| object | Object |
Returns
integer
C Prototype
u8 should_start_or_continue_dialog(struct MarioState* m, struct Object* object);
stuck_in_ground_handler
Lua Example
stuck_in_ground_handler(m, animation, unstuckFrame, target2, target3, endAction)
Parameters
| Field | Type |
|---|---|
| m | MarioState |
| animation | integer |
| unstuckFrame | integer |
| target2 | integer |
| target3 | integer |
| endAction | integer |
Returns
- None
C Prototype
void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFrame, s32 target2, s32 target3, s32 endAction);
---