From 32f395fb0c21a8000e450a3fc6d44a7aed3b43af Mon Sep 17 00:00:00 2001
From: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
Date: Tue, 21 Oct 2025 19:42:06 +0200
Subject: [PATCH] ModFs improvements (#907)
* zip + json properties; check existing file in create file
* smlua_audio_utils_replace_sequence
* audio_stream_load, audio_sample_load, smlua_model_util_get_id
* get_texture_info + can also load PNG files
* smlua_collision_util_get
* add wildcard in properties files + set text mode
* filepath restrictions
* Some mod_storage improvements
- Cache mod storage files into a map to reduce file I/O
- Fix a bug in mod_storage_save
- Add mod_storage_load_all that returns all keys/values as a table
* shutdown; fix buffer overflow; fix warnings; lua table
* reject binary files starting with MZ or ELF
* function members
* better doc
* adding file rewind
* ModFS guide; replace yaml by ini; read string buffer changes
---
autogen/autogen.sh | 2 +-
autogen/common.py | 19 +
autogen/convert_constants.py | 21 +-
autogen/convert_functions.py | 6 +
autogen/convert_structs.py | 131 +-
autogen/extract_structs.py | 4 +
autogen/lua_definitions/constants.lua | 19 +-
autogen/lua_definitions/functions.lua | 62 +-
autogen/lua_definitions/structs.lua | 31 +-
data/dynos.c.h | 6 +-
data/dynos.cpp.h | 6 +-
data/dynos_bin_compress.cpp | 70 +
data/dynos_bin_tex.cpp | 78 +-
data/dynos_c.cpp | 12 +-
data/dynos_mgr_actor.cpp | 18 +-
data/dynos_mgr_col.cpp | 18 +-
data/dynos_mgr_tex.cpp | 14 +-
developer/dir2modfs.py | 190 -
docs/lua/constants.md | 9 +
docs/lua/functions-5.md | 4781 +----
docs/lua/functions-6.md | 9216 +++++----
docs/lua/functions-7.md | 4638 +++++
docs/lua/functions.md | 861 +-
docs/lua/guides/lighting-engine.md | 2 +
docs/lua/guides/mario-state.md | 2 +
docs/lua/guides/modfs.md | 272 +
docs/lua/guides/object-lists.md | 2 +
docs/lua/lua.md | 2 +
docs/lua/structs.md | 41 +-
src/pc/chat_commands.c | 15 +-
src/pc/dev/chat.c | 11 +-
src/pc/lua/smlua.c | 6 +-
src/pc/lua/smlua_autogen.h | 3 +
src/pc/lua/smlua_cobject.c | 10 +
src/pc/lua/smlua_cobject.h | 4 +
src/pc/lua/smlua_cobject_autogen.c | 94 +-
src/pc/lua/smlua_constants_autogen.c | 9 +-
src/pc/lua/smlua_functions_autogen.c | 160 +-
src/pc/lua/smlua_require.c | 4 +-
src/pc/lua/smlua_utils.c | 24 +
src/pc/lua/smlua_utils.h | 3 +
src/pc/lua/utils/smlua_audio_utils.c | 174 +-
src/pc/lua/utils/smlua_audio_utils.h | 2 +-
src/pc/mods/mod.c | 16 +-
src/pc/mods/mod_fs.cpp | 933 +-
src/pc/mods/mod_fs.h | 88 +-
src/pc/mods/mod_import.c | 16 +-
src/pc/mods/mod_storage.cpp | 191 +-
src/pc/mods/mod_storage.h | 5 +
src/pc/mods/mods_utils.c | 22 +-
src/pc/mods/mods_utils.h | 5 +-
src/pc/network/version.h | 2 +-
src/pc/rom_checker.cpp | 4 +-
src/pc/utils/json.hpp | 25677 ++++++++++++++++++++++++
54 files changed, 37469 insertions(+), 10542 deletions(-)
delete mode 100644 developer/dir2modfs.py
create mode 100644 docs/lua/guides/modfs.md
create mode 100644 src/pc/utils/json.hpp
diff --git a/autogen/autogen.sh b/autogen/autogen.sh
index 9459f4d61..4036b217a 100755
--- a/autogen/autogen.sh
+++ b/autogen/autogen.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
python3 ./autogen/gen_math.py $1
+python3 ./autogen/convert_functions.py $1
python3 ./autogen/convert_structs.py $1
python3 ./autogen/gen_hooks.py $1
-python3 ./autogen/convert_functions.py $1
python3 ./autogen/convert_constants.py $1
python3 ./autogen/extract_display_lists.py $1
diff --git a/autogen/common.py b/autogen/common.py
index cea0d42f1..9f3ad5714 100644
--- a/autogen/common.py
+++ b/autogen/common.py
@@ -5,6 +5,7 @@ from vec_types import *
usf_types = ['u8', 'u16', 'u32', 'u64', 's8', 's16', 's32', 's64', 'f32', 'f64']
vec_types = list(VEC_TYPES.keys())
typedef_pointers = ['BehaviorScript', 'ObjectAnimPointer', 'Collision', 'LevelScript', 'Trajectory', 'Texture']
+cobject_function_identifier = 'FUNCTION'
type_mappings = {
'char': 's8',
@@ -117,6 +118,12 @@ def translate_type_to_lvt(ptype, allowArrays=False):
if ptype == "LuaFunction":
return "LVT_LUAFUNCTION"
+ if ptype == "LuaTable":
+ return "LVT_LUATABLE"
+
+ if ptype == cobject_function_identifier:
+ return "LVT_FUNCTION"
+
if "struct" in ptype:
if pointerLvl > 1:
return "LVT_???"
@@ -194,6 +201,12 @@ def translate_type_to_lot(ptype, allowArrays=True):
if ptype == 'LuaFunction':
return 'LOT_NONE'
+ if ptype == 'LuaTable':
+ return 'LOT_NONE'
+
+ if ptype == cobject_function_identifier:
+ return 'LOT_NONE'
+
if ptype in override_types:
return 'LOT_' + ptype.upper()
@@ -280,6 +293,12 @@ def translate_type_to_lua(ptype):
if ptype == 'LuaFunction':
return '`Lua Function` ()', None
+ if ptype == 'LuaTable':
+ return '`table`', None
+
+ if ptype == cobject_function_identifier:
+ return cobject_function_identifier, None
+
if ptype.count('*') == 1 and '???' not in translate_type_to_lvt(ptype):
ptype = ptype.replace('const', '').replace('*', '').strip()
s = '`Pointer` <`%s`>' % translate_type_to_lua(ptype)[0].replace('`', '').strip()
diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py
index 615b442fe..f3939d1cc 100644
--- a/autogen/convert_constants.py
+++ b/autogen/convert_constants.py
@@ -67,7 +67,7 @@ exclude_constants = {
"src/pc/djui/djui_console.h": [ "CONSOLE_MAX_TMP_BUFFER" ],
"src/pc/lua/smlua_hooks.h": [ "MAX_HOOKED_MOD_MENU_ELEMENTS", "^HOOK_RETURN_.*", "^ACTION_HOOK_.*", "^MOD_MENU_ELEMENT_.*" ],
"src/pc/djui/djui_panel_menu.h": [ "RAINBOW_TEXT_LEN" ],
- "src/pc/mods/mod_fs.h": [ "MOD_FS_DIRECTORY", "MOD_FS_EXTENSION", "MOD_FS_VERSION", "INT_TYPE_MAX", "FLOAT_TYPE_MAX", "FILE_SEEK_MAX" ],
+ "src/pc/mods/mod_fs.h": [ "INT_TYPE_MAX", "FLOAT_TYPE_MAX", "FILE_SEEK_MAX" ],
}
include_constants = {
@@ -139,6 +139,7 @@ defined_values = {
'VERSION_JP': False,
'VERSION_SH': False,
'F3DEX_GBI_2': True,
+ 'DEVELOPMENT': False,
}
############################################################################
@@ -255,15 +256,17 @@ def process_define(filename, line, inIfBlock):
val = val.replace('(u8)', '')
val = val.replace('(u64)', '')
val = re.sub(r'\.\d+f', '', val)
+ val = val.strip()
- for p in val.split(' '):
- if p.startswith('0x'):
- continue
- p = re.sub(r'0x[a-fA-F0-9]+', '', p)
- if re.search(r'[a-z]', p) != None and "VERSION_TEXT" not in line and "SM64COOPDX_VERSION" not in line:
- if 'gCurrentObject' not in line and verbose:
- print('UNRECOGNIZED DEFINE: ' + line)
- return None
+ if not (val.startswith('"') and val.endswith('"') and '"' not in val[1:-1]):
+ for p in val.split(' '):
+ if p.startswith('0x'):
+ continue
+ p = re.sub(r'0x[a-fA-F0-9]+', '', p)
+ if re.search(r'[a-z]', p) != None and "VERSION_TEXT" not in line and "SM64COOPDX_VERSION" not in line:
+ if 'gCurrentObject' not in line and verbose:
+ print('UNRECOGNIZED DEFINE: ' + line)
+ return None
if not allowed_identifier(filename, ident):
return None
diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py
index 8f0e8758a..f886f43e0 100644
--- a/autogen/convert_functions.py
+++ b/autogen/convert_functions.py
@@ -138,6 +138,8 @@ override_disallowed_functions = {
"src/game/first_person_cam.h": [ "first_person_update" ],
"src/pc/lua/utils/smlua_collision_utils.h": [ "collision_find_surface_on_ray" ],
"src/engine/behavior_script.h": [ "stub_behavior_script_2", "cur_obj_update" ],
+ "src/pc/mods/mod_storage.h": [ "mod_storage_shutdown" ],
+ "src/pc/mods/mod_fs.h": [ "mod_fs_read_file_from_uri", "mod_fs_shutdown" ],
"src/pc/utils/misc.h": [ "str_.*", "file_get_line", "delta_interpolate_(normal|rgba|mtx)", "detect_and_skip_mtx_interpolation", "precise_delay_f64" ],
"src/engine/lighting_engine.h": [ "le_calculate_vertex_lighting", "le_clear", "le_shutdown" ],
}
@@ -813,6 +815,8 @@ def build_param(fid, param, i):
return ' %s %s = smlua_to_bytestring(L, %d);\n' % (ptype, pid, i)
elif ptype == 'LuaFunction':
return ' %s %s = smlua_to_lua_function(L, %d);\n' % (ptype, pid, i)
+ elif ptype == 'LuaTable':
+ return ' %s %s = smlua_to_lua_table(L, %d);\n' % (ptype, pid, i)
elif translate_type_to_lot(ptype) == 'LOT_POINTER':
lvt = translate_type_to_lvt(ptype)
return ' %s %s = (%s)smlua_to_cpointer(L, %d, %s);\n' % (ptype, pid, ptype, i, lvt)
@@ -868,6 +872,8 @@ def build_call(function):
lfunc = 'lua_pushstring'
elif ftype == 'ByteString':
lfunc = 'smlua_push_bytestring'
+ elif ftype == 'LuaTable':
+ lfunc = 'smlua_push_lua_table'
elif translate_type_to_lot(ftype) == 'LOT_POINTER':
lvt = translate_type_to_lvt(ftype)
return ' smlua_push_pointer(L, %s, (void*)%s, NULL);\n' % (lvt, ccall)
diff --git a/autogen/convert_structs.py b/autogen/convert_structs.py
index a15eb03da..eb5a2ced6 100644
--- a/autogen/convert_structs.py
+++ b/autogen/convert_structs.py
@@ -323,6 +323,14 @@ def parse_struct(struct_str, sortFields = False):
field['identifier'] = field_id.strip()
field['field_str'] = field_str
+ # handle function members
+ if field['type'].startswith(cobject_function_identifier):
+ field_function = field['identifier']
+ field_type, field_id = field['type'].split()
+ field['type'] = field_type.strip()
+ field['identifier'] = field_id.strip('"').strip()
+ field['function'] = field_function.strip()
+
struct['fields'].append(field)
if identifier == 'Object':
@@ -486,6 +494,9 @@ def get_struct_field_info(struct, field):
if fid in override_field_mutable[sid] or '*' in override_field_mutable[sid]:
fimmutable = 'false'
+ if ftype == cobject_function_identifier:
+ fimmutable = 'true'
+
if not ('char' in ftype and '[' in ftype and 'unsigned' not in ftype):
array_match = re.search(r'\[([^\]]+)\]', ftype)
if array_match:
@@ -508,6 +519,7 @@ def build_struct(struct):
# build up table and track column width
field_table = []
+ field_functions = []
for field in struct['fields']:
fid, ftype, fimmutable, lvt, lot, size = get_struct_field_info(struct, field)
@@ -533,22 +545,40 @@ def build_struct(struct):
startStr += '#ifndef ' + override_field_version_excludes[fid] + '\n'
endStr += '\n#endif'
startStr += ' { '
- row.append(startStr )
- row.append('"%s", ' % fid )
- row.append('%s, ' % lvt )
- row.append('offsetof(%s%s, %s), ' % (struct_str, name, field['identifier']))
- row.append('%s, ' % fimmutable )
- row.append('%s, ' % lot )
- row.append('%s, ' % size )
- row.append('sizeof(%s)' % ftype )
- row.append(endStr )
+ if ftype == cobject_function_identifier:
+ row.append(startStr )
+ row.append('"%s", ' % fid )
+ row.append('%s, ' % lvt )
+ row.append('(size_t) FUNCTION__%s, ' % (field['function']))
+ row.append('%s, ' % fimmutable )
+ row.append('%s, ' % lot )
+ row.append('%s, ' % size )
+ row.append('sizeof(const char *)' )
+ row.append(endStr )
+ field_functions.append(field['function'])
+ else:
+ row.append(startStr )
+ row.append('"%s", ' % fid )
+ row.append('%s, ' % lvt )
+ row.append('offsetof(%s%s, %s), ' % (struct_str, name, field['identifier']))
+ row.append('%s, ' % fimmutable )
+ row.append('%s, ' % lot )
+ row.append('%s, ' % size )
+ row.append('sizeof(%s)' % ftype )
+ row.append(endStr )
field_table.append(row)
field_table_str, field_count = table_to_string(field_table)
field_count_define = 'LUA_%s_FIELD_COUNT' % identifier_to_caps(sid)
struct_lot = 'LOT_%s' % sid.upper()
- s = "#define %s $[STRUCTFIELDCOUNT]\n" % field_count_define
+ s = ''
+ if field_functions:
+ for field_function in field_functions:
+ s += 'static const char FUNCTION__%s[] = "%s";\n' % (field_function, field_function)
+ s += '\n'
+
+ s += "#define %s $[STRUCTFIELDCOUNT]\n" % field_count_define
s += "static struct LuaObjectField s%sFields[%s] = {\n" % (sid, field_count_define)
s += field_table_str
s += '};\n'
@@ -648,6 +678,21 @@ def build_includes():
############################################################################
+# HACK: Parse docs/functions.md to find the page where the function is documented
+function_links = {}
+
+def doc_find_function_link(function):
+ if not function_links:
+ with open('docs/lua/functions.md') as f:
+ lines = f.readlines()
+ for line in lines:
+ line = line.replace(' ', '').strip()
+ res, n = re.subn(r'^-\[(.*)\]\((.*)\)', '\\1,\\2', line)
+ if n != 0:
+ fname, flink = res.split(',')
+ function_links[fname] = flink
+ return function_links.get(function, '')
+
def doc_struct_index(structs):
s = '# Supported Structs\n'
for struct in structs:
@@ -664,26 +709,30 @@ def doc_struct_field(struct, field):
sid = struct['identifier']
if sid in override_field_invisible:
if fid in override_field_invisible[sid]:
- return ''
+ return '', False
if sid in override_field_deprecated:
if fid in override_field_deprecated[sid]:
- return ''
+ return '', False
if '???' in lvt or '???' in lot:
- return ''
+ return '', False
ftype, flink = translate_type_to_lua(ftype)
+ if ftype == cobject_function_identifier:
+ flink = doc_find_function_link(field['function'])
+ return '| %s | [`%s`](%s) |\n' % (fid, field['function'], flink), True
+
restrictions = ('', 'read-only')[fimmutable == 'true']
global total_fields
total_fields += 1
if flink:
- return '| %s | [%s](%s) | %s |\n' % (fid, ftype, flink, restrictions)
+ return '| %s | [%s](%s) | %s |\n' % (fid, ftype, flink, restrictions), False
- return '| %s | %s | %s |\n' % (fid, ftype, restrictions)
+ return '| %s | %s | %s |\n' % (fid, ftype, restrictions), False
def doc_struct_object_fields(struct):
@@ -698,7 +747,8 @@ def doc_struct_object_fields(struct):
s += "| Field | Type | Access |\n"
s += "| ----- | ---- | ------ |\n"
- s += doc_struct_field(struct, field)
+ line, _ = doc_struct_field(struct, field)
+ s += line
return s
@@ -709,17 +759,27 @@ def doc_struct(struct):
s += "| Field | Type | Access |\n"
s += "| ----- | ---- | ------ |\n"
-
# build doc table
- field_table = []
+ field_functions = ''
for field in struct['fields']:
if 'object_field' in field and field['object_field'] == True:
continue
- s += doc_struct_field(struct, field)
+ line, isFunction = doc_struct_field(struct, field)
+ if isFunction:
+ field_functions += line
+ else:
+ s += line
if sid == 'Object':
s += doc_struct_object_fields(struct)
+ # functions
+ if field_functions:
+ s += '\n**Functions:**\n\n'
+ s += "| Name | Reference |\n"
+ s += "| ---- | --------- |\n"
+ s += field_functions
+
s += '\n[:arrow_up_small:](#)\n\n
\n'
return s
@@ -742,6 +802,32 @@ def doc_structs(structs):
def_pointers = []
+# HACK: Parse autogen/lua_definitions/functions.lua to find the function signature
+function_signatures = {}
+
+def get_function_signature(function):
+ if not function_signatures:
+ with open('autogen/lua_definitions/functions.lua') as f:
+ lines = f.readlines()
+ function_params = []
+ function_return = None
+ for line in lines:
+ if line.startswith('--- @param'):
+ function_params.append(line.split()[2:4])
+ elif line.startswith('--- @return'):
+ function_return = line.split()[2]
+ elif line.startswith('function'):
+ sig = 'fun('
+ sig += ', '.join(['%s: %s' % (param_name, param_type) for param_name, param_type in function_params])
+ sig += ')'
+ if function_return:
+ sig += ': %s' % (function_return)
+ function_name = line.replace('(', ' ').split()[1]
+ function_signatures[function_name] = sig
+ function_params.clear()
+ function_return = None
+ return function_signatures.get(function, 'function')
+
def def_struct(struct):
sid = struct['identifier']
@@ -763,7 +849,12 @@ def def_struct(struct):
ftype, flink = translate_type_to_lua(ftype)
- ftype = translate_to_def(ftype)
+ # try to get the function signature
+ if ftype == cobject_function_identifier:
+ ftype = get_function_signature(field['function'])
+ else:
+ ftype = translate_to_def(ftype)
+
if ftype.startswith('Pointer_') and ftype not in def_pointers:
def_pointers.append(ftype)
diff --git a/autogen/extract_structs.py b/autogen/extract_structs.py
index a2d65f1e9..5fb06c5ef 100644
--- a/autogen/extract_structs.py
+++ b/autogen/extract_structs.py
@@ -1,6 +1,7 @@
import os
import re
import sys
+from common import cobject_function_identifier
def extract_structs(filename):
with open(filename) as file:
@@ -36,6 +37,9 @@ def extract_structs(filename):
while (' ' in txt):
txt = txt.replace(' ', ' ')
+ # handle function members (NOT function pointers)
+ txt = re.sub(f'{cobject_function_identifier}\\((.*),(.*)\\)', f'{cobject_function_identifier} \\1 \\2', txt)
+
# strip macros
txt = re.sub(r'[^a-zA-Z0-9_][A-Z0-9_]+\(.*\)', '', txt)
diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua
index 91e53ffeb..5f9b76fa0 100644
--- a/autogen/lua_definitions/constants.lua
+++ b/autogen/lua_definitions/constants.lua
@@ -4557,14 +4557,20 @@ GRAB_POS_BOWSER = 3 --- @type MarioGrabPosGSCId
--- | `GRAB_POS_BOWSER`
--- @type integer
-MOD_FS_MAX_SIZE = 0x1000000
+MOD_FS_MAX_SIZE = 0x2000000
--- @type integer
-MOD_FS_MAX_FILES = 0x100
+MOD_FS_MAX_FILES = 0x200
--- @type integer
MOD_FS_MAX_PATH = 0x100
+--- @type string
+MOD_FS_URI_PREFIX = "modfs:/"
+
+--- @type string
+MOD_FS_URI_FORMAT = "modfs:/%s/%s"
+
INT_TYPE_U8 = 0 --- @type ModFsFileIntType
INT_TYPE_U16 = 1 --- @type ModFsFileIntType
INT_TYPE_U32 = 2 --- @type ModFsFileIntType
@@ -6758,6 +6764,9 @@ R_CBUTTONS = CONT_F
--- @type integer
D_CBUTTONS = CONT_D
+--- @type string
+PALETTES_DIRECTORY = "palettes"
+
--- @type integer
MAX_PRESET_PALETTES = 128
@@ -11169,5 +11178,11 @@ VERSION_NUMBER = 41
--- @type integer
MINOR_VERSION_NUMBER = 0
+--- @type string
+GAME_NAME = "sm64coopdx"
+
+--- @type string
+WINDOW_NAME = "Super Mario 64 Coop Deluxe"
+
--- @type integer
MAX_VERSION_LENGTH = 128
diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua
index 7ce58f6e8..3ba796772 100644
--- a/autogen/lua_definitions/functions.lua
+++ b/autogen/lua_definitions/functions.lua
@@ -7435,25 +7435,6 @@ function mod_fs_create()
-- ...
end
---- @return boolean
---- Deletes the modfs object of the active mod if it exists. Returns true on success
-function mod_fs_delete()
- -- ...
-end
-
---- @return boolean
---- Saves the modfs object of the active mod if it exists. Returns true on success
-function mod_fs_save()
- -- ...
-end
-
---- @param pub boolean
---- @return boolean
---- Marks the modfs object of the active mod as public (i.e. readable by other mods) if it exists. Returns true on success
-function mod_fs_set_public(pub)
- -- ...
-end
-
--- @param modFs ModFs
--- @param index integer
--- @return string
@@ -7514,6 +7495,28 @@ function mod_fs_clear(modFs)
-- ...
end
+--- @param modFs ModFs
+--- @return boolean
+--- Saves the provided `modFs` to persistent storage. Returns true on success
+function mod_fs_save(modFs)
+ -- ...
+end
+
+--- @param modFs ModFs
+--- @return boolean
+--- Removes the provided `modFs` from persistent storage and deletes its object. Returns true on success
+function mod_fs_delete(modFs)
+ -- ...
+end
+
+--- @param modFs ModFs
+--- @param pub boolean
+--- @return boolean
+--- Marks the provided `modFs` as public (i.e. readable by other mods). Returns true on success
+function mod_fs_set_public(modFs, pub)
+ -- ...
+end
+
--- @param file ModFsFile
--- @return boolean
--- Reads a boolean from a binary modfs `file`
@@ -7618,6 +7621,13 @@ function mod_fs_file_seek(file, offset, origin)
-- ...
end
+--- @param file ModFsFile
+--- @return boolean
+--- Sets the current position of a modfs `file` to its beginning. Returns true on success
+function mod_fs_file_rewind(file)
+ -- ...
+end
+
--- @param file ModFsFile
--- @return boolean
--- Returns true if the provided modfs `file` has reached its end of file
@@ -7642,6 +7652,14 @@ function mod_fs_file_erase(file, length)
-- ...
end
+--- @param file ModFsFile
+--- @param text boolean
+--- @return boolean
+--- Marks the provided modfs `file` as text. Returns true on success
+function mod_fs_file_set_text_mode(file, text)
+ -- ...
+end
+
--- @param file ModFsFile
--- @param pub boolean
--- @return boolean
@@ -7707,6 +7725,12 @@ function mod_storage_load_bool(key)
-- ...
end
+--- @return table
+--- Loads all keys and values in mod storage as strings and returns them as a table
+function mod_storage_load_all()
+ -- ...
+end
+
--- @param key string
--- @return boolean
--- Checks if a `key` is in mod storage
diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua
index 614411477..95e263d89 100644
--- a/autogen/lua_definitions/structs.lua
+++ b/autogen/lua_definitions/structs.lua
@@ -1280,7 +1280,7 @@
--- @field public customBehaviorIndex integer
--- @class ModAudio
---- @field public file ModFile
+--- @field public filepath string
--- @field public isStream boolean
--- @field public baseVolume number
--- @field public loaded boolean
@@ -1304,6 +1304,16 @@
--- @field public numFiles integer
--- @field public totalSize integer
--- @field public isPublic boolean
+--- @field public get_filename fun(modFs: ModFs, index: integer): string
+--- @field public get_file fun(modFs: ModFs, filepath: string): ModFsFile
+--- @field public create_file fun(modFs: ModFs, filepath: string, text: boolean): ModFsFile
+--- @field public move_file fun(modFs: ModFs, oldpath: string, newpath: string, overwriteExisting: boolean): boolean
+--- @field public copy_file fun(modFs: ModFs, srcpath: string, dstpath: string, overwriteExisting: boolean): boolean
+--- @field public delete_file fun(modFs: ModFs, filepath: string): boolean
+--- @field public clear fun(modFs: ModFs): boolean
+--- @field public save fun(modFs: ModFs): boolean
+--- @field public delete fun(modFs: ModFs): boolean
+--- @field public set_public fun(modFs: ModFs, pub: boolean): boolean
--- @class ModFsFile
--- @field public modFs ModFs
@@ -1312,6 +1322,25 @@
--- @field public offset integer
--- @field public isText boolean
--- @field public isPublic boolean
+--- @field public read_bool fun(file: ModFsFile): boolean
+--- @field public read_integer fun(file: ModFsFile, intType: ModFsFileIntType): integer
+--- @field public read_number fun(file: ModFsFile, floatType: ModFsFileFloatType): number
+--- @field public read_bytes fun(file: ModFsFile, length: integer): string
+--- @field public read_string fun(file: ModFsFile): string
+--- @field public read_line fun(file: ModFsFile): string
+--- @field public write_bool fun(file: ModFsFile, value: boolean): boolean
+--- @field public write_integer fun(file: ModFsFile, value: integer, intType: ModFsFileIntType): boolean
+--- @field public write_number fun(file: ModFsFile, value: number, floatType: ModFsFileFloatType): boolean
+--- @field public write_bytes fun(file: ModFsFile, bytestring: string): boolean
+--- @field public write_string fun(file: ModFsFile, str: string): boolean
+--- @field public write_line fun(file: ModFsFile, str: string): boolean
+--- @field public seek fun(file: ModFsFile, offset: integer, origin: ModFsFileSeek): boolean
+--- @field public rewind fun(file: ModFsFile): boolean
+--- @field public is_eof fun(file: ModFsFile): boolean
+--- @field public fill fun(file: ModFsFile, byte: integer, length: integer): boolean
+--- @field public erase fun(file: ModFsFile, length: integer): boolean
+--- @field public set_text_mode fun(file: ModFsFile, text: boolean): boolean
+--- @field public set_public fun(file: ModFsFile, pub: boolean): boolean
--- @class ModeTransitionInfo
--- @field public newMode integer
diff --git a/data/dynos.c.h b/data/dynos.c.h
index c5171f31e..419092eb1 100644
--- a/data/dynos.c.h
+++ b/data/dynos.c.h
@@ -37,17 +37,17 @@ void dynos_generate_packs(const char* directory);
// -- geos -- //
void dynos_actor_override(struct Object* obj, void** aSharedChild);
-void dynos_add_actor_custom(s32 modIndex, s32 modFileIndex, const char *filePath, const char* geoName);
+bool dynos_add_actor_custom(s32 modIndex, s32 modFileIndex, const char *filePath, const char* geoName);
const void* dynos_geolayout_get(const char *name);
bool dynos_actor_get_mod_index_and_token(struct GraphNode *graphNode, u32 tokenIndex, s32 *modIndex, s32 *modFileIndex, const char **token);
void dynos_actor_register_modified_graph_node(struct GraphNode *node);
// -- collisions -- //
-void dynos_add_collision(const char *filePath, const char* collisionName);
+bool dynos_add_collision(const char *filePath, const char* collisionName);
Collision* dynos_collision_get(const char* collisionName);
// -- textures -- //
-void dynos_add_texture(const char *filePath, const char* textureName);
+bool dynos_add_texture(const char *filePath, const char* textureName);
bool dynos_texture_get(const char* textureName, struct TextureInfo* outTextureInfo);
bool dynos_texture_get_from_data(const Texture *tex, struct TextureInfo* outTextureInfo);
void dynos_texture_override_set(const char* textureName, struct TextureInfo* overrideTextureInfo);
diff --git a/data/dynos.cpp.h b/data/dynos.cpp.h
index d45985daf..3afdfb859 100644
--- a/data/dynos.cpp.h
+++ b/data/dynos.cpp.h
@@ -897,7 +897,7 @@ void DynOS_Pack_AddTex(PackData* aPackData, DataNode* aTexData);
//
std::map &DynOS_Actor_GetValidActors();
-void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFilename, const char *aActorName);
+bool DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFilename, const char *aActorName);
const void *DynOS_Actor_GetLayoutFromName(const char *aActorName);
bool DynOS_Actor_GetModIndexAndToken(const GraphNode *aGraphNode, u32 aTokenIndex, s32 *outModIndex, s32 *outModFileIndex, const char **outToken);
ActorGfx* DynOS_Actor_GetActorGfx(const GraphNode* aGraphNode);
@@ -925,7 +925,7 @@ u8 *DynOS_Tex_ConvertToRGBA32(const u8 *aData, u64 aLength, s32 aFormat, s32 aSi
bool DynOS_Tex_Import(void **aOutput, void *aPtr, s32 aTile, void *aGfxRApi, void **aHashMap, void *aPool, u32 *aPoolPos, u32 aPoolSize);
void DynOS_Tex_Activate(DataNode* aNode, bool aCustomTexture);
void DynOS_Tex_Deactivate(DataNode* aNode);
-void DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName);
+bool DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName);
bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo);
bool DynOS_Tex_GetFromData(const Texture *aTex, struct TextureInfo* aOutTexInfo);
void DynOS_Tex_Override_Set(const char* textureName, struct TextureInfo* aOverrideTexInfo);
@@ -963,7 +963,7 @@ void DynOS_Bhv_ModShutdown();
// Col Manager
//
-void DynOS_Col_Activate(const SysPath &aFilePath, const char *aCollisionName);
+bool DynOS_Col_Activate(const SysPath &aFilePath, const char *aCollisionName);
Collision* DynOS_Col_Get(const char* collisionName);
void DynOS_Col_ModShutdown();
diff --git a/data/dynos_bin_compress.cpp b/data/dynos_bin_compress.cpp
index 02a3546a5..302c6c2b1 100644
--- a/data/dynos_bin_compress.cpp
+++ b/data/dynos_bin_compress.cpp
@@ -1,6 +1,10 @@
#include "dynos.cpp.h"
#include
+extern "C" {
+#include "pc/mods/mod_fs.h"
+}
+
static const u64 DYNOS_BIN_COMPRESS_MAGIC = 0x4E4942534F4E5944llu;
static FILE *sFile = NULL;
static u8 *sBufferUncompressed = NULL;
@@ -154,9 +158,75 @@ bool DynOS_Bin_Compress(const SysPath &aFilename) {
return true;
}
+static BinFile *DynOS_Bin_Decompress_ModFs(const SysPath &aFilename) {
+ DynOS_Bin_Compress_Init();
+
+ // Read file data
+ void *_Buffer = NULL;
+ u32 _Size = 0;
+ if (!mod_fs_read_file_from_uri(aFilename.c_str(), &_Buffer, &_Size)) {
+ DynOS_Bin_Compress_Free();
+ return NULL;
+ }
+ sBufferCompressed = (u8 *) _Buffer;
+ sLengthCompressed = _Size;
+
+ // Check file length
+ u64 _LengthHeader = (u64) (sizeof(u64) + sizeof(u64));
+ if (!DynOS_Bin_Compress_Check(
+ sLengthCompressed >= _LengthHeader,
+ __FUNCTION__, aFilename.c_str(), "Empty file"
+ )) return NULL;
+
+ // Compare with magic constant
+ // If not equal, it's not a compressed file
+ u64 _Magic = ((u64 *) _Buffer)[0];
+ if (_Magic != DYNOS_BIN_COMPRESS_MAGIC) {
+ BinFile *_BinFile = BinFile::OpenB(sBufferCompressed, sLengthCompressed);
+ DynOS_Bin_Compress_Free();
+ return _BinFile;
+ }
+ PrintNoNewLine("Decompressing file \"%s\"...", aFilename.c_str());
+
+ // Read expected uncompressed file size
+ sLengthUncompressed = ((u64 *) _Buffer)[1];
+ sLengthCompressed -= _LengthHeader;
+ u8 *_BufferCompressed = sBufferCompressed + _LengthHeader;
+
+ // Allocate memory for uncompressed buffer
+ if (!DynOS_Bin_Compress_Check(
+ (sBufferUncompressed = (u8 *) calloc(sLengthUncompressed, sizeof(u8))) != NULL,
+ __FUNCTION__, aFilename.c_str(), "Cannot allocate memory for decompression"
+ )) return NULL;
+
+ // Uncompress data
+ uLongf _LengthUncompressed = (uLongf)sLengthUncompressed;
+ int uncompressRc = uncompress(sBufferUncompressed, &_LengthUncompressed, _BufferCompressed, sLengthCompressed);
+ sLengthUncompressed = _LengthUncompressed;
+ if (!DynOS_Bin_Compress_Check(
+ uncompressRc == Z_OK,
+ __FUNCTION__, aFilename.c_str(), "Cannot uncompress data"
+ )) {
+ PrintError("ERROR: uncompress rc: %d, length uncompressed: %lu, length compressed: %lu, length header: %lu", uncompressRc, sLengthUncompressed, sLengthCompressed, _LengthHeader);
+ return NULL;
+ }
+ Print("uncompress rc: %d, length uncompressed: %lu, length compressed: %lu, length header: %lu", uncompressRc, sLengthUncompressed, sLengthCompressed, _LengthHeader);
+
+ // Return uncompressed data as a BinFile
+ BinFile *_BinFile = BinFile::OpenB(sBufferUncompressed, sLengthUncompressed);
+ DynOS_Bin_Compress_Free();
+ Print(" Done.");
+ return _BinFile;
+}
+
BinFile *DynOS_Bin_Decompress(const SysPath &aFilename) {
DynOS_Bin_Compress_Init();
+ // Check modfs
+ if (is_mod_fs_file(aFilename.c_str())) {
+ return DynOS_Bin_Decompress_ModFs(aFilename);
+ }
+
// Open input file
if (!DynOS_Bin_Compress_Check(
(sFile = f_open_r(aFilename.c_str())) != NULL,
diff --git a/data/dynos_bin_tex.cpp b/data/dynos_bin_tex.cpp
index 7385726ae..858526d45 100644
--- a/data/dynos_bin_tex.cpp
+++ b/data/dynos_bin_tex.cpp
@@ -2,8 +2,11 @@
extern "C" {
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb/stb_image_write.h"
+#include "pc/mods/mod_fs.h"
}
+#define PNG_SIGNATURE 0x0A1A0A0D474E5089llu
+
///////////
// Utils //
///////////
@@ -304,46 +307,67 @@ DataNode* DynOS_Tex_LoadFromBinary(const SysPath &aPackFolder, const Sy
// Load data from binary file
DataNode* _TexNode = NULL;
- BinFile *_File = BinFile::OpenR(aFilename.c_str());
+ BinFile *_File = NULL;
+ if (is_mod_fs_file(aFilename.c_str())) {
+ void *_Buffer = NULL;
+ u32 _Size = 0;
+ if (mod_fs_read_file_from_uri(aFilename.c_str(), &_Buffer, &_Size)) {
+ _File = BinFile::OpenB((const u8 *) _Buffer, _Size);
+ free(_Buffer);
+ }
+ } else {
+ _File = BinFile::OpenR(aFilename.c_str());
+ }
if (!_File) { return NULL; }
u8 type = _File->Read();
if (type == DATA_TYPE_TEXTURE) {
+
// load png-texture
_TexNode = New>();
- _TexNode->mData = New();
-
_TexNode->mName.Read(_File);
+ _TexNode->mData = New();
_TexNode->mData->mPngData.Read(_File);
- BinFile::Close(_File);
+
+ } else if (type == DATA_TYPE_TEXTURE_RAW) {
+
+ // load raw-texture
+ _TexNode = New>();
+ _TexNode->mName.Read(_File);
+ _TexNode->mData = New();
+ _TexNode->mData->mRawFormat = _File->Read();
+ _TexNode->mData->mRawSize = _File->Read();
+ _TexNode->mData->mRawWidth = _File->Read();
+ _TexNode->mData->mRawHeight = _File->Read();
+ _TexNode->mData->mRawData.Read(_File);
+
+ } else if ((_File->SetOffset(0), _File->Read() == PNG_SIGNATURE)) {
+ _File->SetOffset(0);
+
+ // load PNG file
+ _TexNode = New>();
+ _TexNode->mName = aFilename.c_str();
+ _TexNode->mData = New();
+ _TexNode->mData->mPngData.Resize(_File->Size());
+ _File->Read(_TexNode->mData->mPngData.begin(), _File->Size());
+ }
+
+ BinFile::Close(_File);
+
+ if (_TexNode) {
+
+ // For some reason texture nodes are indexed to DynosCustomTexs by their node name,
+ // and not by `aTexName`, but DynOS_Tex_Get searches for `aTexName`...
+ // Normally, this doesn't cause any issue, but things go wrong when `aTexName`
+ // is not the same as the texture node name (which is the case for modfs files).
+ if (is_mod_fs_file(aFilename.c_str())) {
+ _TexNode->mName = aTexName;
+ }
if (aAddToPack) {
if (!_Pack) { _Pack = DynOS_Pack_Add(aPackFolder); }
DynOS_Pack_AddTex(_Pack, _TexNode);
}
-
- return _TexNode;
- } else if (type != DATA_TYPE_TEXTURE_RAW) {
- BinFile::Close(_File);
- return NULL;
- }
-
- // load raw-texture
- _TexNode = New>();
- _TexNode->mData = New();
-
- _TexNode->mName.Read(_File);
- _TexNode->mData->mRawFormat = _File->Read();
- _TexNode->mData->mRawSize = _File->Read();
- _TexNode->mData->mRawWidth = _File->Read();
- _TexNode->mData->mRawHeight = _File->Read();
- _TexNode->mData->mRawData.Read(_File);
-
- BinFile::Close(_File);
-
- if (aAddToPack) {
- if (!_Pack) { _Pack = DynOS_Pack_Add(aPackFolder); }
- DynOS_Pack_AddTex(_Pack, _TexNode);
}
return _TexNode;
diff --git a/data/dynos_c.cpp b/data/dynos_c.cpp
index f3f501249..0bbd25ed3 100644
--- a/data/dynos_c.cpp
+++ b/data/dynos_c.cpp
@@ -115,8 +115,8 @@ void dynos_actor_override(struct Object* obj, void** aSharedChild) {
DynOS_Actor_Override(obj, aSharedChild);
}
-void dynos_add_actor_custom(s32 modIndex, s32 modFileIndex, const char *filePath, const char* geoName) {
- DynOS_Actor_AddCustom(modIndex, modFileIndex, filePath, geoName);
+bool dynos_add_actor_custom(s32 modIndex, s32 modFileIndex, const char *filePath, const char* geoName) {
+ return DynOS_Actor_AddCustom(modIndex, modFileIndex, filePath, geoName);
}
const void* dynos_geolayout_get(const char *name) {
@@ -133,8 +133,8 @@ void dynos_actor_register_modified_graph_node(struct GraphNode *node) {
// -- collisions -- //
-void dynos_add_collision(const char *filePath, const char* collisionName) {
- DynOS_Col_Activate(filePath, collisionName);
+bool dynos_add_collision(const char *filePath, const char* collisionName) {
+ return DynOS_Col_Activate(filePath, collisionName);
}
Collision* dynos_collision_get(const char* collisionName) {
@@ -143,9 +143,9 @@ Collision* dynos_collision_get(const char* collisionName) {
// -- textures -- //
-void dynos_add_texture(const char *filePath, const char* textureName) {
+bool dynos_add_texture(const char *filePath, const char* textureName) {
SysPath _FilePath = filePath;
- DynOS_Tex_AddCustom(_FilePath, textureName);
+ return DynOS_Tex_AddCustom(_FilePath, textureName);
}
bool dynos_texture_get(const char* textureName, struct TextureInfo* outTextureInfo) {
diff --git a/data/dynos_mgr_actor.cpp b/data/dynos_mgr_actor.cpp
index 5aba16350..fda357d0c 100644
--- a/data/dynos_mgr_actor.cpp
+++ b/data/dynos_mgr_actor.cpp
@@ -9,6 +9,7 @@ extern "C" {
#include "game/object_list_processor.h"
#include "pc/configfile.h"
#include "pc/lua/smlua_hooks.h"
+#include "pc/mods/mod_fs.h"
}
// Static maps/arrays
@@ -31,7 +32,7 @@ std::map &DynOS_Actor_GetValidActors() {
return DynosValidActors();
}
-void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFilename, const char *aActorName) {
+bool DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFilename, const char *aActorName) {
const void* georef = DynOS_Builtin_Actor_GetFromName(aActorName);
u16 actorLen = strlen(aActorName);
@@ -42,7 +43,7 @@ void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFil
if (!_GfxData) {
PrintError(" ERROR: Couldn't load Actor Binary \"%s\" from \"%s\"", actorName, aFilename.c_str());
free(actorName);
- return;
+ return false;
}
_GfxData->mModIndex = aModIndex;
_GfxData->mModFileIndex = aModFileIndex;
@@ -51,7 +52,7 @@ void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFil
if (!geoLayout) {
PrintError(" ERROR: Couldn't load geo layout for \"%s\"", actorName);
free(actorName);
- return;
+ return false;
}
// Alloc and init the actors gfx list
@@ -63,7 +64,7 @@ void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFil
if (!actorGfx.mGraphNode) {
PrintError(" ERROR: Couldn't load graph node for \"%s\"", actorName);
free(actorName);
- return;
+ return false;
}
actorGfx.mGraphNode->georef = georef;
@@ -76,6 +77,7 @@ void DynOS_Actor_AddCustom(s32 aModIndex, s32 aModFileIndex, const SysPath &aFil
// Add to list
DynOS_Actor_Valid(georef, actorGfx);
free(actorName);
+ return true;
}
const void *DynOS_Actor_GetLayoutFromName(const char *aActorName) {
@@ -115,6 +117,13 @@ const void *DynOS_Actor_GetLayoutFromName(const char *aActorName) {
}
}
+ // check modfs file
+ if (is_mod_fs_file(aActorName)) {
+ if (DynOS_Actor_AddCustom(gLuaActiveMod->index, -1, aActorName, aActorName)) {
+ return DynOS_Actor_GetLayoutFromName(aActorName);
+ }
+ }
+
return NULL;
}
@@ -222,7 +231,6 @@ void DynOS_Actor_Override(struct Object* obj, void** aSharedChild) {
}
}
-
*aSharedChild = (void*)it->second.mGraphNode;
}
diff --git a/data/dynos_mgr_col.cpp b/data/dynos_mgr_col.cpp
index 9a6d5f4db..66bf497ae 100644
--- a/data/dynos_mgr_col.cpp
+++ b/data/dynos_mgr_col.cpp
@@ -1,17 +1,21 @@
#include "dynos.cpp.h"
+extern "C" {
+#include "pc/mods/mod_fs.h"
+}
+
static Array*>>& DynosCollisions() {
static Array*>> sDynosCollisions;
return sDynosCollisions;
}
-void DynOS_Col_Activate(const SysPath &aFilename, const char *aCollisionName) {
+bool DynOS_Col_Activate(const SysPath &aFilename, const char *aCollisionName) {
auto& _DynosCollisions = DynosCollisions();
// check for duplicates
for (s32 i = 0; i < _DynosCollisions.Count(); ++i) {
if (!strcmp(_DynosCollisions[i].first, aCollisionName)) {
- return;
+ return true;
}
}
@@ -24,11 +28,12 @@ void DynOS_Col_Activate(const SysPath &aFilename, const char *aCollisionName) {
DataNode* _Node = DynOS_Col_LoadFromBinary(aFilename, collisionName);
if (!_Node) {
free(collisionName);
- return;
+ return false;
}
// Add to collisions
_DynosCollisions.Add({ collisionName, _Node });
+ return true;
}
Collision* DynOS_Col_Get(const char* collisionName) {
@@ -51,6 +56,13 @@ Collision* DynOS_Col_Get(const char* collisionName) {
}
}
+ // check modfs file
+ if (is_mod_fs_file(collisionName)) {
+ if (DynOS_Col_Activate(collisionName, collisionName)) {
+ return DynOS_Col_Get(collisionName);
+ }
+ }
+
// check builtin collisions
return (Collision*)DynOS_Builtin_Col_GetFromName(collisionName);
}
diff --git a/data/dynos_mgr_tex.cpp b/data/dynos_mgr_tex.cpp
index 799af9ac9..5bc3bceb6 100644
--- a/data/dynos_mgr_tex.cpp
+++ b/data/dynos_mgr_tex.cpp
@@ -4,6 +4,7 @@
extern "C" {
#include "pc/gfx/gfx.h"
#include "pc/gfx/gfx_rendering_api.h"
+#include "pc/mods/mod_fs.h"
}
struct OverrideTexture {
@@ -423,13 +424,13 @@ void DynOS_Tex_Deactivate(DataNode* aNode) {
_Schedule.Add(aNode);
}
-void DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName) {
+bool DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName) {
auto& _DynosCustomTexs = DynosCustomTexs();
// check for duplicates
for (s32 i = 0; i < _DynosCustomTexs.Count(); ++i) {
if (!strcmp(_DynosCustomTexs[i].first, aTexName)) {
- return;
+ return true;
}
}
@@ -444,7 +445,9 @@ void DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName) {
free(_TexName);
if (_Node) {
DynOS_Tex_Activate(_Node, true);
+ return true;
}
+ return false;
}
#define CONVERT_TEXINFO(texName) { \
@@ -488,6 +491,13 @@ bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
}
}
+ // check modfs file
+ if (is_mod_fs_file(aTexName)) {
+ if (DynOS_Tex_AddCustom(aTexName, aTexName)) {
+ return DynOS_Tex_Get(aTexName, aOutTexInfo);
+ }
+ }
+
// check builtin textures
const struct BuiltinTexInfo* info = DynOS_Builtin_Tex_GetInfoFromName(aTexName);
if (!info) {
diff --git a/developer/dir2modfs.py b/developer/dir2modfs.py
deleted file mode 100644
index af41a2abd..000000000
--- a/developer/dir2modfs.py
+++ /dev/null
@@ -1,190 +0,0 @@
-import os, sys, re
-
-
-MOD_FS_MAGIC = "MODFSSM64COOPDX"
-MOD_FS_HEADER_SIZE = 32
-MOD_FS_EXTENSION = ".modfs"
-MOD_FS_VERSION = 1
-MOD_FS_MAX_SIZE = 0x1000000
-MOD_FS_MAX_FILES = 0x100
-MOD_FS_MAX_PATH = 0x100
-
-
-def usage():
- print("""
-Directory to modfs:
-
- python dir2modfs.py [--set-public] [--set-file-public ...]
-
- Parameters:
- dirpath Path to directory to turn into a .modfs file
-
- Options:
- --set-public Set modfs file as public (readable by other mods)
- --set-file-public Set the provided files as public (readable by other mods)
-
-modfs to directory:
-
- python dir2modfs.py --extract
-
- Parameters:
- filepath Path to modfs file to extract files from
-""")
- exit(0)
-
-
-def is_binary_file(bytes: bytes):
- textchars = bytearray({0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0D, 0x1B} | set(range(0x20, 0x100)) - {0x7F})
- return bool(bytes.translate(None, textchars))
-
-
-def get_files(dirpath: str, public_files: list):
- files = []
- for root, _, filenames in os.walk(dirpath):
- for filename in filenames:
- relpath = os.path.join(root, filename)
- filepath = relpath.removeprefix(dirpath).strip("/\\").replace('\\', '/')
- is_public = False
- for public_file in public_files:
- if re.match(public_file, relpath) or re.match(public_file, filepath):
- is_public = True
- break
- files.append({
- "relpath": relpath,
- "filepath": filepath,
- "is_public": is_public,
- "is_text": False,
- "data": None
- })
- return files
-
-
-def convert(dirpath: str, set_public: bool, public_files: list):
- dirpath = dirpath.rstrip("/\\")
- files = sorted(get_files(dirpath, public_files), key=lambda file: file["filepath"])
- if len(files) > MOD_FS_MAX_FILES:
- raise Exception(f"Max number of files exceeded: {len(files)} (max is: {MOD_FS_MAX_FILES})")
-
- total_size = 0
- for file in files:
- filepath = file["filepath"]
- if len(filepath) >= MOD_FS_MAX_PATH:
- raise Exception(f"{filepath} - Exceeded filepath length: {len(filepath)} (max is: {MOD_FS_MAX_PATH-1})")
-
- with open(file["relpath"], "rb") as f:
- data = f.read()
- total_size += len(data)
- if total_size > MOD_FS_MAX_SIZE:
- raise Exception(f"{filepath} - Total size exceeded: {total_size} (max is: {MOD_FS_MAX_SIZE})")
-
- file["data"] = data
- file["is_text"] = not is_binary_file(data)
-
- # write file
- destpath = dirpath + MOD_FS_EXTENSION
- with open(destpath, "wb") as f:
-
- # magic + version
- f.write(MOD_FS_MAGIC.encode())
- f.write(MOD_FS_VERSION.to_bytes(1, byteorder="little", signed=False))
-
- # header
- f.write(len(files).to_bytes(2, byteorder="little", signed=False))
- f.write(set_public.to_bytes(1, byteorder="little", signed=False))
-
- # padding (empty space for future versions)
- padding = MOD_FS_HEADER_SIZE - f.tell()
- f.write(b'\0' * padding)
-
- # files
- for file in files:
-
- # filepath
- f.write(len(file["filepath"]).to_bytes(2, byteorder="little", signed=False))
- f.write(file["filepath"].encode())
-
- # data
- f.write(len(file["data"]).to_bytes(4, byteorder="little", signed=False))
- f.write(file["is_public"].to_bytes(1, byteorder="little", signed=False))
- f.write(file["is_text"].to_bytes(1, byteorder="little", signed=False))
- f.write(file["data"])
-
- # summary
- print("")
- print(f"Directory: {dirpath}")
- print(f"Num files: {len(files)}")
- print(f"Total size: {total_size}")
- print(f"Is public: {set_public}")
-
- filepaths_max = max(8, len(max([file["filepath"] for file in files], key=len)))
- sizes_max = max(4, len(max([str(len(file["data"])) for file in files], key=len)))
- print("")
- print(f"{'FILEPATH'.ljust(filepaths_max)} {'SIZE'.rjust(sizes_max)} {'TEXT'.rjust(5)} {'PUBLIC'.rjust(6)}")
- print(f"{'--------'.ljust(filepaths_max)} {'----'.rjust(sizes_max)} {'----'.rjust(5)} {'------'.rjust(6)}")
- for file in files:
- filepath = file["filepath"]
- size = str(len(file["data"]))
- is_text = str(file["is_text"])
- is_public = str(file["is_public"])
- print(f"{filepath.ljust(filepaths_max)} {size.rjust(sizes_max)} {is_text.rjust(5)} {is_public.rjust(6)}")
-
-
-def extract(filepath: str):
- if not filepath.endswith(MOD_FS_EXTENSION):
- raise Exception("Not a modfs file")
-
- with open(filepath, "rb") as f:
-
- # magic + version
- magic = f.read(len(MOD_FS_MAGIC)).decode()
- if magic != MOD_FS_MAGIC:
- raise Exception("Not a modfs file")
- version = int.from_bytes(f.read(1), byteorder="little", signed=False)
- if version != MOD_FS_VERSION:
- raise Exception("Version mismatch")
-
- # header
- num_files = int.from_bytes(f.read(2), byteorder="little", signed=False)
- is_public = bool.from_bytes(f.read(1), byteorder="little", signed=False)
-
- # padding (empty space for future versions)
- f.seek(MOD_FS_HEADER_SIZE, 0)
-
- # create directory
- dirpath = filepath.removesuffix(MOD_FS_EXTENSION)
- os.makedirs(dirpath, exist_ok=True)
-
- # files
- for _ in range(num_files):
-
- # filepath
- filepath_len = int.from_bytes(f.read(2), byteorder="little", signed=False)
- filepath = os.path.join(dirpath, f.read(filepath_len).decode())
-
- # data
- file_size = int.from_bytes(f.read(4), byteorder="little", signed=False)
- file_is_public = bool.from_bytes(f.read(1), byteorder="little", signed=False)
- file_is_text = bool.from_bytes(f.read(1), byteorder="little", signed=False)
- file_data = f.read(file_size)
-
- # write file
- os.makedirs(os.path.dirname(filepath), exist_ok=True)
- with open(filepath, "wb") as g:
- g.write(file_data)
- print(f"Extracted file of size {file_size} to: {filepath}")
-
-
-def main(argc: int, argv: list):
- if argc < 2:
- usage()
-
- if "--extract" in argv:
- extract(argv[1])
- else:
- set_public = "--set-public" in argv
- set_file_public_index = argv.index("--set-file-public") if "--set-file-public" in argv else argc
- convert(argv[1], set_public, argv[set_file_public_index+1:])
-
-
-if __name__ == "__main__":
- main(len(sys.argv), sys.argv)
diff --git a/docs/lua/constants.md b/docs/lua/constants.md
index 2a9b5aecf..5c834b889 100644
--- a/docs/lua/constants.md
+++ b/docs/lua/constants.md
@@ -2144,6 +2144,8 @@
- MOD_FS_MAX_SIZE
- MOD_FS_MAX_FILES
- MOD_FS_MAX_PATH
+- MOD_FS_URI_PREFIX
+- MOD_FS_URI_FORMAT
### [enum ModFsFileIntType](#ModFsFileIntType)
| Identifier | Value |
@@ -2970,6 +2972,7 @@
## [player_palette.h](#player_palette.h)
+- PALETTES_DIRECTORY
- MAX_PRESET_PALETTES
### [enum PlayerPart](#PlayerPart)
@@ -4722,6 +4725,12 @@
- VERSION_TEXT
- VERSION_NUMBER
- MINOR_VERSION_NUMBER
+- GAME_NAME
+- WINDOW_NAME
+- GAME_NAME
+- WINDOW_NAME
+- GAME_NAME
+- WINDOW_NAME
- MAX_VERSION_LENGTH
[:arrow_up_small:](#)
diff --git a/docs/lua/functions-5.md b/docs/lua/functions-5.md
index 53f109eba..a3ff14601 100644
--- a/docs/lua/functions-5.md
+++ b/docs/lua/functions-5.md
@@ -342,71 +342,6 @@ Creates a modfs object for the active mod if it doesn't exist. Returns the modfs
-## [mod_fs_delete](#mod_fs_delete)
-
-### Description
-Deletes the modfs object of the active mod if it exists. Returns true on success
-
-### Lua Example
-`local booleanValue = mod_fs_delete()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool mod_fs_delete();`
-
-[:arrow_up_small:](#)
-
-
-
-## [mod_fs_save](#mod_fs_save)
-
-### Description
-Saves the modfs object of the active mod if it exists. Returns true on success
-
-### Lua Example
-`local booleanValue = mod_fs_save()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool mod_fs_save();`
-
-[:arrow_up_small:](#)
-
-
-
-## [mod_fs_set_public](#mod_fs_set_public)
-
-### Description
-Marks the modfs object of the active mod as public (i.e. readable by other mods) if it exists. Returns true on success
-
-### Lua Example
-`local booleanValue = mod_fs_set_public(pub)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| pub | `boolean` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool mod_fs_set_public(bool pub);`
-
-[:arrow_up_small:](#)
-
-
-
## [mod_fs_get_filename](#mod_fs_get_filename)
### Description
@@ -579,6 +514,76 @@ Deletes all files of the provided `modFs`. Returns true on success
+## [mod_fs_save](#mod_fs_save)
+
+### Description
+Saves the provided `modFs` to persistent storage. Returns true on success
+
+### Lua Example
+`local booleanValue = mod_fs_save(modFs)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| modFs | [ModFs](structs.md#ModFs) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_fs_save(struct ModFs *modFs);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mod_fs_delete](#mod_fs_delete)
+
+### Description
+Removes the provided `modFs` from persistent storage and deletes its object. Returns true on success
+
+### Lua Example
+`local booleanValue = mod_fs_delete(modFs)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| modFs | [ModFs](structs.md#ModFs) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_fs_delete(struct ModFs *modFs);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mod_fs_set_public](#mod_fs_set_public)
+
+### Description
+Marks the provided `modFs` as public (i.e. readable by other mods). Returns true on success
+
+### Lua Example
+`local booleanValue = mod_fs_set_public(modFs, pub)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| modFs | [ModFs](structs.md#ModFs) |
+| pub | `boolean` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_fs_set_public(struct ModFs *modFs, bool pub);`
+
+[:arrow_up_small:](#)
+
+
+
## [mod_fs_file_read_bool](#mod_fs_file_read_bool)
### Description
@@ -891,6 +896,29 @@ Sets the current position of a modfs `file`. If `origin` is `FILE_SEEK_SET`, fil
+## [mod_fs_file_rewind](#mod_fs_file_rewind)
+
+### Description
+Sets the current position of a modfs `file` to its beginning. Returns true on success
+
+### Lua Example
+`local booleanValue = mod_fs_file_rewind(file)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| file | [ModFsFile](structs.md#ModFsFile) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_fs_file_rewind(struct ModFsFile *file);`
+
+[:arrow_up_small:](#)
+
+
+
## [mod_fs_file_is_eof](#mod_fs_file_is_eof)
### Description
@@ -963,6 +991,30 @@ Erases `length` bytes or characters from a modfs `file`. Returns true on success
+## [mod_fs_file_set_text_mode](#mod_fs_file_set_text_mode)
+
+### Description
+Marks the provided modfs `file` as text. Returns true on success
+
+### Lua Example
+`local booleanValue = mod_fs_file_set_text_mode(file, text)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| file | [ModFsFile](structs.md#ModFsFile) |
+| text | `boolean` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_fs_file_set_text_mode(struct ModFsFile *file, bool text);`
+
+[:arrow_up_small:](#)
+
+
+
## [mod_fs_file_set_public](#mod_fs_file_set_public)
### Description
@@ -1178,6 +1230,27 @@ Loads a bool `value` from a `key` in mod storage
+## [mod_storage_load_all](#mod_storage_load_all)
+
+### Description
+Loads all keys and values in mod storage as strings and returns them as a table
+
+### Lua Example
+`local tableValue = mod_storage_load_all()`
+
+### Parameters
+- None
+
+### Returns
+- `table`
+
+### C Prototype
+`LuaTable mod_storage_load_all(void);`
+
+[:arrow_up_small:](#)
+
+
+
## [mod_storage_exists](#mod_storage_exists)
### Description
@@ -3625,4584 +3698,6 @@ Moves the current object for specifically one second (`oTimer` < 30)
[:arrow_up_small:](#)
-
-
----
-# functions from object_helpers.c
-
-
-
-
-## [clear_move_flag](#clear_move_flag)
-
-### Lua Example
-`local integerValue = clear_move_flag(bitSet, flag)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| bitSet | `Pointer` <`integer`> |
-| flag | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 clear_move_flag(u32 *bitSet, s32 flag);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_room_override](#set_room_override)
-
-### Description
-Overrides the current room Mario is in. Set to -1 to reset override
-
-### Lua Example
-`set_room_override(room)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| room | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_room_override(s16 room);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_update_pos_from_parent_transformation](#obj_update_pos_from_parent_transformation)
-
-### Lua Example
-`obj_update_pos_from_parent_transformation(a0, a1)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | [Mat4](structs.md#Mat4) |
-| a1 | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_apply_scale_to_matrix](#obj_apply_scale_to_matrix)
-
-### Lua Example
-`obj_apply_scale_to_matrix(obj, dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| dst | [Mat4](structs.md#Mat4) |
-| src | [Mat4](structs.md#Mat4) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_apply_scale_to_matrix(struct Object *obj, OUT Mat4 dst, Mat4 src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [create_transformation_from_matrices](#create_transformation_from_matrices)
-
-### Lua Example
-`create_transformation_from_matrices(a0, a1, a2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | [Mat4](structs.md#Mat4) |
-| a1 | [Mat4](structs.md#Mat4) |
-| a2 | [Mat4](structs.md#Mat4) |
-
-### Returns
-- None
-
-### C Prototype
-`void create_transformation_from_matrices(OUT Mat4 a0, Mat4 a1, Mat4 a2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_held_state](#obj_set_held_state)
-
-### Lua Example
-`obj_set_held_state(obj, heldBehavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| heldBehavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [lateral_dist_between_objects](#lateral_dist_between_objects)
-
-### Lua Example
-`local numberValue = lateral_dist_between_objects(obj1, obj2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj1 | [Object](structs.md#Object) |
-| obj2 | [Object](structs.md#Object) |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 lateral_dist_between_objects(struct Object *obj1, struct Object *obj2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [dist_between_objects](#dist_between_objects)
-
-### Lua Example
-`local numberValue = dist_between_objects(obj1, obj2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj1 | [Object](structs.md#Object) |
-| obj2 | [Object](structs.md#Object) |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 dist_between_objects(struct Object *obj1, struct Object *obj2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [dist_between_object_and_point](#dist_between_object_and_point)
-
-### Lua Example
-`local numberValue = dist_between_object_and_point(obj, pointX, pointY, pointZ)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pointX | `number` |
-| pointY | `number` |
-| pointZ | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 dist_between_object_and_point(struct Object *obj, f32 pointX, f32 pointY, f32 pointZ);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_forward_vel_approach_upward](#cur_obj_forward_vel_approach_upward)
-
-### Lua Example
-`cur_obj_forward_vel_approach_upward(target, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| target | `number` |
-| increment | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_forward_vel_approach_upward(f32 target, f32 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [approach_f32_signed](#approach_f32_signed)
-
-### Lua Example
-`local integerValue = approach_f32_signed(value, target, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `Pointer` <`number`> |
-| target | `number` |
-| increment | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 approach_f32_signed(f32 *value, f32 target, f32 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [approach_f32_symmetric](#approach_f32_symmetric)
-
-### Lua Example
-`local numberValue = approach_f32_symmetric(value, target, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `number` |
-| target | `number` |
-| increment | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 approach_f32_symmetric(f32 value, f32 target, f32 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [approach_s16_symmetric](#approach_s16_symmetric)
-
-### Lua Example
-`local integerValue = approach_s16_symmetric(value, target, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `integer` |
-| target | `integer` |
-| increment | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 approach_s16_symmetric(s16 value, s16 target, s16 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_rotate_yaw_toward](#cur_obj_rotate_yaw_toward)
-
-### Lua Example
-`local integerValue = cur_obj_rotate_yaw_toward(target, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| target | `integer` |
-| increment | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_rotate_yaw_toward(s16 target, s16 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_angle_to_object](#obj_angle_to_object)
-
-### Lua Example
-`local integerValue = obj_angle_to_object(obj1, obj2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj1 | [Object](structs.md#Object) |
-| obj2 | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_pitch_to_object](#obj_pitch_to_object)
-
-### Lua Example
-`local integerValue = obj_pitch_to_object(obj, target)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| target | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_pitch_to_object(struct Object* obj, struct Object* target);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_angle_to_point](#obj_angle_to_point)
-
-### Lua Example
-`local integerValue = obj_angle_to_point(obj, pointX, pointZ)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pointX | `number` |
-| pointZ | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_angle_to_point(struct Object *obj, f32 pointX, f32 pointZ);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_turn_toward_object](#obj_turn_toward_object)
-
-### Lua Example
-`local integerValue = obj_turn_toward_object(obj, target, angleIndex, turnAmount)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| target | [Object](structs.md#Object) |
-| angleIndex | `integer` |
-| turnAmount | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_parent_relative_pos](#obj_set_parent_relative_pos)
-
-### Lua Example
-`obj_set_parent_relative_pos(obj, relX, relY, relZ)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| relX | `integer` |
-| relY | `integer` |
-| relZ | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_pos](#obj_set_pos)
-
-### Lua Example
-`obj_set_pos(obj, x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| x | `integer` |
-| y | `integer` |
-| z | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_pos(struct Object *obj, s16 x, s16 y, s16 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_angle](#obj_set_angle)
-
-### Lua Example
-`obj_set_angle(obj, pitch, yaw, roll)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pitch | `integer` |
-| yaw | `integer` |
-| roll | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_move_angle](#obj_set_move_angle)
-
-### Lua Example
-`obj_set_move_angle(obj, pitch, yaw, roll)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pitch | `integer` |
-| yaw | `integer` |
-| roll | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_move_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_face_angle](#obj_set_face_angle)
-
-### Lua Example
-`obj_set_face_angle(obj, pitch, yaw, roll)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pitch | `integer` |
-| yaw | `integer` |
-| roll | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_face_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_gfx_angle](#obj_set_gfx_angle)
-
-### Lua Example
-`obj_set_gfx_angle(obj, pitch, yaw, roll)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| pitch | `integer` |
-| yaw | `integer` |
-| roll | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_gfx_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_gfx_pos](#obj_set_gfx_pos)
-
-### Lua Example
-`obj_set_gfx_pos(obj, x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_gfx_pos(struct Object *obj, f32 x, f32 y, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_gfx_scale](#obj_set_gfx_scale)
-
-### Lua Example
-`obj_set_gfx_scale(obj, x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_gfx_scale(struct Object *obj, f32 x, f32 y, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_water_droplet](#spawn_water_droplet)
-
-### Lua Example
-`local ObjectValue = spawn_water_droplet(parent, params)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| parent | [Object](structs.md#Object) |
-| params | [WaterDropletParams](structs.md#WaterDropletParams) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_build_relative_transform](#obj_build_relative_transform)
-
-### Lua Example
-`obj_build_relative_transform(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_build_relative_transform(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_using_vel](#cur_obj_move_using_vel)
-
-### Lua Example
-`cur_obj_move_using_vel()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_using_vel(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_graph_y_offset](#obj_copy_graph_y_offset)
-
-### Lua Example
-`obj_copy_graph_y_offset(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_graph_y_offset(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_pos_and_angle](#obj_copy_pos_and_angle)
-
-### Lua Example
-`obj_copy_pos_and_angle(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_pos_and_angle(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_pos](#obj_copy_pos)
-
-### Lua Example
-`obj_copy_pos(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_pos(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_angle](#obj_copy_angle)
-
-### Lua Example
-`obj_copy_angle(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_angle(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_gfx_pos_from_pos](#obj_set_gfx_pos_from_pos)
-
-### Lua Example
-`obj_set_gfx_pos_from_pos(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_gfx_pos_from_pos(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_init_animation](#obj_init_animation)
-
-### Lua Example
-`obj_init_animation(obj, animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| animIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_init_animation(struct Object *obj, s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [linear_mtxf_mul_vec3f](#linear_mtxf_mul_vec3f)
-
-### Description
-Multiplies a vector by a matrix of the form: `| ? ? ? 0 |` `| ? ? ? 0 |` `| ? ? ? 0 |` `| 0 0 0 1 |` i.e. a matrix representing a linear transformation over 3 space
-
-### Lua Example
-`linear_mtxf_mul_vec3f(m, dst, v)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [Mat4](structs.md#Mat4) |
-| dst | [Vec3f](structs.md#Vec3f) |
-| v | [Vec3f](structs.md#Vec3f) |
-
-### Returns
-- None
-
-### C Prototype
-`void linear_mtxf_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);`
-
-[:arrow_up_small:](#)
-
-
-
-## [linear_mtxf_transpose_mul_vec3f](#linear_mtxf_transpose_mul_vec3f)
-
-### Description
-Multiplies a vector by the transpose of a matrix of the form: `| ? ? ? 0 |` `| ? ? ? 0 |` `| ? ? ? 0 |` `| 0 0 0 1 |` i.e. a matrix representing a linear transformation over 3 space
-
-### Lua Example
-`linear_mtxf_transpose_mul_vec3f(m, dst, v)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [Mat4](structs.md#Mat4) |
-| dst | [Vec3f](structs.md#Vec3f) |
-| v | [Vec3f](structs.md#Vec3f) |
-
-### Returns
-- None
-
-### C Prototype
-`void linear_mtxf_transpose_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_apply_scale_to_transform](#obj_apply_scale_to_transform)
-
-### Lua Example
-`obj_apply_scale_to_transform(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_apply_scale_to_transform(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_scale](#obj_copy_scale)
-
-### Lua Example
-`obj_copy_scale(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_scale(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_scale_xyz](#obj_scale_xyz)
-
-### Lua Example
-`obj_scale_xyz(obj, xScale, yScale, zScale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| xScale | `number` |
-| yScale | `number` |
-| zScale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_scale_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_scale](#obj_scale)
-
-### Lua Example
-`obj_scale(obj, scale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| scale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_scale(struct Object *obj, f32 scale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_scale](#cur_obj_scale)
-
-### Lua Example
-`cur_obj_scale(scale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| scale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_scale(f32 scale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation](#cur_obj_init_animation)
-
-### Lua Example
-`cur_obj_init_animation(animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_animation(s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation_with_sound](#cur_obj_init_animation_with_sound)
-
-### Lua Example
-`cur_obj_init_animation_with_sound(animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_animation_with_sound(s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_init_animation_with_accel_and_sound](#obj_init_animation_with_accel_and_sound)
-
-### Lua Example
-`obj_init_animation_with_accel_and_sound(obj, animIndex, accel)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| animIndex | `integer` |
-| accel | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_init_animation_with_accel_and_sound(struct Object *obj, s32 animIndex, f32 accel);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation_with_accel_and_sound](#cur_obj_init_animation_with_accel_and_sound)
-
-### Lua Example
-`cur_obj_init_animation_with_accel_and_sound(animIndex, accel)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-| accel | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_animation_with_accel_and_sound(s32 animIndex, f32 accel);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_init_animation_with_sound](#obj_init_animation_with_sound)
-
-### Lua Example
-`obj_init_animation_with_sound(obj, animations, animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| animations | [AnimationTable](structs.md#AnimationTable) |
-| animIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_init_animation_with_sound(struct Object *obj, const struct AnimationTable* animations, s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_enable_rendering_and_become_tangible](#cur_obj_enable_rendering_and_become_tangible)
-
-### Lua Example
-`cur_obj_enable_rendering_and_become_tangible(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_enable_rendering_and_become_tangible(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_enable_rendering](#cur_obj_enable_rendering)
-
-### Lua Example
-`cur_obj_enable_rendering()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_enable_rendering(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_disable_rendering_and_become_intangible](#cur_obj_disable_rendering_and_become_intangible)
-
-### Lua Example
-`cur_obj_disable_rendering_and_become_intangible(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_disable_rendering_and_become_intangible(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_disable_rendering](#cur_obj_disable_rendering)
-
-### Lua Example
-`cur_obj_disable_rendering()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_disable_rendering(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_unhide](#cur_obj_unhide)
-
-### Lua Example
-`cur_obj_unhide()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_unhide(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_hide](#cur_obj_hide)
-
-### Lua Example
-`cur_obj_hide()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_hide(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_relative](#cur_obj_set_pos_relative)
-
-### Lua Example
-`cur_obj_set_pos_relative(other, dleft, dy, dforward)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| other | [Object](structs.md#Object) |
-| dleft | `number` |
-| dy | `number` |
-| dforward | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_relative_to_parent](#cur_obj_set_pos_relative_to_parent)
-
-### Lua Example
-`cur_obj_set_pos_relative_to_parent(dleft, dy, dforward)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dleft | `number` |
-| dy | `number` |
-| dforward | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_relative_to_parent(f32 dleft, f32 dy, f32 dforward);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_enable_rendering_2](#cur_obj_enable_rendering_2)
-
-### Lua Example
-`cur_obj_enable_rendering_2()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_enable_rendering_2(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_unused_init_on_floor](#cur_obj_unused_init_on_floor)
-
-### Lua Example
-`cur_obj_unused_init_on_floor()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_unused_init_on_floor(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_face_angle_to_move_angle](#obj_set_face_angle_to_move_angle)
-
-### Lua Example
-`obj_set_face_angle_to_move_angle(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_face_angle_to_move_angle(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_object_list_from_behavior](#get_object_list_from_behavior)
-
-### Lua Example
-`local integerValue = get_object_list_from_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`u32 get_object_list_from_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_nearest_object_with_behavior](#cur_obj_nearest_object_with_behavior)
-
-### Lua Example
-`local ObjectValue = cur_obj_nearest_object_with_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_dist_to_nearest_object_with_behavior](#cur_obj_dist_to_nearest_object_with_behavior)
-
-### Lua Example
-`local numberValue = cur_obj_dist_to_nearest_object_with_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_find_nearest_pole](#cur_obj_find_nearest_pole)
-
-### Lua Example
-`local ObjectValue = cur_obj_find_nearest_pole()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object* cur_obj_find_nearest_pole(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_find_nearest_object_with_behavior](#cur_obj_find_nearest_object_with_behavior)
-
-### Lua Example
-`local ObjectValue = cur_obj_find_nearest_object_with_behavior(behavior, dist)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-| dist | `Pointer` <`number`> |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_count_objects_with_behavior](#cur_obj_count_objects_with_behavior)
-
-### Lua Example
-`local integerValue = cur_obj_count_objects_with_behavior(behavior, dist)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-| dist | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`u16 cur_obj_count_objects_with_behavior(const BehaviorScript* behavior, f32 dist);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_unimportant_object](#find_unimportant_object)
-
-### Lua Example
-`local ObjectValue = find_unimportant_object()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *find_unimportant_object(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [count_unimportant_objects](#count_unimportant_objects)
-
-### Lua Example
-`local integerValue = count_unimportant_objects()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 count_unimportant_objects(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [count_objects_with_behavior](#count_objects_with_behavior)
-
-### Lua Example
-`local integerValue = count_objects_with_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 count_objects_with_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_object_with_behavior](#find_object_with_behavior)
-
-### Lua Example
-`local ObjectValue = find_object_with_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *find_object_with_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_find_nearby_held_actor](#cur_obj_find_nearby_held_actor)
-
-### Lua Example
-`local ObjectValue = cur_obj_find_nearby_held_actor(behavior, maxDist)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-| maxDist | `number` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_reset_timer_and_subaction](#cur_obj_reset_timer_and_subaction)
-
-### Lua Example
-`cur_obj_reset_timer_and_subaction()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_reset_timer_and_subaction(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_change_action](#cur_obj_change_action)
-
-### Lua Example
-`cur_obj_change_action(action)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| action | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_change_action(s32 action);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_vel_from_mario_vel](#cur_obj_set_vel_from_mario_vel)
-
-### Lua Example
-`cur_obj_set_vel_from_mario_vel(m, f12, f14)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| f12 | `number` |
-| f14 | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_vel_from_mario_vel(struct MarioState* m, f32 f12, f32 f14);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_reverse_animation](#cur_obj_reverse_animation)
-
-### Lua Example
-`cur_obj_reverse_animation()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_reverse_animation(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_extend_animation_if_at_end](#cur_obj_extend_animation_if_at_end)
-
-### Lua Example
-`cur_obj_extend_animation_if_at_end()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_extend_animation_if_at_end(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_if_near_animation_end](#cur_obj_check_if_near_animation_end)
-
-### Lua Example
-`local integerValue = cur_obj_check_if_near_animation_end()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_if_near_animation_end(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_if_at_animation_end](#cur_obj_check_if_at_animation_end)
-
-### Lua Example
-`local integerValue = cur_obj_check_if_at_animation_end()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_if_at_animation_end(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_anim_frame](#cur_obj_check_anim_frame)
-
-### Lua Example
-`local integerValue = cur_obj_check_anim_frame(frame)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| frame | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_anim_frame(s32 frame);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_anim_frame_in_range](#cur_obj_check_anim_frame_in_range)
-
-### Lua Example
-`local integerValue = cur_obj_check_anim_frame_in_range(startFrame, rangeLength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| startFrame | `integer` |
-| rangeLength | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_frame_prior_current_frame](#cur_obj_check_frame_prior_current_frame)
-
-### Lua Example
-`local integerValue = cur_obj_check_frame_prior_current_frame(a0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_frame_prior_current_frame(s16 *a0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [mario_is_in_air_action](#mario_is_in_air_action)
-
-### Lua Example
-`local integerValue = mario_is_in_air_action(m)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 mario_is_in_air_action(struct MarioState* m);`
-
-[:arrow_up_small:](#)
-
-
-
-## [mario_is_dive_sliding](#mario_is_dive_sliding)
-
-### Lua Example
-`local integerValue = mario_is_dive_sliding(m)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 mario_is_dive_sliding(struct MarioState* m);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_y_vel_and_animation](#cur_obj_set_y_vel_and_animation)
-
-### Lua Example
-`cur_obj_set_y_vel_and_animation(sp18, sp1C)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp18 | `number` |
-| sp1C | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_y_vel_and_animation(f32 sp18, s32 sp1C);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_unrender_and_reset_state](#cur_obj_unrender_and_reset_state)
-
-### Lua Example
-`cur_obj_unrender_and_reset_state(sp18, sp1C)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp18 | `integer` |
-| sp1C | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_unrender_and_reset_state(s32 sp18, s32 sp1C);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_after_thrown_or_dropped](#cur_obj_move_after_thrown_or_dropped)
-
-### Lua Example
-`cur_obj_move_after_thrown_or_dropped(forwardVel, velY)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| forwardVel | `number` |
-| velY | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_get_thrown_or_placed](#cur_obj_get_thrown_or_placed)
-
-### Lua Example
-`cur_obj_get_thrown_or_placed(forwardVel, velY, thrownAction)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| forwardVel | `number` |
-| velY | `number` |
-| thrownAction | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_get_dropped](#cur_obj_get_dropped)
-
-### Lua Example
-`cur_obj_get_dropped()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_get_dropped(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [mario_set_flag](#mario_set_flag)
-
-### Lua Example
-`mario_set_flag(flag)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| flag | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void mario_set_flag(s32 flag);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_clear_interact_status_flag](#cur_obj_clear_interact_status_flag)
-
-### Lua Example
-`local integerValue = cur_obj_clear_interact_status_flag(flag)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| flag | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_clear_interact_status_flag(s32 flag);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_mark_for_deletion](#obj_mark_for_deletion)
-
-### Description
-Marks an object to be unloaded at the end of the frame
-
-### Lua Example
-`obj_mark_for_deletion(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_mark_for_deletion(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_disable](#cur_obj_disable)
-
-### Lua Example
-`cur_obj_disable()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_disable(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_become_intangible](#cur_obj_become_intangible)
-
-### Lua Example
-`cur_obj_become_intangible()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_become_intangible(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_become_tangible](#cur_obj_become_tangible)
-
-### Lua Example
-`cur_obj_become_tangible()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_become_tangible(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_become_tangible](#obj_become_tangible)
-
-### Lua Example
-`obj_become_tangible(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_become_tangible(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_update_floor_height](#cur_obj_update_floor_height)
-
-### Lua Example
-`cur_obj_update_floor_height()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_update_floor_height(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_update_floor_height_and_get_floor](#cur_obj_update_floor_height_and_get_floor)
-
-### Lua Example
-`local SurfaceValue = cur_obj_update_floor_height_and_get_floor()`
-
-### Parameters
-- None
-
-### Returns
-[Surface](structs.md#Surface)
-
-### C Prototype
-`struct Surface *cur_obj_update_floor_height_and_get_floor(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [apply_drag_to_value](#apply_drag_to_value)
-
-### Lua Example
-`apply_drag_to_value(value, dragStrength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `Pointer` <`number`> |
-| dragStrength | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void apply_drag_to_value(f32 *value, f32 dragStrength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_apply_drag_xz](#cur_obj_apply_drag_xz)
-
-### Lua Example
-`cur_obj_apply_drag_xz(dragStrength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dragStrength | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_apply_drag_xz(f32 dragStrength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_xz](#cur_obj_move_xz)
-
-### Lua Example
-`local integerValue = cur_obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| steepSlopeNormalY | `number` |
-| careAboutEdgesAndSteepSlopes | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_update_underwater_flags](#cur_obj_move_update_underwater_flags)
-
-### Lua Example
-`cur_obj_move_update_underwater_flags()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_update_underwater_flags(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_update_ground_air_flags](#cur_obj_move_update_ground_air_flags)
-
-### Lua Example
-`cur_obj_move_update_ground_air_flags(gravity, bounciness)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| gravity | `number` |
-| bounciness | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounciness);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_y_and_get_water_level](#cur_obj_move_y_and_get_water_level)
-
-### Lua Example
-`local numberValue = cur_obj_move_y_and_get_water_level(gravity, buoyancy)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| gravity | `number` |
-| buoyancy | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_y](#cur_obj_move_y)
-
-### Lua Example
-`cur_obj_move_y(gravity, bounciness, buoyancy)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| gravity | `number` |
-| bounciness | `number` |
-| buoyancy | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_unused_resolve_wall_collisions](#cur_obj_unused_resolve_wall_collisions)
-
-### Lua Example
-`cur_obj_unused_resolve_wall_collisions(offsetY, radius)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| offsetY | `number` |
-| radius | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius);`
-
-[:arrow_up_small:](#)
-
-
-
-## [abs_angle_diff](#abs_angle_diff)
-
-### Lua Example
-`local integerValue = abs_angle_diff(x0, x1)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x0 | `integer` |
-| x1 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 abs_angle_diff(s16 x0, s16 x1);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_xz_using_fvel_and_yaw](#cur_obj_move_xz_using_fvel_and_yaw)
-
-### Lua Example
-`cur_obj_move_xz_using_fvel_and_yaw()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_xz_using_fvel_and_yaw(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_y_with_terminal_vel](#cur_obj_move_y_with_terminal_vel)
-
-### Lua Example
-`cur_obj_move_y_with_terminal_vel()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_y_with_terminal_vel(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_compute_vel_xz](#cur_obj_compute_vel_xz)
-
-### Lua Example
-`cur_obj_compute_vel_xz()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_compute_vel_xz(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [increment_velocity_toward_range](#increment_velocity_toward_range)
-
-### Lua Example
-`local numberValue = increment_velocity_toward_range(value, center, zeroThreshold, increment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `number` |
-| center | `number` |
-| zeroThreshold | `number` |
-| increment | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 increment_velocity_toward_range(f32 value, f32 center, f32 zeroThreshold, f32 increment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_check_if_collided_with_object](#obj_check_if_collided_with_object)
-
-### Lua Example
-`local integerValue = obj_check_if_collided_with_object(obj1, obj2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj1 | [Object](structs.md#Object) |
-| obj2 | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_behavior](#cur_obj_set_behavior)
-
-### Lua Example
-`cur_obj_set_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_behavior](#obj_set_behavior)
-
-### Lua Example
-`obj_set_behavior(obj, behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_has_behavior](#cur_obj_has_behavior)
-
-### Lua Example
-`local integerValue = cur_obj_has_behavior(behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_has_behavior(const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_has_behavior](#obj_has_behavior)
-
-### Lua Example
-`local integerValue = obj_has_behavior(obj, behavior)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| behavior | `Pointer` <`BehaviorScript`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_lateral_dist_from_obj_to_home](#cur_obj_lateral_dist_from_obj_to_home)
-
-### Lua Example
-`local numberValue = cur_obj_lateral_dist_from_obj_to_home(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_lateral_dist_from_obj_to_home(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_lateral_dist_from_mario_to_home](#cur_obj_lateral_dist_from_mario_to_home)
-
-### Lua Example
-`local numberValue = cur_obj_lateral_dist_from_mario_to_home()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_lateral_dist_from_mario_to_home(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_lateral_dist_to_home](#cur_obj_lateral_dist_to_home)
-
-### Lua Example
-`local numberValue = cur_obj_lateral_dist_to_home()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_lateral_dist_to_home(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_outside_home_square](#cur_obj_outside_home_square)
-
-### Lua Example
-`local integerValue = cur_obj_outside_home_square(halfLength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| halfLength | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_outside_home_square(f32 halfLength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_outside_home_rectangle](#cur_obj_outside_home_rectangle)
-
-### Lua Example
-`local integerValue = cur_obj_outside_home_rectangle(minX, maxX, minZ, maxZ)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| minX | `number` |
-| maxX | `number` |
-| minZ | `number` |
-| maxZ | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_to_home](#cur_obj_set_pos_to_home)
-
-### Lua Example
-`cur_obj_set_pos_to_home()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_to_home(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_to_home_and_stop](#cur_obj_set_pos_to_home_and_stop)
-
-### Lua Example
-`cur_obj_set_pos_to_home_and_stop()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_to_home_and_stop(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_shake_y](#cur_obj_shake_y)
-
-### Lua Example
-`cur_obj_shake_y(amount)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| amount | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_shake_y(f32 amount);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_start_cam_event](#cur_obj_start_cam_event)
-
-### Lua Example
-`cur_obj_start_cam_event(obj, cameraEvent)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| cameraEvent | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_mario_interact_hoot_if_in_range](#set_mario_interact_hoot_if_in_range)
-
-### Lua Example
-`set_mario_interact_hoot_if_in_range(sp0, sp4, sp8)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp0 | `integer` |
-| sp4 | `integer` |
-| sp8 | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_mario_interact_hoot_if_in_range(UNUSED s32 sp0, UNUSED s32 sp4, f32 sp8);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_billboard](#obj_set_billboard)
-
-### Lua Example
-`obj_set_billboard(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_billboard(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_cylboard](#obj_set_cylboard)
-
-### Lua Example
-`obj_set_cylboard(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_cylboard(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_billboard_if_vanilla_cam](#cur_obj_set_billboard_if_vanilla_cam)
-
-### Lua Example
-`cur_obj_set_billboard_if_vanilla_cam()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_billboard_if_vanilla_cam(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_hitbox_radius_and_height](#obj_set_hitbox_radius_and_height)
-
-### Lua Example
-`obj_set_hitbox_radius_and_height(o, radius, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| radius | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_hitbox_radius_and_height(struct Object *o, f32 radius, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_hurtbox_radius_and_height](#obj_set_hurtbox_radius_and_height)
-
-### Lua Example
-`obj_set_hurtbox_radius_and_height(o, radius, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| radius | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_hurtbox_radius_and_height(struct Object *o, f32 radius, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_hitbox_radius_and_height](#cur_obj_set_hitbox_radius_and_height)
-
-### Lua Example
-`cur_obj_set_hitbox_radius_and_height(radius, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| radius | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_hitbox_radius_and_height(f32 radius, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_hurtbox_radius_and_height](#cur_obj_set_hurtbox_radius_and_height)
-
-### Lua Example
-`cur_obj_set_hurtbox_radius_and_height(radius, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| radius | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_spawn_loot_coins](#obj_spawn_loot_coins)
-
-### Lua Example
-`obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| numCoins | `integer` |
-| sp30 | `number` |
-| coinBehavior | `Pointer` <`BehaviorScript`> |
-| posJitter | `integer` |
-| model | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_spawn_loot_blue_coins](#obj_spawn_loot_blue_coins)
-
-### Lua Example
-`obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| numCoins | `integer` |
-| sp28 | `number` |
-| posJitter | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_spawn_loot_yellow_coins](#obj_spawn_loot_yellow_coins)
-
-### Lua Example
-`obj_spawn_loot_yellow_coins(obj, numCoins, sp28)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| numCoins | `integer` |
-| sp28 | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_spawn_loot_coin_at_mario_pos](#cur_obj_spawn_loot_coin_at_mario_pos)
-
-### Lua Example
-`cur_obj_spawn_loot_coin_at_mario_pos(m)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_spawn_loot_coin_at_mario_pos(struct MarioState* m);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_abs_y_dist_to_home](#cur_obj_abs_y_dist_to_home)
-
-### Lua Example
-`local numberValue = cur_obj_abs_y_dist_to_home()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 cur_obj_abs_y_dist_to_home(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_advance_looping_anim](#cur_obj_advance_looping_anim)
-
-### Lua Example
-`local integerValue = cur_obj_advance_looping_anim()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_advance_looping_anim(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_detect_steep_floor](#cur_obj_detect_steep_floor)
-
-### Lua Example
-`local integerValue = cur_obj_detect_steep_floor(steepAngleDegrees)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| steepAngleDegrees | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_resolve_wall_collisions](#cur_obj_resolve_wall_collisions)
-
-### Lua Example
-`local integerValue = cur_obj_resolve_wall_collisions()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_resolve_wall_collisions(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_update_floor](#cur_obj_update_floor)
-
-### Lua Example
-`cur_obj_update_floor()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_update_floor(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_update_floor_and_resolve_wall_collisions](#cur_obj_update_floor_and_resolve_wall_collisions)
-
-### Lua Example
-`cur_obj_update_floor_and_resolve_wall_collisions(steepSlopeDegrees)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| steepSlopeDegrees | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_update_floor_and_walls](#cur_obj_update_floor_and_walls)
-
-### Lua Example
-`cur_obj_update_floor_and_walls()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_update_floor_and_walls(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_standard](#cur_obj_move_standard)
-
-### Lua Example
-`cur_obj_move_standard(steepSlopeAngleDegrees)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| steepSlopeAngleDegrees | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_standard(s16 steepSlopeAngleDegrees);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_within_12k_bounds](#cur_obj_within_12k_bounds)
-
-### Lua Example
-`local integerValue = cur_obj_within_12k_bounds()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_within_12k_bounds(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_using_vel_and_gravity](#cur_obj_move_using_vel_and_gravity)
-
-### Lua Example
-`cur_obj_move_using_vel_and_gravity()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_using_vel_and_gravity(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_using_fvel_and_gravity](#cur_obj_move_using_fvel_and_gravity)
-
-### Lua Example
-`cur_obj_move_using_fvel_and_gravity()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_move_using_fvel_and_gravity(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_pos_relative](#obj_set_pos_relative)
-
-### Lua Example
-`obj_set_pos_relative(obj, other, dleft, dy, dforward)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| other | [Object](structs.md#Object) |
-| dleft | `number` |
-| dy | `number` |
-| dforward | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy, f32 dforward);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_angle_to_home](#cur_obj_angle_to_home)
-
-### Lua Example
-`local integerValue = cur_obj_angle_to_home()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 cur_obj_angle_to_home(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_gfx_pos_at_obj_pos](#obj_set_gfx_pos_at_obj_pos)
-
-### Lua Example
-`obj_set_gfx_pos_at_obj_pos(obj1, obj2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj1 | [Object](structs.md#Object) |
-| obj2 | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_gfx_pos_at_obj_pos(struct Object *obj1, struct Object *obj2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_translate_local](#obj_translate_local)
-
-### Description
-Transforms the vector at `localTranslateIndex` into the object's local coordinates, and then adds it to the vector at `posIndex`
-
-### Lua Example
-`obj_translate_local(obj, posIndex, localTranslateIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| posIndex | `integer` |
-| localTranslateIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_build_transform_from_pos_and_angle](#obj_build_transform_from_pos_and_angle)
-
-### Lua Example
-`obj_build_transform_from_pos_and_angle(obj, posIndex, angleIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| posIndex | `integer` |
-| angleIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_throw_matrix_from_transform](#obj_set_throw_matrix_from_transform)
-
-### Lua Example
-`obj_set_throw_matrix_from_transform(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_throw_matrix_from_transform(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_build_transform_relative_to_parent](#obj_build_transform_relative_to_parent)
-
-### Lua Example
-`obj_build_transform_relative_to_parent(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_build_transform_relative_to_parent(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_create_transform_from_self](#obj_create_transform_from_self)
-
-### Lua Example
-`obj_create_transform_from_self(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_create_transform_from_self(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_rotate_move_angle_using_vel](#cur_obj_rotate_move_angle_using_vel)
-
-### Lua Example
-`cur_obj_rotate_move_angle_using_vel()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_rotate_move_angle_using_vel(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_rotate_face_angle_using_vel](#cur_obj_rotate_face_angle_using_vel)
-
-### Lua Example
-`cur_obj_rotate_face_angle_using_vel()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_rotate_face_angle_using_vel(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_face_angle_to_move_angle](#cur_obj_set_face_angle_to_move_angle)
-
-### Lua Example
-`cur_obj_set_face_angle_to_move_angle()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_face_angle_to_move_angle(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_follow_path](#cur_obj_follow_path)
-
-### Lua Example
-`local integerValue = cur_obj_follow_path(unusedArg)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| unusedArg | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_follow_path(UNUSED s32 unusedArg);`
-
-[:arrow_up_small:](#)
-
-
-
-## [chain_segment_init](#chain_segment_init)
-
-### Lua Example
-`chain_segment_init(segment)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| segment | [ChainSegment](structs.md#ChainSegment) |
-
-### Returns
-- None
-
-### C Prototype
-`void chain_segment_init(struct ChainSegment *segment);`
-
-[:arrow_up_small:](#)
-
-
-
-## [random_f32_around_zero](#random_f32_around_zero)
-
-### Lua Example
-`local numberValue = random_f32_around_zero(diameter)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| diameter | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 random_f32_around_zero(f32 diameter);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_scale_random](#obj_scale_random)
-
-### Lua Example
-`obj_scale_random(obj, rangeLength, minScale)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| rangeLength | `number` |
-| minScale | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_scale_random(struct Object *obj, f32 rangeLength, f32 minScale);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_translate_xyz_random](#obj_translate_xyz_random)
-
-### Lua Example
-`obj_translate_xyz_random(obj, rangeLength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| rangeLength | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_translate_xyz_random(struct Object *obj, f32 rangeLength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_translate_xz_random](#obj_translate_xz_random)
-
-### Lua Example
-`obj_translate_xz_random(obj, rangeLength)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| rangeLength | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_translate_xz_random(struct Object *obj, f32 rangeLength);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_build_vel_from_transform](#obj_build_vel_from_transform)
-
-### Lua Example
-`obj_build_vel_from_transform(a0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_build_vel_from_transform(struct Object *a0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_via_transform](#cur_obj_set_pos_via_transform)
-
-### Lua Example
-`cur_obj_set_pos_via_transform()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_via_transform(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_reflect_move_angle_off_wall](#cur_obj_reflect_move_angle_off_wall)
-
-### Lua Example
-`local integerValue = cur_obj_reflect_move_angle_off_wall()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 cur_obj_reflect_move_angle_off_wall(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_spawn_particles](#cur_obj_spawn_particles)
-
-### Lua Example
-`cur_obj_spawn_particles(info)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| info | [SpawnParticlesInfo](structs.md#SpawnParticlesInfo) |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_spawn_particles(struct SpawnParticlesInfo *info);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_hitbox](#obj_set_hitbox)
-
-### Lua Example
-`obj_set_hitbox(obj, hitbox)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_hitbox(struct Object *obj, struct ObjectHitbox *hitbox);`
-
-[:arrow_up_small:](#)
-
-
-
-## [signum_positive](#signum_positive)
-
-### Lua Example
-`local integerValue = signum_positive(x)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 signum_positive(s32 x);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_wait_then_blink](#cur_obj_wait_then_blink)
-
-### Lua Example
-`local integerValue = cur_obj_wait_then_blink(timeUntilBlinking, numBlinks)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| timeUntilBlinking | `integer` |
-| numBlinks | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_is_mario_ground_pounding_platform](#cur_obj_is_mario_ground_pounding_platform)
-
-### Lua Example
-`local integerValue = cur_obj_is_mario_ground_pounding_platform()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_is_mario_ground_pounding_platform(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_mario_ground_pounding_platform](#obj_is_mario_ground_pounding_platform)
-
-### Lua Example
-`local integerValue = obj_is_mario_ground_pounding_platform(m, obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_is_mario_ground_pounding_platform(struct MarioState *m, struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_mist_particles](#spawn_mist_particles)
-
-### Lua Example
-`spawn_mist_particles()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void spawn_mist_particles(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_mist_particles_with_sound](#spawn_mist_particles_with_sound)
-
-### Lua Example
-`spawn_mist_particles_with_sound(sp18)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp18 | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void spawn_mist_particles_with_sound(u32 sp18);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_push_mario_away](#cur_obj_push_mario_away)
-
-### Lua Example
-`cur_obj_push_mario_away(radius)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| radius | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_push_mario_away(f32 radius);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_push_mario_away_from_cylinder](#cur_obj_push_mario_away_from_cylinder)
-
-### Lua Example
-`cur_obj_push_mario_away_from_cylinder(radius, extentY)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| radius | `number` |
-| extentY | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_push_mario_away_from_cylinder(f32 radius, f32 extentY);`
-
-[:arrow_up_small:](#)
-
-
-
-## [bhv_dust_smoke_loop](#bhv_dust_smoke_loop)
-
-### Lua Example
-`bhv_dust_smoke_loop()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void bhv_dust_smoke_loop(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [stub_obj_helpers_3](#stub_obj_helpers_3)
-
-### Lua Example
-`stub_obj_helpers_3(sp0, sp4)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp0 | `integer` |
-| sp4 | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_scale_over_time](#cur_obj_scale_over_time)
-
-### Lua Example
-`cur_obj_scale_over_time(a0, a1, sp10, sp14)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | `integer` |
-| a1 | `integer` |
-| sp10 | `number` |
-| sp14 | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_pos_to_home_with_debug](#cur_obj_set_pos_to_home_with_debug)
-
-### Lua Example
-`cur_obj_set_pos_to_home_with_debug()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_pos_to_home_with_debug(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [stub_obj_helpers_4](#stub_obj_helpers_4)
-
-### Lua Example
-`stub_obj_helpers_4()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void stub_obj_helpers_4(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_is_mario_on_platform](#cur_obj_is_mario_on_platform)
-
-### Lua Example
-`local integerValue = cur_obj_is_mario_on_platform()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_is_mario_on_platform(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_is_any_player_on_platform](#cur_obj_is_any_player_on_platform)
-
-### Lua Example
-`local integerValue = cur_obj_is_any_player_on_platform()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_is_any_player_on_platform(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_shake_y_until](#cur_obj_shake_y_until)
-
-### Lua Example
-`local integerValue = cur_obj_shake_y_until(cycles, amount)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| cycles | `integer` |
-| amount | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_shake_y_until(s32 cycles, s32 amount);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_move_up_and_down](#cur_obj_move_up_and_down)
-
-### Lua Example
-`local integerValue = cur_obj_move_up_and_down(a0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_move_up_and_down(s32 a0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_star_with_no_lvl_exit](#spawn_star_with_no_lvl_exit)
-
-### Lua Example
-`local ObjectValue = spawn_star_with_no_lvl_exit(sp20, sp24)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp20 | `integer` |
-| sp24 | `integer` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_base_star_with_no_lvl_exit](#spawn_base_star_with_no_lvl_exit)
-
-### Lua Example
-`spawn_base_star_with_no_lvl_exit()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void spawn_base_star_with_no_lvl_exit(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [bit_shift_left](#bit_shift_left)
-
-### Lua Example
-`local integerValue = bit_shift_left(a0)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a0 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 bit_shift_left(s32 a0);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_mario_far_away](#cur_obj_mario_far_away)
-
-### Lua Example
-`local integerValue = cur_obj_mario_far_away()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_mario_far_away(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [is_mario_moving_fast_or_in_air](#is_mario_moving_fast_or_in_air)
-
-### Lua Example
-`local integerValue = is_mario_moving_fast_or_in_air(speedThreshold)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| speedThreshold | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 is_mario_moving_fast_or_in_air(s32 speedThreshold);`
-
-[:arrow_up_small:](#)
-
-
-
-## [is_item_in_array](#is_item_in_array)
-
-### Lua Example
-`local integerValue = is_item_in_array(item, array)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| item | `integer` |
-| array | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 is_item_in_array(s8 item, s8 *array);`
-
-[:arrow_up_small:](#)
-
-
-
-## [bhv_init_room](#bhv_init_room)
-
-### Lua Example
-`bhv_init_room()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void bhv_init_room(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_enable_rendering_if_mario_in_room](#cur_obj_enable_rendering_if_mario_in_room)
-
-### Lua Example
-`cur_obj_enable_rendering_if_mario_in_room()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_enable_rendering_if_mario_in_room(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_hitbox_and_die_if_attacked](#cur_obj_set_hitbox_and_die_if_attacked)
-
-### Lua Example
-`local integerValue = cur_obj_set_hitbox_and_die_if_attacked(hitbox, deathSound, noLootCoins)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
-| deathSound | `integer` |
-| noLootCoins | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_explode_and_spawn_coins](#obj_explode_and_spawn_coins)
-
-### Lua Example
-`obj_explode_and_spawn_coins(sp18, sp1C)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| sp18 | `number` |
-| sp1C | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_if_hit_wall_bounce_away](#cur_obj_if_hit_wall_bounce_away)
-
-### Lua Example
-`cur_obj_if_hit_wall_bounce_away()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_if_hit_wall_bounce_away(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_hide_if_mario_far_away_y](#cur_obj_hide_if_mario_far_away_y)
-
-### Lua Example
-`local integerValue = cur_obj_hide_if_mario_far_away_y(distY)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| distY | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_hide_if_mario_far_away_y(f32 distY);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_hidden](#obj_is_hidden)
-
-### Lua Example
-`local integerValue = obj_is_hidden(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_is_hidden(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [enable_time_stop](#enable_time_stop)
-
-### Lua Example
-`enable_time_stop()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void enable_time_stop(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [enable_time_stop_if_alone](#enable_time_stop_if_alone)
-
-### Lua Example
-`enable_time_stop_if_alone()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void enable_time_stop_if_alone(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [disable_time_stop](#disable_time_stop)
-
-### Lua Example
-`disable_time_stop()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void disable_time_stop(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_time_stop_flags](#set_time_stop_flags)
-
-### Lua Example
-`set_time_stop_flags(flags)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| flags | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_time_stop_flags(s32 flags);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_time_stop_flags_if_alone](#set_time_stop_flags_if_alone)
-
-### Lua Example
-`set_time_stop_flags_if_alone(flags)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| flags | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_time_stop_flags_if_alone(s32 flags);`
-
-[:arrow_up_small:](#)
-
-
-
-## [clear_time_stop_flags](#clear_time_stop_flags)
-
-### Lua Example
-`clear_time_stop_flags(flags)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| flags | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void clear_time_stop_flags(s32 flags);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_can_mario_activate_textbox](#cur_obj_can_mario_activate_textbox)
-
-### Lua Example
-`local integerValue = cur_obj_can_mario_activate_textbox(m, radius, height, unused)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| radius | `number` |
-| height | `number` |
-| unused | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_can_mario_activate_textbox(struct MarioState* m, f32 radius, f32 height, UNUSED s32 unused);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_can_mario_activate_textbox_2](#cur_obj_can_mario_activate_textbox_2)
-
-### Lua Example
-`local integerValue = cur_obj_can_mario_activate_textbox_2(m, radius, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| radius | `number` |
-| height | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_can_mario_activate_textbox_2(struct MarioState* m, f32 radius, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_end_dialog](#cur_obj_end_dialog)
-
-### Lua Example
-`cur_obj_end_dialog(m, dialogFlags, dialogResult)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| dialogFlags | `integer` |
-| dialogResult | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_end_dialog(struct MarioState* m, s32 dialogFlags, s32 dialogResult);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_has_model](#cur_obj_has_model)
-
-### Lua Example
-`local integerValue = cur_obj_has_model(modelID)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| modelID | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_has_model(u16 modelID);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_align_gfx_with_floor](#cur_obj_align_gfx_with_floor)
-
-### Lua Example
-`cur_obj_align_gfx_with_floor()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_align_gfx_with_floor(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [mario_is_within_rectangle](#mario_is_within_rectangle)
-
-### Lua Example
-`local integerValue = mario_is_within_rectangle(minX, maxX, minZ, maxZ)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| minX | `integer` |
-| maxX | `integer` |
-| minZ | `integer` |
-| maxZ | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 mario_is_within_rectangle(s16 minX, s16 maxX, s16 minZ, s16 maxZ);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_shake_screen](#cur_obj_shake_screen)
-
-### Lua Example
-`cur_obj_shake_screen(shake)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| shake | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_shake_screen(s32 shake);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_attack_collided_from_other_object](#obj_attack_collided_from_other_object)
-
-### Lua Example
-`local integerValue = obj_attack_collided_from_other_object(obj)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| obj | [Object](structs.md#Object) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_attack_collided_from_other_object(struct Object *obj);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_was_attacked_or_ground_pounded](#cur_obj_was_attacked_or_ground_pounded)
-
-### Lua Example
-`local integerValue = cur_obj_was_attacked_or_ground_pounded()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_was_attacked_or_ground_pounded(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_copy_behavior_params](#obj_copy_behavior_params)
-
-### Lua Example
-`obj_copy_behavior_params(dst, src)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dst | [Object](structs.md#Object) |
-| src | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_copy_behavior_params(struct Object *dst, struct Object *src);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation_and_anim_frame](#cur_obj_init_animation_and_anim_frame)
-
-### Lua Example
-`cur_obj_init_animation_and_anim_frame(animIndex, animFrame)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-| animFrame | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_animation_and_anim_frame(s32 animIndex, s32 animFrame);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation_and_check_if_near_end](#cur_obj_init_animation_and_check_if_near_end)
-
-### Lua Example
-`local integerValue = cur_obj_init_animation_and_check_if_near_end(animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_init_animation_and_check_if_near_end(s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_init_animation_and_extend_if_at_end](#cur_obj_init_animation_and_extend_if_at_end)
-
-### Lua Example
-`cur_obj_init_animation_and_extend_if_at_end(animIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_init_animation_and_extend_if_at_end(s32 animIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_grabbed_mario](#cur_obj_check_grabbed_mario)
-
-### Lua Example
-`local integerValue = cur_obj_check_grabbed_mario()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_grabbed_mario(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [player_performed_grab_escape_action](#player_performed_grab_escape_action)
-
-### Lua Example
-`local integerValue = player_performed_grab_escape_action()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 player_performed_grab_escape_action(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_unused_play_footstep_sound](#cur_obj_unused_play_footstep_sound)
-
-### Lua Example
-`cur_obj_unused_play_footstep_sound(animFrame1, animFrame2, sound)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| animFrame1 | `integer` |
-| animFrame2 | `integer` |
-| sound | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_unused_play_footstep_sound(s32 animFrame1, s32 animFrame2, s32 sound);`
-
-[:arrow_up_small:](#)
-
-
-
-## [enable_time_stop_including_mario](#enable_time_stop_including_mario)
-
-### Lua Example
-`enable_time_stop_including_mario()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void enable_time_stop_including_mario(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [disable_time_stop_including_mario](#disable_time_stop_including_mario)
-
-### Lua Example
-`disable_time_stop_including_mario()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void disable_time_stop_including_mario(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_check_interacted](#cur_obj_check_interacted)
-
-### Lua Example
-`local integerValue = cur_obj_check_interacted()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 cur_obj_check_interacted(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_spawn_loot_blue_coin](#cur_obj_spawn_loot_blue_coin)
-
-### Lua Example
-`cur_obj_spawn_loot_blue_coin()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_spawn_loot_blue_coin(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_spawn_star_at_y_offset](#cur_obj_spawn_star_at_y_offset)
-
-### Lua Example
-`cur_obj_spawn_star_at_y_offset(targetX, targetY, targetZ, offsetY)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| targetX | `number` |
-| targetY | `number` |
-| targetZ | `number` |
-| offsetY | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_set_home_once](#cur_obj_set_home_once)
-
-### Description
-Sets the current object's home only the first time it's called
-
-### Lua Example
-`cur_obj_set_home_once()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_set_home_once(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_trajectory_length](#get_trajectory_length)
-
-### Description
-Gets a trajectory's length
-
-### Lua Example
-`local integerValue = get_trajectory_length(trajectory)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| trajectory | `Pointer` <`Trajectory`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 get_trajectory_length(Trajectory* trajectory);`
-
-[:arrow_up_small:](#)
-
---
diff --git a/docs/lua/functions-6.md b/docs/lua/functions-6.md
index 713f1d2eb..de205a965 100644
--- a/docs/lua/functions-6.md
+++ b/docs/lua/functions-6.md
@@ -5,6 +5,4584 @@
[< prev](functions-5.md) | [1](functions.md) | [2](functions-2.md) | [3](functions-3.md) | [4](functions-4.md) | [5](functions-5.md) | 6 | [7](functions-7.md) | [next >](functions-7.md)]
+---
+# functions from object_helpers.c
+
+
+
+
+## [clear_move_flag](#clear_move_flag)
+
+### Lua Example
+`local integerValue = clear_move_flag(bitSet, flag)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| bitSet | `Pointer` <`integer`> |
+| flag | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 clear_move_flag(u32 *bitSet, s32 flag);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_room_override](#set_room_override)
+
+### Description
+Overrides the current room Mario is in. Set to -1 to reset override
+
+### Lua Example
+`set_room_override(room)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| room | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_room_override(s16 room);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_update_pos_from_parent_transformation](#obj_update_pos_from_parent_transformation)
+
+### Lua Example
+`obj_update_pos_from_parent_transformation(a0, a1)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | [Mat4](structs.md#Mat4) |
+| a1 | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_apply_scale_to_matrix](#obj_apply_scale_to_matrix)
+
+### Lua Example
+`obj_apply_scale_to_matrix(obj, dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| dst | [Mat4](structs.md#Mat4) |
+| src | [Mat4](structs.md#Mat4) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_apply_scale_to_matrix(struct Object *obj, OUT Mat4 dst, Mat4 src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [create_transformation_from_matrices](#create_transformation_from_matrices)
+
+### Lua Example
+`create_transformation_from_matrices(a0, a1, a2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | [Mat4](structs.md#Mat4) |
+| a1 | [Mat4](structs.md#Mat4) |
+| a2 | [Mat4](structs.md#Mat4) |
+
+### Returns
+- None
+
+### C Prototype
+`void create_transformation_from_matrices(OUT Mat4 a0, Mat4 a1, Mat4 a2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_held_state](#obj_set_held_state)
+
+### Lua Example
+`obj_set_held_state(obj, heldBehavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| heldBehavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [lateral_dist_between_objects](#lateral_dist_between_objects)
+
+### Lua Example
+`local numberValue = lateral_dist_between_objects(obj1, obj2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj1 | [Object](structs.md#Object) |
+| obj2 | [Object](structs.md#Object) |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 lateral_dist_between_objects(struct Object *obj1, struct Object *obj2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [dist_between_objects](#dist_between_objects)
+
+### Lua Example
+`local numberValue = dist_between_objects(obj1, obj2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj1 | [Object](structs.md#Object) |
+| obj2 | [Object](structs.md#Object) |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 dist_between_objects(struct Object *obj1, struct Object *obj2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [dist_between_object_and_point](#dist_between_object_and_point)
+
+### Lua Example
+`local numberValue = dist_between_object_and_point(obj, pointX, pointY, pointZ)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pointX | `number` |
+| pointY | `number` |
+| pointZ | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 dist_between_object_and_point(struct Object *obj, f32 pointX, f32 pointY, f32 pointZ);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_forward_vel_approach_upward](#cur_obj_forward_vel_approach_upward)
+
+### Lua Example
+`cur_obj_forward_vel_approach_upward(target, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| target | `number` |
+| increment | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_forward_vel_approach_upward(f32 target, f32 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [approach_f32_signed](#approach_f32_signed)
+
+### Lua Example
+`local integerValue = approach_f32_signed(value, target, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `Pointer` <`number`> |
+| target | `number` |
+| increment | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 approach_f32_signed(f32 *value, f32 target, f32 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [approach_f32_symmetric](#approach_f32_symmetric)
+
+### Lua Example
+`local numberValue = approach_f32_symmetric(value, target, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `number` |
+| target | `number` |
+| increment | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 approach_f32_symmetric(f32 value, f32 target, f32 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [approach_s16_symmetric](#approach_s16_symmetric)
+
+### Lua Example
+`local integerValue = approach_s16_symmetric(value, target, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `integer` |
+| target | `integer` |
+| increment | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 approach_s16_symmetric(s16 value, s16 target, s16 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_rotate_yaw_toward](#cur_obj_rotate_yaw_toward)
+
+### Lua Example
+`local integerValue = cur_obj_rotate_yaw_toward(target, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| target | `integer` |
+| increment | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_rotate_yaw_toward(s16 target, s16 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_angle_to_object](#obj_angle_to_object)
+
+### Lua Example
+`local integerValue = obj_angle_to_object(obj1, obj2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj1 | [Object](structs.md#Object) |
+| obj2 | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_pitch_to_object](#obj_pitch_to_object)
+
+### Lua Example
+`local integerValue = obj_pitch_to_object(obj, target)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| target | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_pitch_to_object(struct Object* obj, struct Object* target);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_angle_to_point](#obj_angle_to_point)
+
+### Lua Example
+`local integerValue = obj_angle_to_point(obj, pointX, pointZ)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pointX | `number` |
+| pointZ | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_angle_to_point(struct Object *obj, f32 pointX, f32 pointZ);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_turn_toward_object](#obj_turn_toward_object)
+
+### Lua Example
+`local integerValue = obj_turn_toward_object(obj, target, angleIndex, turnAmount)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| target | [Object](structs.md#Object) |
+| angleIndex | `integer` |
+| turnAmount | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_parent_relative_pos](#obj_set_parent_relative_pos)
+
+### Lua Example
+`obj_set_parent_relative_pos(obj, relX, relY, relZ)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| relX | `integer` |
+| relY | `integer` |
+| relZ | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_pos](#obj_set_pos)
+
+### Lua Example
+`obj_set_pos(obj, x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| x | `integer` |
+| y | `integer` |
+| z | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_pos(struct Object *obj, s16 x, s16 y, s16 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_angle](#obj_set_angle)
+
+### Lua Example
+`obj_set_angle(obj, pitch, yaw, roll)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pitch | `integer` |
+| yaw | `integer` |
+| roll | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_move_angle](#obj_set_move_angle)
+
+### Lua Example
+`obj_set_move_angle(obj, pitch, yaw, roll)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pitch | `integer` |
+| yaw | `integer` |
+| roll | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_move_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_face_angle](#obj_set_face_angle)
+
+### Lua Example
+`obj_set_face_angle(obj, pitch, yaw, roll)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pitch | `integer` |
+| yaw | `integer` |
+| roll | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_face_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_gfx_angle](#obj_set_gfx_angle)
+
+### Lua Example
+`obj_set_gfx_angle(obj, pitch, yaw, roll)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| pitch | `integer` |
+| yaw | `integer` |
+| roll | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_gfx_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_gfx_pos](#obj_set_gfx_pos)
+
+### Lua Example
+`obj_set_gfx_pos(obj, x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_gfx_pos(struct Object *obj, f32 x, f32 y, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_gfx_scale](#obj_set_gfx_scale)
+
+### Lua Example
+`obj_set_gfx_scale(obj, x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_gfx_scale(struct Object *obj, f32 x, f32 y, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_water_droplet](#spawn_water_droplet)
+
+### Lua Example
+`local ObjectValue = spawn_water_droplet(parent, params)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| parent | [Object](structs.md#Object) |
+| params | [WaterDropletParams](structs.md#WaterDropletParams) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_build_relative_transform](#obj_build_relative_transform)
+
+### Lua Example
+`obj_build_relative_transform(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_build_relative_transform(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_using_vel](#cur_obj_move_using_vel)
+
+### Lua Example
+`cur_obj_move_using_vel()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_using_vel(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_graph_y_offset](#obj_copy_graph_y_offset)
+
+### Lua Example
+`obj_copy_graph_y_offset(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_graph_y_offset(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_pos_and_angle](#obj_copy_pos_and_angle)
+
+### Lua Example
+`obj_copy_pos_and_angle(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_pos_and_angle(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_pos](#obj_copy_pos)
+
+### Lua Example
+`obj_copy_pos(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_pos(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_angle](#obj_copy_angle)
+
+### Lua Example
+`obj_copy_angle(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_angle(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_gfx_pos_from_pos](#obj_set_gfx_pos_from_pos)
+
+### Lua Example
+`obj_set_gfx_pos_from_pos(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_gfx_pos_from_pos(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_init_animation](#obj_init_animation)
+
+### Lua Example
+`obj_init_animation(obj, animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| animIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_init_animation(struct Object *obj, s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [linear_mtxf_mul_vec3f](#linear_mtxf_mul_vec3f)
+
+### Description
+Multiplies a vector by a matrix of the form: `| ? ? ? 0 |` `| ? ? ? 0 |` `| ? ? ? 0 |` `| 0 0 0 1 |` i.e. a matrix representing a linear transformation over 3 space
+
+### Lua Example
+`linear_mtxf_mul_vec3f(m, dst, v)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [Mat4](structs.md#Mat4) |
+| dst | [Vec3f](structs.md#Vec3f) |
+| v | [Vec3f](structs.md#Vec3f) |
+
+### Returns
+- None
+
+### C Prototype
+`void linear_mtxf_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);`
+
+[:arrow_up_small:](#)
+
+
+
+## [linear_mtxf_transpose_mul_vec3f](#linear_mtxf_transpose_mul_vec3f)
+
+### Description
+Multiplies a vector by the transpose of a matrix of the form: `| ? ? ? 0 |` `| ? ? ? 0 |` `| ? ? ? 0 |` `| 0 0 0 1 |` i.e. a matrix representing a linear transformation over 3 space
+
+### Lua Example
+`linear_mtxf_transpose_mul_vec3f(m, dst, v)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [Mat4](structs.md#Mat4) |
+| dst | [Vec3f](structs.md#Vec3f) |
+| v | [Vec3f](structs.md#Vec3f) |
+
+### Returns
+- None
+
+### C Prototype
+`void linear_mtxf_transpose_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_apply_scale_to_transform](#obj_apply_scale_to_transform)
+
+### Lua Example
+`obj_apply_scale_to_transform(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_apply_scale_to_transform(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_scale](#obj_copy_scale)
+
+### Lua Example
+`obj_copy_scale(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_scale(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_scale_xyz](#obj_scale_xyz)
+
+### Lua Example
+`obj_scale_xyz(obj, xScale, yScale, zScale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| xScale | `number` |
+| yScale | `number` |
+| zScale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_scale_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_scale](#obj_scale)
+
+### Lua Example
+`obj_scale(obj, scale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| scale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_scale(struct Object *obj, f32 scale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_scale](#cur_obj_scale)
+
+### Lua Example
+`cur_obj_scale(scale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| scale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_scale(f32 scale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation](#cur_obj_init_animation)
+
+### Lua Example
+`cur_obj_init_animation(animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_animation(s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation_with_sound](#cur_obj_init_animation_with_sound)
+
+### Lua Example
+`cur_obj_init_animation_with_sound(animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_animation_with_sound(s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_init_animation_with_accel_and_sound](#obj_init_animation_with_accel_and_sound)
+
+### Lua Example
+`obj_init_animation_with_accel_and_sound(obj, animIndex, accel)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| animIndex | `integer` |
+| accel | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_init_animation_with_accel_and_sound(struct Object *obj, s32 animIndex, f32 accel);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation_with_accel_and_sound](#cur_obj_init_animation_with_accel_and_sound)
+
+### Lua Example
+`cur_obj_init_animation_with_accel_and_sound(animIndex, accel)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+| accel | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_animation_with_accel_and_sound(s32 animIndex, f32 accel);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_init_animation_with_sound](#obj_init_animation_with_sound)
+
+### Lua Example
+`obj_init_animation_with_sound(obj, animations, animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| animations | [AnimationTable](structs.md#AnimationTable) |
+| animIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_init_animation_with_sound(struct Object *obj, const struct AnimationTable* animations, s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_enable_rendering_and_become_tangible](#cur_obj_enable_rendering_and_become_tangible)
+
+### Lua Example
+`cur_obj_enable_rendering_and_become_tangible(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_enable_rendering_and_become_tangible(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_enable_rendering](#cur_obj_enable_rendering)
+
+### Lua Example
+`cur_obj_enable_rendering()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_enable_rendering(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_disable_rendering_and_become_intangible](#cur_obj_disable_rendering_and_become_intangible)
+
+### Lua Example
+`cur_obj_disable_rendering_and_become_intangible(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_disable_rendering_and_become_intangible(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_disable_rendering](#cur_obj_disable_rendering)
+
+### Lua Example
+`cur_obj_disable_rendering()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_disable_rendering(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_unhide](#cur_obj_unhide)
+
+### Lua Example
+`cur_obj_unhide()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_unhide(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_hide](#cur_obj_hide)
+
+### Lua Example
+`cur_obj_hide()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_hide(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_relative](#cur_obj_set_pos_relative)
+
+### Lua Example
+`cur_obj_set_pos_relative(other, dleft, dy, dforward)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| other | [Object](structs.md#Object) |
+| dleft | `number` |
+| dy | `number` |
+| dforward | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_relative_to_parent](#cur_obj_set_pos_relative_to_parent)
+
+### Lua Example
+`cur_obj_set_pos_relative_to_parent(dleft, dy, dforward)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dleft | `number` |
+| dy | `number` |
+| dforward | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_relative_to_parent(f32 dleft, f32 dy, f32 dforward);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_enable_rendering_2](#cur_obj_enable_rendering_2)
+
+### Lua Example
+`cur_obj_enable_rendering_2()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_enable_rendering_2(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_unused_init_on_floor](#cur_obj_unused_init_on_floor)
+
+### Lua Example
+`cur_obj_unused_init_on_floor()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_unused_init_on_floor(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_face_angle_to_move_angle](#obj_set_face_angle_to_move_angle)
+
+### Lua Example
+`obj_set_face_angle_to_move_angle(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_face_angle_to_move_angle(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_object_list_from_behavior](#get_object_list_from_behavior)
+
+### Lua Example
+`local integerValue = get_object_list_from_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`u32 get_object_list_from_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_nearest_object_with_behavior](#cur_obj_nearest_object_with_behavior)
+
+### Lua Example
+`local ObjectValue = cur_obj_nearest_object_with_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_dist_to_nearest_object_with_behavior](#cur_obj_dist_to_nearest_object_with_behavior)
+
+### Lua Example
+`local numberValue = cur_obj_dist_to_nearest_object_with_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_find_nearest_pole](#cur_obj_find_nearest_pole)
+
+### Lua Example
+`local ObjectValue = cur_obj_find_nearest_pole()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object* cur_obj_find_nearest_pole(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_find_nearest_object_with_behavior](#cur_obj_find_nearest_object_with_behavior)
+
+### Lua Example
+`local ObjectValue = cur_obj_find_nearest_object_with_behavior(behavior, dist)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+| dist | `Pointer` <`number`> |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_count_objects_with_behavior](#cur_obj_count_objects_with_behavior)
+
+### Lua Example
+`local integerValue = cur_obj_count_objects_with_behavior(behavior, dist)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+| dist | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`u16 cur_obj_count_objects_with_behavior(const BehaviorScript* behavior, f32 dist);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_unimportant_object](#find_unimportant_object)
+
+### Lua Example
+`local ObjectValue = find_unimportant_object()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *find_unimportant_object(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [count_unimportant_objects](#count_unimportant_objects)
+
+### Lua Example
+`local integerValue = count_unimportant_objects()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 count_unimportant_objects(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [count_objects_with_behavior](#count_objects_with_behavior)
+
+### Lua Example
+`local integerValue = count_objects_with_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 count_objects_with_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_object_with_behavior](#find_object_with_behavior)
+
+### Lua Example
+`local ObjectValue = find_object_with_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *find_object_with_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_find_nearby_held_actor](#cur_obj_find_nearby_held_actor)
+
+### Lua Example
+`local ObjectValue = cur_obj_find_nearby_held_actor(behavior, maxDist)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+| maxDist | `number` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_reset_timer_and_subaction](#cur_obj_reset_timer_and_subaction)
+
+### Lua Example
+`cur_obj_reset_timer_and_subaction()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_reset_timer_and_subaction(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_change_action](#cur_obj_change_action)
+
+### Lua Example
+`cur_obj_change_action(action)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| action | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_change_action(s32 action);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_vel_from_mario_vel](#cur_obj_set_vel_from_mario_vel)
+
+### Lua Example
+`cur_obj_set_vel_from_mario_vel(m, f12, f14)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| f12 | `number` |
+| f14 | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_vel_from_mario_vel(struct MarioState* m, f32 f12, f32 f14);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_reverse_animation](#cur_obj_reverse_animation)
+
+### Lua Example
+`cur_obj_reverse_animation()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_reverse_animation(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_extend_animation_if_at_end](#cur_obj_extend_animation_if_at_end)
+
+### Lua Example
+`cur_obj_extend_animation_if_at_end()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_extend_animation_if_at_end(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_if_near_animation_end](#cur_obj_check_if_near_animation_end)
+
+### Lua Example
+`local integerValue = cur_obj_check_if_near_animation_end()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_if_near_animation_end(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_if_at_animation_end](#cur_obj_check_if_at_animation_end)
+
+### Lua Example
+`local integerValue = cur_obj_check_if_at_animation_end()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_if_at_animation_end(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_anim_frame](#cur_obj_check_anim_frame)
+
+### Lua Example
+`local integerValue = cur_obj_check_anim_frame(frame)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| frame | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_anim_frame(s32 frame);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_anim_frame_in_range](#cur_obj_check_anim_frame_in_range)
+
+### Lua Example
+`local integerValue = cur_obj_check_anim_frame_in_range(startFrame, rangeLength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| startFrame | `integer` |
+| rangeLength | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_frame_prior_current_frame](#cur_obj_check_frame_prior_current_frame)
+
+### Lua Example
+`local integerValue = cur_obj_check_frame_prior_current_frame(a0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_frame_prior_current_frame(s16 *a0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mario_is_in_air_action](#mario_is_in_air_action)
+
+### Lua Example
+`local integerValue = mario_is_in_air_action(m)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 mario_is_in_air_action(struct MarioState* m);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mario_is_dive_sliding](#mario_is_dive_sliding)
+
+### Lua Example
+`local integerValue = mario_is_dive_sliding(m)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 mario_is_dive_sliding(struct MarioState* m);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_y_vel_and_animation](#cur_obj_set_y_vel_and_animation)
+
+### Lua Example
+`cur_obj_set_y_vel_and_animation(sp18, sp1C)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp18 | `number` |
+| sp1C | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_y_vel_and_animation(f32 sp18, s32 sp1C);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_unrender_and_reset_state](#cur_obj_unrender_and_reset_state)
+
+### Lua Example
+`cur_obj_unrender_and_reset_state(sp18, sp1C)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp18 | `integer` |
+| sp1C | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_unrender_and_reset_state(s32 sp18, s32 sp1C);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_after_thrown_or_dropped](#cur_obj_move_after_thrown_or_dropped)
+
+### Lua Example
+`cur_obj_move_after_thrown_or_dropped(forwardVel, velY)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| forwardVel | `number` |
+| velY | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_get_thrown_or_placed](#cur_obj_get_thrown_or_placed)
+
+### Lua Example
+`cur_obj_get_thrown_or_placed(forwardVel, velY, thrownAction)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| forwardVel | `number` |
+| velY | `number` |
+| thrownAction | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_get_dropped](#cur_obj_get_dropped)
+
+### Lua Example
+`cur_obj_get_dropped()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_get_dropped(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mario_set_flag](#mario_set_flag)
+
+### Lua Example
+`mario_set_flag(flag)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| flag | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void mario_set_flag(s32 flag);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_clear_interact_status_flag](#cur_obj_clear_interact_status_flag)
+
+### Lua Example
+`local integerValue = cur_obj_clear_interact_status_flag(flag)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| flag | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_clear_interact_status_flag(s32 flag);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_mark_for_deletion](#obj_mark_for_deletion)
+
+### Description
+Marks an object to be unloaded at the end of the frame
+
+### Lua Example
+`obj_mark_for_deletion(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_mark_for_deletion(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_disable](#cur_obj_disable)
+
+### Lua Example
+`cur_obj_disable()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_disable(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_become_intangible](#cur_obj_become_intangible)
+
+### Lua Example
+`cur_obj_become_intangible()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_become_intangible(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_become_tangible](#cur_obj_become_tangible)
+
+### Lua Example
+`cur_obj_become_tangible()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_become_tangible(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_become_tangible](#obj_become_tangible)
+
+### Lua Example
+`obj_become_tangible(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_become_tangible(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_update_floor_height](#cur_obj_update_floor_height)
+
+### Lua Example
+`cur_obj_update_floor_height()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_update_floor_height(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_update_floor_height_and_get_floor](#cur_obj_update_floor_height_and_get_floor)
+
+### Lua Example
+`local SurfaceValue = cur_obj_update_floor_height_and_get_floor()`
+
+### Parameters
+- None
+
+### Returns
+[Surface](structs.md#Surface)
+
+### C Prototype
+`struct Surface *cur_obj_update_floor_height_and_get_floor(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [apply_drag_to_value](#apply_drag_to_value)
+
+### Lua Example
+`apply_drag_to_value(value, dragStrength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `Pointer` <`number`> |
+| dragStrength | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void apply_drag_to_value(f32 *value, f32 dragStrength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_apply_drag_xz](#cur_obj_apply_drag_xz)
+
+### Lua Example
+`cur_obj_apply_drag_xz(dragStrength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dragStrength | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_apply_drag_xz(f32 dragStrength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_xz](#cur_obj_move_xz)
+
+### Lua Example
+`local integerValue = cur_obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| steepSlopeNormalY | `number` |
+| careAboutEdgesAndSteepSlopes | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_update_underwater_flags](#cur_obj_move_update_underwater_flags)
+
+### Lua Example
+`cur_obj_move_update_underwater_flags()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_update_underwater_flags(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_update_ground_air_flags](#cur_obj_move_update_ground_air_flags)
+
+### Lua Example
+`cur_obj_move_update_ground_air_flags(gravity, bounciness)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| gravity | `number` |
+| bounciness | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounciness);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_y_and_get_water_level](#cur_obj_move_y_and_get_water_level)
+
+### Lua Example
+`local numberValue = cur_obj_move_y_and_get_water_level(gravity, buoyancy)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| gravity | `number` |
+| buoyancy | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_y](#cur_obj_move_y)
+
+### Lua Example
+`cur_obj_move_y(gravity, bounciness, buoyancy)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| gravity | `number` |
+| bounciness | `number` |
+| buoyancy | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_unused_resolve_wall_collisions](#cur_obj_unused_resolve_wall_collisions)
+
+### Lua Example
+`cur_obj_unused_resolve_wall_collisions(offsetY, radius)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| offsetY | `number` |
+| radius | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius);`
+
+[:arrow_up_small:](#)
+
+
+
+## [abs_angle_diff](#abs_angle_diff)
+
+### Lua Example
+`local integerValue = abs_angle_diff(x0, x1)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x0 | `integer` |
+| x1 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 abs_angle_diff(s16 x0, s16 x1);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_xz_using_fvel_and_yaw](#cur_obj_move_xz_using_fvel_and_yaw)
+
+### Lua Example
+`cur_obj_move_xz_using_fvel_and_yaw()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_xz_using_fvel_and_yaw(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_y_with_terminal_vel](#cur_obj_move_y_with_terminal_vel)
+
+### Lua Example
+`cur_obj_move_y_with_terminal_vel()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_y_with_terminal_vel(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_compute_vel_xz](#cur_obj_compute_vel_xz)
+
+### Lua Example
+`cur_obj_compute_vel_xz()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_compute_vel_xz(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [increment_velocity_toward_range](#increment_velocity_toward_range)
+
+### Lua Example
+`local numberValue = increment_velocity_toward_range(value, center, zeroThreshold, increment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `number` |
+| center | `number` |
+| zeroThreshold | `number` |
+| increment | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 increment_velocity_toward_range(f32 value, f32 center, f32 zeroThreshold, f32 increment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_check_if_collided_with_object](#obj_check_if_collided_with_object)
+
+### Lua Example
+`local integerValue = obj_check_if_collided_with_object(obj1, obj2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj1 | [Object](structs.md#Object) |
+| obj2 | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_behavior](#cur_obj_set_behavior)
+
+### Lua Example
+`cur_obj_set_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_behavior](#obj_set_behavior)
+
+### Lua Example
+`obj_set_behavior(obj, behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_has_behavior](#cur_obj_has_behavior)
+
+### Lua Example
+`local integerValue = cur_obj_has_behavior(behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_has_behavior(const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_has_behavior](#obj_has_behavior)
+
+### Lua Example
+`local integerValue = obj_has_behavior(obj, behavior)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| behavior | `Pointer` <`BehaviorScript`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_lateral_dist_from_obj_to_home](#cur_obj_lateral_dist_from_obj_to_home)
+
+### Lua Example
+`local numberValue = cur_obj_lateral_dist_from_obj_to_home(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_lateral_dist_from_obj_to_home(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_lateral_dist_from_mario_to_home](#cur_obj_lateral_dist_from_mario_to_home)
+
+### Lua Example
+`local numberValue = cur_obj_lateral_dist_from_mario_to_home()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_lateral_dist_from_mario_to_home(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_lateral_dist_to_home](#cur_obj_lateral_dist_to_home)
+
+### Lua Example
+`local numberValue = cur_obj_lateral_dist_to_home()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_lateral_dist_to_home(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_outside_home_square](#cur_obj_outside_home_square)
+
+### Lua Example
+`local integerValue = cur_obj_outside_home_square(halfLength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| halfLength | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_outside_home_square(f32 halfLength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_outside_home_rectangle](#cur_obj_outside_home_rectangle)
+
+### Lua Example
+`local integerValue = cur_obj_outside_home_rectangle(minX, maxX, minZ, maxZ)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| minX | `number` |
+| maxX | `number` |
+| minZ | `number` |
+| maxZ | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_to_home](#cur_obj_set_pos_to_home)
+
+### Lua Example
+`cur_obj_set_pos_to_home()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_to_home(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_to_home_and_stop](#cur_obj_set_pos_to_home_and_stop)
+
+### Lua Example
+`cur_obj_set_pos_to_home_and_stop()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_to_home_and_stop(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_shake_y](#cur_obj_shake_y)
+
+### Lua Example
+`cur_obj_shake_y(amount)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| amount | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_shake_y(f32 amount);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_start_cam_event](#cur_obj_start_cam_event)
+
+### Lua Example
+`cur_obj_start_cam_event(obj, cameraEvent)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| cameraEvent | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_mario_interact_hoot_if_in_range](#set_mario_interact_hoot_if_in_range)
+
+### Lua Example
+`set_mario_interact_hoot_if_in_range(sp0, sp4, sp8)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp0 | `integer` |
+| sp4 | `integer` |
+| sp8 | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_mario_interact_hoot_if_in_range(UNUSED s32 sp0, UNUSED s32 sp4, f32 sp8);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_billboard](#obj_set_billboard)
+
+### Lua Example
+`obj_set_billboard(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_billboard(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_cylboard](#obj_set_cylboard)
+
+### Lua Example
+`obj_set_cylboard(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_cylboard(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_billboard_if_vanilla_cam](#cur_obj_set_billboard_if_vanilla_cam)
+
+### Lua Example
+`cur_obj_set_billboard_if_vanilla_cam()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_billboard_if_vanilla_cam(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_hitbox_radius_and_height](#obj_set_hitbox_radius_and_height)
+
+### Lua Example
+`obj_set_hitbox_radius_and_height(o, radius, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| radius | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_hitbox_radius_and_height(struct Object *o, f32 radius, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_hurtbox_radius_and_height](#obj_set_hurtbox_radius_and_height)
+
+### Lua Example
+`obj_set_hurtbox_radius_and_height(o, radius, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| radius | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_hurtbox_radius_and_height(struct Object *o, f32 radius, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_hitbox_radius_and_height](#cur_obj_set_hitbox_radius_and_height)
+
+### Lua Example
+`cur_obj_set_hitbox_radius_and_height(radius, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| radius | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_hitbox_radius_and_height(f32 radius, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_hurtbox_radius_and_height](#cur_obj_set_hurtbox_radius_and_height)
+
+### Lua Example
+`cur_obj_set_hurtbox_radius_and_height(radius, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| radius | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_spawn_loot_coins](#obj_spawn_loot_coins)
+
+### Lua Example
+`obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| numCoins | `integer` |
+| sp30 | `number` |
+| coinBehavior | `Pointer` <`BehaviorScript`> |
+| posJitter | `integer` |
+| model | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_spawn_loot_blue_coins](#obj_spawn_loot_blue_coins)
+
+### Lua Example
+`obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| numCoins | `integer` |
+| sp28 | `number` |
+| posJitter | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_spawn_loot_yellow_coins](#obj_spawn_loot_yellow_coins)
+
+### Lua Example
+`obj_spawn_loot_yellow_coins(obj, numCoins, sp28)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| numCoins | `integer` |
+| sp28 | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_spawn_loot_coin_at_mario_pos](#cur_obj_spawn_loot_coin_at_mario_pos)
+
+### Lua Example
+`cur_obj_spawn_loot_coin_at_mario_pos(m)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_spawn_loot_coin_at_mario_pos(struct MarioState* m);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_abs_y_dist_to_home](#cur_obj_abs_y_dist_to_home)
+
+### Lua Example
+`local numberValue = cur_obj_abs_y_dist_to_home()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 cur_obj_abs_y_dist_to_home(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_advance_looping_anim](#cur_obj_advance_looping_anim)
+
+### Lua Example
+`local integerValue = cur_obj_advance_looping_anim()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_advance_looping_anim(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_detect_steep_floor](#cur_obj_detect_steep_floor)
+
+### Lua Example
+`local integerValue = cur_obj_detect_steep_floor(steepAngleDegrees)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| steepAngleDegrees | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_resolve_wall_collisions](#cur_obj_resolve_wall_collisions)
+
+### Lua Example
+`local integerValue = cur_obj_resolve_wall_collisions()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_resolve_wall_collisions(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_update_floor](#cur_obj_update_floor)
+
+### Lua Example
+`cur_obj_update_floor()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_update_floor(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_update_floor_and_resolve_wall_collisions](#cur_obj_update_floor_and_resolve_wall_collisions)
+
+### Lua Example
+`cur_obj_update_floor_and_resolve_wall_collisions(steepSlopeDegrees)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| steepSlopeDegrees | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_update_floor_and_walls](#cur_obj_update_floor_and_walls)
+
+### Lua Example
+`cur_obj_update_floor_and_walls()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_update_floor_and_walls(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_standard](#cur_obj_move_standard)
+
+### Lua Example
+`cur_obj_move_standard(steepSlopeAngleDegrees)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| steepSlopeAngleDegrees | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_standard(s16 steepSlopeAngleDegrees);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_within_12k_bounds](#cur_obj_within_12k_bounds)
+
+### Lua Example
+`local integerValue = cur_obj_within_12k_bounds()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_within_12k_bounds(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_using_vel_and_gravity](#cur_obj_move_using_vel_and_gravity)
+
+### Lua Example
+`cur_obj_move_using_vel_and_gravity()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_using_vel_and_gravity(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_using_fvel_and_gravity](#cur_obj_move_using_fvel_and_gravity)
+
+### Lua Example
+`cur_obj_move_using_fvel_and_gravity()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_move_using_fvel_and_gravity(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_pos_relative](#obj_set_pos_relative)
+
+### Lua Example
+`obj_set_pos_relative(obj, other, dleft, dy, dforward)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| other | [Object](structs.md#Object) |
+| dleft | `number` |
+| dy | `number` |
+| dforward | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy, f32 dforward);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_angle_to_home](#cur_obj_angle_to_home)
+
+### Lua Example
+`local integerValue = cur_obj_angle_to_home()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 cur_obj_angle_to_home(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_gfx_pos_at_obj_pos](#obj_set_gfx_pos_at_obj_pos)
+
+### Lua Example
+`obj_set_gfx_pos_at_obj_pos(obj1, obj2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj1 | [Object](structs.md#Object) |
+| obj2 | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_gfx_pos_at_obj_pos(struct Object *obj1, struct Object *obj2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_translate_local](#obj_translate_local)
+
+### Description
+Transforms the vector at `localTranslateIndex` into the object's local coordinates, and then adds it to the vector at `posIndex`
+
+### Lua Example
+`obj_translate_local(obj, posIndex, localTranslateIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| posIndex | `integer` |
+| localTranslateIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_build_transform_from_pos_and_angle](#obj_build_transform_from_pos_and_angle)
+
+### Lua Example
+`obj_build_transform_from_pos_and_angle(obj, posIndex, angleIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| posIndex | `integer` |
+| angleIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_throw_matrix_from_transform](#obj_set_throw_matrix_from_transform)
+
+### Lua Example
+`obj_set_throw_matrix_from_transform(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_throw_matrix_from_transform(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_build_transform_relative_to_parent](#obj_build_transform_relative_to_parent)
+
+### Lua Example
+`obj_build_transform_relative_to_parent(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_build_transform_relative_to_parent(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_create_transform_from_self](#obj_create_transform_from_self)
+
+### Lua Example
+`obj_create_transform_from_self(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_create_transform_from_self(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_rotate_move_angle_using_vel](#cur_obj_rotate_move_angle_using_vel)
+
+### Lua Example
+`cur_obj_rotate_move_angle_using_vel()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_rotate_move_angle_using_vel(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_rotate_face_angle_using_vel](#cur_obj_rotate_face_angle_using_vel)
+
+### Lua Example
+`cur_obj_rotate_face_angle_using_vel()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_rotate_face_angle_using_vel(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_face_angle_to_move_angle](#cur_obj_set_face_angle_to_move_angle)
+
+### Lua Example
+`cur_obj_set_face_angle_to_move_angle()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_face_angle_to_move_angle(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_follow_path](#cur_obj_follow_path)
+
+### Lua Example
+`local integerValue = cur_obj_follow_path(unusedArg)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| unusedArg | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_follow_path(UNUSED s32 unusedArg);`
+
+[:arrow_up_small:](#)
+
+
+
+## [chain_segment_init](#chain_segment_init)
+
+### Lua Example
+`chain_segment_init(segment)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| segment | [ChainSegment](structs.md#ChainSegment) |
+
+### Returns
+- None
+
+### C Prototype
+`void chain_segment_init(struct ChainSegment *segment);`
+
+[:arrow_up_small:](#)
+
+
+
+## [random_f32_around_zero](#random_f32_around_zero)
+
+### Lua Example
+`local numberValue = random_f32_around_zero(diameter)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| diameter | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 random_f32_around_zero(f32 diameter);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_scale_random](#obj_scale_random)
+
+### Lua Example
+`obj_scale_random(obj, rangeLength, minScale)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| rangeLength | `number` |
+| minScale | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_scale_random(struct Object *obj, f32 rangeLength, f32 minScale);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_translate_xyz_random](#obj_translate_xyz_random)
+
+### Lua Example
+`obj_translate_xyz_random(obj, rangeLength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| rangeLength | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_translate_xyz_random(struct Object *obj, f32 rangeLength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_translate_xz_random](#obj_translate_xz_random)
+
+### Lua Example
+`obj_translate_xz_random(obj, rangeLength)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| rangeLength | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_translate_xz_random(struct Object *obj, f32 rangeLength);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_build_vel_from_transform](#obj_build_vel_from_transform)
+
+### Lua Example
+`obj_build_vel_from_transform(a0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_build_vel_from_transform(struct Object *a0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_via_transform](#cur_obj_set_pos_via_transform)
+
+### Lua Example
+`cur_obj_set_pos_via_transform()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_via_transform(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_reflect_move_angle_off_wall](#cur_obj_reflect_move_angle_off_wall)
+
+### Lua Example
+`local integerValue = cur_obj_reflect_move_angle_off_wall()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 cur_obj_reflect_move_angle_off_wall(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_spawn_particles](#cur_obj_spawn_particles)
+
+### Lua Example
+`cur_obj_spawn_particles(info)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| info | [SpawnParticlesInfo](structs.md#SpawnParticlesInfo) |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_spawn_particles(struct SpawnParticlesInfo *info);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_hitbox](#obj_set_hitbox)
+
+### Lua Example
+`obj_set_hitbox(obj, hitbox)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_hitbox(struct Object *obj, struct ObjectHitbox *hitbox);`
+
+[:arrow_up_small:](#)
+
+
+
+## [signum_positive](#signum_positive)
+
+### Lua Example
+`local integerValue = signum_positive(x)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 signum_positive(s32 x);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_wait_then_blink](#cur_obj_wait_then_blink)
+
+### Lua Example
+`local integerValue = cur_obj_wait_then_blink(timeUntilBlinking, numBlinks)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| timeUntilBlinking | `integer` |
+| numBlinks | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_is_mario_ground_pounding_platform](#cur_obj_is_mario_ground_pounding_platform)
+
+### Lua Example
+`local integerValue = cur_obj_is_mario_ground_pounding_platform()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_is_mario_ground_pounding_platform(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_mario_ground_pounding_platform](#obj_is_mario_ground_pounding_platform)
+
+### Lua Example
+`local integerValue = obj_is_mario_ground_pounding_platform(m, obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_is_mario_ground_pounding_platform(struct MarioState *m, struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_mist_particles](#spawn_mist_particles)
+
+### Lua Example
+`spawn_mist_particles()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void spawn_mist_particles(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_mist_particles_with_sound](#spawn_mist_particles_with_sound)
+
+### Lua Example
+`spawn_mist_particles_with_sound(sp18)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp18 | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void spawn_mist_particles_with_sound(u32 sp18);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_push_mario_away](#cur_obj_push_mario_away)
+
+### Lua Example
+`cur_obj_push_mario_away(radius)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| radius | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_push_mario_away(f32 radius);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_push_mario_away_from_cylinder](#cur_obj_push_mario_away_from_cylinder)
+
+### Lua Example
+`cur_obj_push_mario_away_from_cylinder(radius, extentY)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| radius | `number` |
+| extentY | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_push_mario_away_from_cylinder(f32 radius, f32 extentY);`
+
+[:arrow_up_small:](#)
+
+
+
+## [bhv_dust_smoke_loop](#bhv_dust_smoke_loop)
+
+### Lua Example
+`bhv_dust_smoke_loop()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void bhv_dust_smoke_loop(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [stub_obj_helpers_3](#stub_obj_helpers_3)
+
+### Lua Example
+`stub_obj_helpers_3(sp0, sp4)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp0 | `integer` |
+| sp4 | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_scale_over_time](#cur_obj_scale_over_time)
+
+### Lua Example
+`cur_obj_scale_over_time(a0, a1, sp10, sp14)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | `integer` |
+| a1 | `integer` |
+| sp10 | `number` |
+| sp14 | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_pos_to_home_with_debug](#cur_obj_set_pos_to_home_with_debug)
+
+### Lua Example
+`cur_obj_set_pos_to_home_with_debug()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_pos_to_home_with_debug(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [stub_obj_helpers_4](#stub_obj_helpers_4)
+
+### Lua Example
+`stub_obj_helpers_4()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void stub_obj_helpers_4(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_is_mario_on_platform](#cur_obj_is_mario_on_platform)
+
+### Lua Example
+`local integerValue = cur_obj_is_mario_on_platform()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_is_mario_on_platform(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_is_any_player_on_platform](#cur_obj_is_any_player_on_platform)
+
+### Lua Example
+`local integerValue = cur_obj_is_any_player_on_platform()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_is_any_player_on_platform(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_shake_y_until](#cur_obj_shake_y_until)
+
+### Lua Example
+`local integerValue = cur_obj_shake_y_until(cycles, amount)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| cycles | `integer` |
+| amount | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_shake_y_until(s32 cycles, s32 amount);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_move_up_and_down](#cur_obj_move_up_and_down)
+
+### Lua Example
+`local integerValue = cur_obj_move_up_and_down(a0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_move_up_and_down(s32 a0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_star_with_no_lvl_exit](#spawn_star_with_no_lvl_exit)
+
+### Lua Example
+`local ObjectValue = spawn_star_with_no_lvl_exit(sp20, sp24)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp20 | `integer` |
+| sp24 | `integer` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_base_star_with_no_lvl_exit](#spawn_base_star_with_no_lvl_exit)
+
+### Lua Example
+`spawn_base_star_with_no_lvl_exit()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void spawn_base_star_with_no_lvl_exit(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [bit_shift_left](#bit_shift_left)
+
+### Lua Example
+`local integerValue = bit_shift_left(a0)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a0 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 bit_shift_left(s32 a0);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_mario_far_away](#cur_obj_mario_far_away)
+
+### Lua Example
+`local integerValue = cur_obj_mario_far_away()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_mario_far_away(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [is_mario_moving_fast_or_in_air](#is_mario_moving_fast_or_in_air)
+
+### Lua Example
+`local integerValue = is_mario_moving_fast_or_in_air(speedThreshold)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| speedThreshold | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 is_mario_moving_fast_or_in_air(s32 speedThreshold);`
+
+[:arrow_up_small:](#)
+
+
+
+## [is_item_in_array](#is_item_in_array)
+
+### Lua Example
+`local integerValue = is_item_in_array(item, array)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| item | `integer` |
+| array | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 is_item_in_array(s8 item, s8 *array);`
+
+[:arrow_up_small:](#)
+
+
+
+## [bhv_init_room](#bhv_init_room)
+
+### Lua Example
+`bhv_init_room()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void bhv_init_room(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_enable_rendering_if_mario_in_room](#cur_obj_enable_rendering_if_mario_in_room)
+
+### Lua Example
+`cur_obj_enable_rendering_if_mario_in_room()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_enable_rendering_if_mario_in_room(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_hitbox_and_die_if_attacked](#cur_obj_set_hitbox_and_die_if_attacked)
+
+### Lua Example
+`local integerValue = cur_obj_set_hitbox_and_die_if_attacked(hitbox, deathSound, noLootCoins)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| hitbox | [ObjectHitbox](structs.md#ObjectHitbox) |
+| deathSound | `integer` |
+| noLootCoins | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_explode_and_spawn_coins](#obj_explode_and_spawn_coins)
+
+### Lua Example
+`obj_explode_and_spawn_coins(sp18, sp1C)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| sp18 | `number` |
+| sp1C | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_if_hit_wall_bounce_away](#cur_obj_if_hit_wall_bounce_away)
+
+### Lua Example
+`cur_obj_if_hit_wall_bounce_away()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_if_hit_wall_bounce_away(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_hide_if_mario_far_away_y](#cur_obj_hide_if_mario_far_away_y)
+
+### Lua Example
+`local integerValue = cur_obj_hide_if_mario_far_away_y(distY)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| distY | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_hide_if_mario_far_away_y(f32 distY);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_hidden](#obj_is_hidden)
+
+### Lua Example
+`local integerValue = obj_is_hidden(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_is_hidden(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [enable_time_stop](#enable_time_stop)
+
+### Lua Example
+`enable_time_stop()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void enable_time_stop(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [enable_time_stop_if_alone](#enable_time_stop_if_alone)
+
+### Lua Example
+`enable_time_stop_if_alone()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void enable_time_stop_if_alone(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [disable_time_stop](#disable_time_stop)
+
+### Lua Example
+`disable_time_stop()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void disable_time_stop(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_time_stop_flags](#set_time_stop_flags)
+
+### Lua Example
+`set_time_stop_flags(flags)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| flags | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_time_stop_flags(s32 flags);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_time_stop_flags_if_alone](#set_time_stop_flags_if_alone)
+
+### Lua Example
+`set_time_stop_flags_if_alone(flags)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| flags | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_time_stop_flags_if_alone(s32 flags);`
+
+[:arrow_up_small:](#)
+
+
+
+## [clear_time_stop_flags](#clear_time_stop_flags)
+
+### Lua Example
+`clear_time_stop_flags(flags)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| flags | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void clear_time_stop_flags(s32 flags);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_can_mario_activate_textbox](#cur_obj_can_mario_activate_textbox)
+
+### Lua Example
+`local integerValue = cur_obj_can_mario_activate_textbox(m, radius, height, unused)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| radius | `number` |
+| height | `number` |
+| unused | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_can_mario_activate_textbox(struct MarioState* m, f32 radius, f32 height, UNUSED s32 unused);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_can_mario_activate_textbox_2](#cur_obj_can_mario_activate_textbox_2)
+
+### Lua Example
+`local integerValue = cur_obj_can_mario_activate_textbox_2(m, radius, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| radius | `number` |
+| height | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_can_mario_activate_textbox_2(struct MarioState* m, f32 radius, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_end_dialog](#cur_obj_end_dialog)
+
+### Lua Example
+`cur_obj_end_dialog(m, dialogFlags, dialogResult)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| dialogFlags | `integer` |
+| dialogResult | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_end_dialog(struct MarioState* m, s32 dialogFlags, s32 dialogResult);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_has_model](#cur_obj_has_model)
+
+### Lua Example
+`local integerValue = cur_obj_has_model(modelID)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| modelID | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_has_model(u16 modelID);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_align_gfx_with_floor](#cur_obj_align_gfx_with_floor)
+
+### Lua Example
+`cur_obj_align_gfx_with_floor()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_align_gfx_with_floor(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mario_is_within_rectangle](#mario_is_within_rectangle)
+
+### Lua Example
+`local integerValue = mario_is_within_rectangle(minX, maxX, minZ, maxZ)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| minX | `integer` |
+| maxX | `integer` |
+| minZ | `integer` |
+| maxZ | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 mario_is_within_rectangle(s16 minX, s16 maxX, s16 minZ, s16 maxZ);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_shake_screen](#cur_obj_shake_screen)
+
+### Lua Example
+`cur_obj_shake_screen(shake)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| shake | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_shake_screen(s32 shake);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_attack_collided_from_other_object](#obj_attack_collided_from_other_object)
+
+### Lua Example
+`local integerValue = obj_attack_collided_from_other_object(obj)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| obj | [Object](structs.md#Object) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_attack_collided_from_other_object(struct Object *obj);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_was_attacked_or_ground_pounded](#cur_obj_was_attacked_or_ground_pounded)
+
+### Lua Example
+`local integerValue = cur_obj_was_attacked_or_ground_pounded()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_was_attacked_or_ground_pounded(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_copy_behavior_params](#obj_copy_behavior_params)
+
+### Lua Example
+`obj_copy_behavior_params(dst, src)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dst | [Object](structs.md#Object) |
+| src | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_copy_behavior_params(struct Object *dst, struct Object *src);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation_and_anim_frame](#cur_obj_init_animation_and_anim_frame)
+
+### Lua Example
+`cur_obj_init_animation_and_anim_frame(animIndex, animFrame)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+| animFrame | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_animation_and_anim_frame(s32 animIndex, s32 animFrame);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation_and_check_if_near_end](#cur_obj_init_animation_and_check_if_near_end)
+
+### Lua Example
+`local integerValue = cur_obj_init_animation_and_check_if_near_end(animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_init_animation_and_check_if_near_end(s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_init_animation_and_extend_if_at_end](#cur_obj_init_animation_and_extend_if_at_end)
+
+### Lua Example
+`cur_obj_init_animation_and_extend_if_at_end(animIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_init_animation_and_extend_if_at_end(s32 animIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_grabbed_mario](#cur_obj_check_grabbed_mario)
+
+### Lua Example
+`local integerValue = cur_obj_check_grabbed_mario()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_grabbed_mario(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [player_performed_grab_escape_action](#player_performed_grab_escape_action)
+
+### Lua Example
+`local integerValue = player_performed_grab_escape_action()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 player_performed_grab_escape_action(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_unused_play_footstep_sound](#cur_obj_unused_play_footstep_sound)
+
+### Lua Example
+`cur_obj_unused_play_footstep_sound(animFrame1, animFrame2, sound)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| animFrame1 | `integer` |
+| animFrame2 | `integer` |
+| sound | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_unused_play_footstep_sound(s32 animFrame1, s32 animFrame2, s32 sound);`
+
+[:arrow_up_small:](#)
+
+
+
+## [enable_time_stop_including_mario](#enable_time_stop_including_mario)
+
+### Lua Example
+`enable_time_stop_including_mario()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void enable_time_stop_including_mario(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [disable_time_stop_including_mario](#disable_time_stop_including_mario)
+
+### Lua Example
+`disable_time_stop_including_mario()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void disable_time_stop_including_mario(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_check_interacted](#cur_obj_check_interacted)
+
+### Lua Example
+`local integerValue = cur_obj_check_interacted()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 cur_obj_check_interacted(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_spawn_loot_blue_coin](#cur_obj_spawn_loot_blue_coin)
+
+### Lua Example
+`cur_obj_spawn_loot_blue_coin()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_spawn_loot_blue_coin(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_spawn_star_at_y_offset](#cur_obj_spawn_star_at_y_offset)
+
+### Lua Example
+`cur_obj_spawn_star_at_y_offset(targetX, targetY, targetZ, offsetY)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| targetX | `number` |
+| targetY | `number` |
+| targetZ | `number` |
+| offsetY | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_set_home_once](#cur_obj_set_home_once)
+
+### Description
+Sets the current object's home only the first time it's called
+
+### Lua Example
+`cur_obj_set_home_once()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_set_home_once(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_trajectory_length](#get_trajectory_length)
+
+### Description
+Gets a trajectory's length
+
+### Lua Example
+`local integerValue = get_trajectory_length(trajectory)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| trajectory | `Pointer` <`Trajectory`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 get_trajectory_length(Trajectory* trajectory);`
+
+[:arrow_up_small:](#)
+
+
+
---
# functions from object_list_processor.h
@@ -3873,4644 +8451,6 @@ Deletes all vertex buffers created by `vtx_create`
[:arrow_up_small:](#)
-
-
----
-# functions from smlua_level_utils.h
-
-
-
-
-## [smlua_level_util_change_area](#smlua_level_util_change_area)
-
-### Description
-Instantly changes the current area to `areaIndex`
-
-### Lua Example
-`smlua_level_util_change_area(areaIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| areaIndex | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_level_util_change_area(s32 areaIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_level_util_get_info](#smlua_level_util_get_info)
-
-### Description
-Gets information on a custom level from `levelNum`
-
-### Lua Example
-`local CustomLevelInfoValue = smlua_level_util_get_info(levelNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| levelNum | `integer` |
-
-### Returns
-[CustomLevelInfo](structs.md#CustomLevelInfo)
-
-### C Prototype
-`struct CustomLevelInfo* smlua_level_util_get_info(s16 levelNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_level_util_get_info_from_short_name](#smlua_level_util_get_info_from_short_name)
-
-### Description
-Gets information on a custom level from `shortName`
-
-### Lua Example
-`local CustomLevelInfoValue = smlua_level_util_get_info_from_short_name(shortName)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| shortName | `string` |
-
-### Returns
-[CustomLevelInfo](structs.md#CustomLevelInfo)
-
-### C Prototype
-`struct CustomLevelInfo* smlua_level_util_get_info_from_short_name(const char* shortName);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_level_util_get_info_from_course_num](#smlua_level_util_get_info_from_course_num)
-
-### Description
-Gets information on a custom level from `courseNum`
-
-### Lua Example
-`local CustomLevelInfoValue = smlua_level_util_get_info_from_course_num(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-[CustomLevelInfo](structs.md#CustomLevelInfo)
-
-### C Prototype
-`struct CustomLevelInfo* smlua_level_util_get_info_from_course_num(u8 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [level_register](#level_register)
-
-### Description
-Registers a fully custom level. Level ID begins at 50
-
-### Lua Example
-`local integerValue = level_register(scriptEntryName, courseNum, fullName, shortName, acousticReach, echoLevel1, echoLevel2, echoLevel3)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| scriptEntryName | `string` |
-| courseNum | `integer` |
-| fullName | `string` |
-| shortName | `string` |
-| acousticReach | `integer` |
-| echoLevel1 | `integer` |
-| echoLevel2 | `integer` |
-| echoLevel3 | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 level_register(const char* scriptEntryName, s16 courseNum, const char* fullName, const char* shortName, u32 acousticReach, u32 echoLevel1, u32 echoLevel2, u32 echoLevel3);`
-
-[:arrow_up_small:](#)
-
-
-
-## [level_is_vanilla_level](#level_is_vanilla_level)
-
-### Description
-Checks if `levelNum` is a vanilla level
-
-### Lua Example
-`local booleanValue = level_is_vanilla_level(levelNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| levelNum | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool level_is_vanilla_level(s16 levelNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_to_warpnode](#warp_to_warpnode)
-
-### Description
-Warps to `aWarpId` of `aArea` in `aLevel` during `aAct`
-
-### Lua Example
-`local booleanValue = warp_to_warpnode(aLevel, aArea, aAct, aWarpId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| aLevel | `integer` |
-| aArea | `integer` |
-| aAct | `integer` |
-| aWarpId | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_to_warpnode(s32 aLevel, s32 aArea, s32 aAct, s32 aWarpId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_to_level](#warp_to_level)
-
-### Description
-Warps to `aArea` of `aLevel` in `aAct`
-
-### Lua Example
-`local booleanValue = warp_to_level(aLevel, aArea, aAct)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| aLevel | `integer` |
-| aArea | `integer` |
-| aAct | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_to_level(s32 aLevel, s32 aArea, s32 aAct);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_restart_level](#warp_restart_level)
-
-### Description
-Restarts the current level
-
-### Lua Example
-`local booleanValue = warp_restart_level()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_restart_level(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_to_start_level](#warp_to_start_level)
-
-### Description
-Warps to the start level (Castle Grounds by default)
-
-### Lua Example
-`local booleanValue = warp_to_start_level()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_to_start_level(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_exit_level](#warp_exit_level)
-
-### Description
-Exits the current level after `aDelay`
-
-### Lua Example
-`local booleanValue = warp_exit_level(aDelay)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| aDelay | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_exit_level(s32 aDelay);`
-
-[:arrow_up_small:](#)
-
-
-
-## [warp_to_castle](#warp_to_castle)
-
-### Description
-Warps back to the castle from `aLevel`
-
-### Lua Example
-`local booleanValue = warp_to_castle(aLevel)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| aLevel | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool warp_to_castle(s32 aLevel);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from smlua_misc_utils.h
-
-
-
-
-## [get_network_area_timer](#get_network_area_timer)
-
-### Description
-Gets the current area's networked timer
-
-### Lua Example
-`local integerValue = get_network_area_timer()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u32 get_network_area_timer(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_area_update_counter](#get_area_update_counter)
-
-### Description
-Gets the area update counter incremented when objects are updated
-
-### Lua Example
-`local integerValue = get_area_update_counter()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u16 get_area_update_counter(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_temp_s32_pointer](#get_temp_s32_pointer)
-
-### Description
-Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`
-
-### Lua Example
-`local PointerValue = get_temp_s32_pointer(initialValue)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| initialValue | `integer` |
-
-### Returns
-- `Pointer` <`integer`>
-
-### C Prototype
-`s32* get_temp_s32_pointer(s32 initialValue);`
-
-[:arrow_up_small:](#)
-
-
-
-## [deref_s32_pointer](#deref_s32_pointer)
-
-### Description
-Gets the signed 32-bit integer value from `pointer`
-
-### Lua Example
-`local integerValue = deref_s32_pointer(pointer)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| pointer | `Pointer` <`integer`> |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 deref_s32_pointer(s32* pointer);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_popup_create_global](#djui_popup_create_global)
-
-### Description
-Creates a DJUI popup that is broadcasted to every client
-
-### Lua Example
-`djui_popup_create_global(message, lines)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| message | `string` |
-| lines | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void djui_popup_create_global(const char* message, int lines);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_is_popup_disabled](#djui_is_popup_disabled)
-
-### Description
-Returns if popups are disabled
-
-### Lua Example
-`local booleanValue = djui_is_popup_disabled()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool djui_is_popup_disabled(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_set_popup_disabled_override](#djui_set_popup_disabled_override)
-
-### Description
-Sets if popups are disabled
-
-### Lua Example
-`djui_set_popup_disabled_override(value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void djui_set_popup_disabled_override(bool value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_reset_popup_disabled_override](#djui_reset_popup_disabled_override)
-
-### Description
-Resets if popups are disabled
-
-### Lua Example
-`djui_reset_popup_disabled_override()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void djui_reset_popup_disabled_override(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_is_playerlist_open](#djui_is_playerlist_open)
-
-### Description
-Checks if the DJUI playerlist is open
-
-### Lua Example
-`local booleanValue = djui_is_playerlist_open()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool djui_is_playerlist_open(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_attempting_to_open_playerlist](#djui_attempting_to_open_playerlist)
-
-### Description
-Checks if the DJUI playerlist is attempting to be opened
-
-### Lua Example
-`local booleanValue = djui_attempting_to_open_playerlist()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool djui_attempting_to_open_playerlist(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_get_playerlist_page_index](#djui_get_playerlist_page_index)
-
-### Description
-Gets the DJUI playerlist's page index
-
-### Lua Example
-`local integerValue = djui_get_playerlist_page_index()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u8 djui_get_playerlist_page_index(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_menu_get_font](#djui_menu_get_font)
-
-### Description
-Gets the DJUI menu font
-
-### Lua Example
-`local enumValue = djui_menu_get_font()`
-
-### Parameters
-- None
-
-### Returns
-[enum DjuiFontType](constants.md#enum-DjuiFontType)
-
-### C Prototype
-`enum DjuiFontType djui_menu_get_font(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_menu_get_theme](#djui_menu_get_theme)
-
-### Description
-Gets the DJUI menu theme
-
-### Lua Example
-`local DjuiThemeValue = djui_menu_get_theme()`
-
-### Parameters
-- None
-
-### Returns
-[DjuiTheme](structs.md#DjuiTheme)
-
-### C Prototype
-`struct DjuiTheme* djui_menu_get_theme(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [djui_is_playerlist_ping_visible](#djui_is_playerlist_ping_visible)
-
-### Description
-Checks if the DJUI playerlist ping icon is visible
-
-### Lua Example
-`local booleanValue = djui_is_playerlist_ping_visible()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool djui_is_playerlist_ping_visible(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_dialog_box_state](#get_dialog_box_state)
-
-### Description
-Gets the current state of the dialog box
-
-### Lua Example
-`local integerValue = get_dialog_box_state()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s8 get_dialog_box_state(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_dialog_id](#get_dialog_id)
-
-### Description
-Gets the current dialog box ID
-
-### Lua Example
-`local integerValue = get_dialog_id()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 get_dialog_id(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_last_star_or_key](#get_last_star_or_key)
-
-### Description
-Gets if the last objective collected was a star (0) or a key (1)
-
-### Lua Example
-`local integerValue = get_last_star_or_key()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u8 get_last_star_or_key(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_last_star_or_key](#set_last_star_or_key)
-
-### Description
-Sets if the last objective collected was a star (0) or a key (1)
-
-### Lua Example
-`set_last_star_or_key(value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_last_star_or_key(u8 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_last_completed_course_num](#get_last_completed_course_num)
-
-### Description
-Gets the last course a star or key was collected in
-
-### Lua Example
-`local integerValue = get_last_completed_course_num()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u8 get_last_completed_course_num(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_last_completed_course_num](#set_last_completed_course_num)
-
-### Description
-Sets the last course a star or key was collected in
-
-### Lua Example
-`set_last_completed_course_num(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_last_completed_course_num(u8 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_last_completed_star_num](#get_last_completed_star_num)
-
-### Description
-Gets the last collected star's number (1-7)
-
-### Lua Example
-`local integerValue = get_last_completed_star_num()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u8 get_last_completed_star_num(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_last_completed_star_num](#set_last_completed_star_num)
-
-### Description
-Sets the last collected star's number (1-7)
-
-### Lua Example
-`set_last_completed_star_num(starNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| starNum | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_last_completed_star_num(u8 starNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_got_file_coin_hi_score](#get_got_file_coin_hi_score)
-
-### Description
-Checks if the save file's coin "HI SCORE" was obtained with the last star or key collection
-
-### Lua Example
-`local booleanValue = get_got_file_coin_hi_score()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool get_got_file_coin_hi_score(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_got_file_coin_hi_score](#set_got_file_coin_hi_score)
-
-### Description
-Sets if the save file's coin "HI SCORE" was obtained with the last star or key collection
-
-### Lua Example
-`set_got_file_coin_hi_score(value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_got_file_coin_hi_score(bool value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_save_file_modified](#get_save_file_modified)
-
-### Description
-Checks if the save file has been modified without saving
-
-### Lua Example
-`local booleanValue = get_save_file_modified()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool get_save_file_modified(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_save_file_modified](#set_save_file_modified)
-
-### Description
-Sets if the save file has been modified without saving
-
-### Lua Example
-`set_save_file_modified(value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_save_file_modified(bool value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_hide](#hud_hide)
-
-### Description
-Hides the HUD
-
-### Lua Example
-`hud_hide()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void hud_hide(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_show](#hud_show)
-
-### Description
-Shows the HUD
-
-### Lua Example
-`hud_show()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void hud_show(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_is_hidden](#hud_is_hidden)
-
-### Description
-Checks if the HUD is hidden
-
-### Lua Example
-`local booleanValue = hud_is_hidden()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool hud_is_hidden(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_get_value](#hud_get_value)
-
-### Description
-Gets a HUD display value
-
-### Lua Example
-`local integerValue = hud_get_value(type)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| type | [enum HudDisplayValue](constants.md#enum-HudDisplayValue) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 hud_get_value(enum HudDisplayValue type);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_set_value](#hud_set_value)
-
-### Description
-Sets a HUD display value
-
-### Lua Example
-`hud_set_value(type, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| type | [enum HudDisplayValue](constants.md#enum-HudDisplayValue) |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void hud_set_value(enum HudDisplayValue type, s32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_render_power_meter](#hud_render_power_meter)
-
-### Description
-Renders a power meter on the HUD
-
-### Lua Example
-`hud_render_power_meter(health, x, y, width, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| health | `integer` |
-| x | `number` |
-| y | `number` |
-| width | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_render_power_meter_interpolated](#hud_render_power_meter_interpolated)
-
-### Description
-Renders an interpolated power meter on the HUD
-
-### Lua Example
-`hud_render_power_meter_interpolated(health, prevX, prevY, prevWidth, prevHeight, x, y, width, height)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| health | `integer` |
-| prevX | `number` |
-| prevY | `number` |
-| prevWidth | `number` |
-| prevHeight | `number` |
-| x | `number` |
-| y | `number` |
-| width | `number` |
-| height | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_get_flash](#hud_get_flash)
-
-### Description
-Gets if the star counter on the HUD should flash
-
-### Lua Example
-`local integerValue = hud_get_flash()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s8 hud_get_flash(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [hud_set_flash](#hud_set_flash)
-
-### Description
-Sets if the star counter on the HUD should flash
-
-### Lua Example
-`hud_set_flash(value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void hud_set_flash(s8 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [act_select_hud_hide](#act_select_hud_hide)
-
-### Description
-Hides part of the Act Select HUD
-
-### Lua Example
-`act_select_hud_hide(part)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
-
-### Returns
-- None
-
-### C Prototype
-`void act_select_hud_hide(enum ActSelectHudPart part);`
-
-[:arrow_up_small:](#)
-
-
-
-## [act_select_hud_show](#act_select_hud_show)
-
-### Description
-Shows part of the Act Select HUD
-
-### Lua Example
-`act_select_hud_show(part)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
-
-### Returns
-- None
-
-### C Prototype
-`void act_select_hud_show(enum ActSelectHudPart part);`
-
-[:arrow_up_small:](#)
-
-
-
-## [act_select_hud_is_hidden](#act_select_hud_is_hidden)
-
-### Description
-Checks if part of the Act Select HUD is hidden
-
-### Lua Example
-`local booleanValue = act_select_hud_is_hidden(part)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool act_select_hud_is_hidden(enum ActSelectHudPart part);`
-
-[:arrow_up_small:](#)
-
-
-
-## [is_game_paused](#is_game_paused)
-
-### Description
-Checks if the game is paused
-
-### Lua Example
-`local booleanValue = is_game_paused()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool is_game_paused(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [is_transition_playing](#is_transition_playing)
-
-### Description
-Checks if a screen transition is playing
-
-### Lua Example
-`local booleanValue = is_transition_playing()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool is_transition_playing(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [allocate_mario_action](#allocate_mario_action)
-
-### Description
-Allocates an action ID with bitwise flags
-
-### Lua Example
-`local integerValue = allocate_mario_action(actFlags)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| actFlags | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`u32 allocate_mario_action(u32 actFlags);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_hand_foot_pos_x](#get_hand_foot_pos_x)
-
-### Description
-Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
-
-### Lua Example
-`local numberValue = get_hand_foot_pos_x(m, index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| index | `integer` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_hand_foot_pos_y](#get_hand_foot_pos_y)
-
-### Description
-Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but It is important to note that the positions are not updated off-screen
-
-### Lua Example
-`local numberValue = get_hand_foot_pos_y(m, index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| index | `integer` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_hand_foot_pos_y(struct MarioState* m, u8 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_hand_foot_pos_z](#get_hand_foot_pos_z)
-
-### Description
-Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
-
-### Lua Example
-`local numberValue = get_hand_foot_pos_z(m, index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| index | `integer` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_hand_foot_pos_z(struct MarioState* m, u8 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_mario_anim_part_pos](#get_mario_anim_part_pos)
-
-### Description
-Retrieves the animated part position associated to `animPart` from the MarioState `m` and stores it into `pos`. Returns `true` on success or `false` on failure
-
-### Lua Example
-`local booleanValue = get_mario_anim_part_pos(m, animPart, pos)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| m | [MarioState](structs.md#MarioState) |
-| animPart | `integer` |
-| pos | [Vec3f](structs.md#Vec3f) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool get_mario_anim_part_pos(struct MarioState *m, u32 animPart, OUT Vec3f pos);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_current_save_file_num](#get_current_save_file_num)
-
-### Description
-Gets the current save file number (1-indexed)
-
-### Lua Example
-`local integerValue = get_current_save_file_num()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 get_current_save_file_num(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [save_file_get_using_backup_slot](#save_file_get_using_backup_slot)
-
-### Description
-Checks if the save file is using its backup slot
-
-### Lua Example
-`local booleanValue = save_file_get_using_backup_slot()`
-
-### Parameters
-- None
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool save_file_get_using_backup_slot(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [save_file_set_using_backup_slot](#save_file_set_using_backup_slot)
-
-### Description
-Sets if the save file should use its backup slot
-
-### Lua Example
-`save_file_set_using_backup_slot(usingBackupSlot)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| usingBackupSlot | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void save_file_set_using_backup_slot(bool usingBackupSlot);`
-
-[:arrow_up_small:](#)
-
-
-
-## [movtexqc_register](#movtexqc_register)
-
-### Description
-Registers a custom moving texture entry (used for vanilla water boxes)
-
-### Lua Example
-`movtexqc_register(name, level, area, type)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| name | `string` |
-| level | `integer` |
-| area | `integer` |
-| type | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void movtexqc_register(const char* name, s16 level, s16 area, s16 type);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_water_level](#get_water_level)
-
-### Description
-Gets the water level in an area corresponding to `index` (0-indexed)
-
-### Lua Example
-`local integerValue = get_water_level(index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 get_water_level(u8 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_water_level](#set_water_level)
-
-### Description
-Sets the water level in an area corresponding to `index` (0-indexed)
-
-### Lua Example
-`set_water_level(index, height, sync)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-| height | `integer` |
-| sync | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_water_level(u8 index, s16 height, bool sync);`
-
-[:arrow_up_small:](#)
-
-
-
-## [course_is_main_course](#course_is_main_course)
-
-### Description
-Checks if a course is a main course and not the castle or secret levels
-
-### Lua Example
-`local booleanValue = course_is_main_course(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool course_is_main_course(u16 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_ttc_speed_setting](#get_ttc_speed_setting)
-
-### Description
-Gets TTC's speed setting
-
-### Lua Example
-`local integerValue = get_ttc_speed_setting()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 get_ttc_speed_setting(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_ttc_speed_setting](#set_ttc_speed_setting)
-
-### Description
-Sets TTC's speed setting (TTC_SPEED_*)
-
-### Lua Example
-`set_ttc_speed_setting(speed)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| speed | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_ttc_speed_setting(s16 speed);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_time](#get_time)
-
-### Description
-Gets the Unix Timestamp
-
-### Lua Example
-`local integerValue = get_time()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s64 get_time(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_date_and_time](#get_date_and_time)
-
-### Description
-Gets the system clock's date and time
-
-### Lua Example
-`local DateTimeValue = get_date_and_time()`
-
-### Parameters
-- None
-
-### Returns
-[DateTime](structs.md#DateTime)
-
-### C Prototype
-`struct DateTime* get_date_and_time(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_envfx](#get_envfx)
-
-### Description
-Gets the non overridden environment effect (e.g. snow)
-
-### Lua Example
-`local integerValue = get_envfx()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u16 get_envfx(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_override_envfx](#set_override_envfx)
-
-### Description
-Sets the override environment effect (e.g. snow)
-
-### Lua Example
-`set_override_envfx(envfx)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| envfx | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_override_envfx(s32 envfx);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_global_timer](#get_global_timer)
-
-### Description
-Gets the global timer that has been ticking at 30 frames per second since game boot
-
-### Lua Example
-`local integerValue = get_global_timer()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`u32 get_global_timer(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_dialog_response](#get_dialog_response)
-
-### Description
-Gets the choice selected inside of a dialog box (0-1)
-
-### Lua Example
-`local integerValue = get_dialog_response()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 get_dialog_response(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_local_discord_id](#get_local_discord_id)
-
-### Description
-Gets the local discord ID if it isn't disabled, otherwise "0" is returned
-
-### Lua Example
-`local stringValue = get_local_discord_id()`
-
-### Parameters
-- None
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* get_local_discord_id(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_coopnet_id](#get_coopnet_id)
-
-### Description
-Gets the CoopNet ID of a player with `localIndex` if CoopNet is being used and the player is connected, otherwise "-1" is returned
-
-### Lua Example
-`local stringValue = get_coopnet_id(localIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| localIndex | `integer` |
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* get_coopnet_id(s8 localIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_volume_master](#get_volume_master)
-
-### Description
-Gets the master volume level
-
-### Lua Example
-`local numberValue = get_volume_master()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_volume_master(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_volume_level](#get_volume_level)
-
-### Description
-Gets the volume level of music
-
-### Lua Example
-`local numberValue = get_volume_level()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_volume_level(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_volume_sfx](#get_volume_sfx)
-
-### Description
-Gets the volume level of sound effects
-
-### Lua Example
-`local numberValue = get_volume_sfx()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_volume_sfx(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_volume_env](#get_volume_env)
-
-### Description
-Gets the volume level of environment sounds effects
-
-### Lua Example
-`local numberValue = get_volume_env()`
-
-### Parameters
-- None
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 get_volume_env(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_volume_master](#set_volume_master)
-
-### Description
-Sets the master volume level
-
-### Lua Example
-`set_volume_master(volume)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| volume | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_volume_master(f32 volume);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_volume_level](#set_volume_level)
-
-### Description
-Sets the volume level of music
-
-### Lua Example
-`set_volume_level(volume)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| volume | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_volume_level(f32 volume);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_volume_sfx](#set_volume_sfx)
-
-### Description
-Sets the volume level of sound effects
-
-### Lua Example
-`set_volume_sfx(volume)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| volume | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_volume_sfx(f32 volume);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_volume_env](#set_volume_env)
-
-### Description
-Sets the volume level of environment sounds effects
-
-### Lua Example
-`set_volume_env(volume)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| volume | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_volume_env(f32 volume);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_environment_region](#get_environment_region)
-
-### Description
-Gets an environment region (gas/water boxes) height value
-
-### Lua Example
-`local integerValue = get_environment_region(index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 get_environment_region(u8 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_environment_region](#set_environment_region)
-
-### Description
-Sets an environment region (gas/water boxes) height value
-
-### Lua Example
-`set_environment_region(index, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_environment_region(u8 index, s16 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [mod_file_exists](#mod_file_exists)
-
-### Description
-Checks if a file exists inside of a mod
-
-### Lua Example
-`local booleanValue = mod_file_exists(filename)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| filename | `string` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool mod_file_exists(const char* filename);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_active_mod](#get_active_mod)
-
-### Description
-Gets the mod currently being processed
-
-### Lua Example
-`local ModValue = get_active_mod()`
-
-### Parameters
-- None
-
-### Returns
-[Mod](structs.md#Mod)
-
-### C Prototype
-`struct Mod* get_active_mod(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_window_title](#set_window_title)
-
-### Description
-Sets the window title to a custom title
-
-### Lua Example
-`set_window_title(title)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| title | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_window_title(const char* title);`
-
-[:arrow_up_small:](#)
-
-
-
-## [reset_window_title](#reset_window_title)
-
-### Description
-Resets the window title
-
-### Lua Example
-`reset_window_title()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void reset_window_title(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_os_name](#get_os_name)
-
-### Description
-Gets the name of the operating system the game is running on
-
-### Lua Example
-`local stringValue = get_os_name()`
-
-### Parameters
-- None
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* get_os_name(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_root](#geo_get_current_root)
-
-### Description
-Gets the current GraphNodeRoot
-
-### Lua Example
-`local GraphNodeRootValue = geo_get_current_root()`
-
-### Parameters
-- None
-
-### Returns
-[GraphNodeRoot](structs.md#GraphNodeRoot)
-
-### C Prototype
-`struct GraphNodeRoot* geo_get_current_root(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_master_list](#geo_get_current_master_list)
-
-### Description
-Gets the current GraphNodeMasterList
-
-### Lua Example
-`local GraphNodeMasterListValue = geo_get_current_master_list()`
-
-### Parameters
-- None
-
-### Returns
-[GraphNodeMasterList](structs.md#GraphNodeMasterList)
-
-### C Prototype
-`struct GraphNodeMasterList* geo_get_current_master_list(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_perspective](#geo_get_current_perspective)
-
-### Description
-Gets the current GraphNodePerspective
-
-### Lua Example
-`local GraphNodePerspectiveValue = geo_get_current_perspective()`
-
-### Parameters
-- None
-
-### Returns
-[GraphNodePerspective](structs.md#GraphNodePerspective)
-
-### C Prototype
-`struct GraphNodePerspective* geo_get_current_perspective(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_camera](#geo_get_current_camera)
-
-### Description
-Gets the current GraphNodeCamera
-
-### Lua Example
-`local GraphNodeCameraValue = geo_get_current_camera()`
-
-### Parameters
-- None
-
-### Returns
-[GraphNodeCamera](structs.md#GraphNodeCamera)
-
-### C Prototype
-`struct GraphNodeCamera* geo_get_current_camera(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_held_object](#geo_get_current_held_object)
-
-### Description
-Gets the current GraphNodeHeldObject
-
-### Lua Example
-`local GraphNodeHeldObjectValue = geo_get_current_held_object()`
-
-### Parameters
-- None
-
-### Returns
-[GraphNodeHeldObject](structs.md#GraphNodeHeldObject)
-
-### C Prototype
-`struct GraphNodeHeldObject* geo_get_current_held_object(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [texture_to_lua_table](#texture_to_lua_table)
-
-### Description
-Converts a texture's pixels to a Lua table. Returns nil if failed. Otherwise, returns a table as a pure memory buffer. Supports rgba16 and rgba32 textures
-
-### Lua Example
-`texture_to_lua_table(tex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| tex | `Pointer` <`Texture`> |
-
-### Returns
-- None
-
-### C Prototype
-`void texture_to_lua_table(const Texture *tex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_texture_name](#get_texture_name)
-
-### Description
-Gets the name of the provided texture pointer `tex`
-
-### Lua Example
-`local stringValue = get_texture_name(tex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| tex | `Pointer` <`Texture`> |
-
-### Returns
-- `string`
-
-### C Prototype
-`const char *get_texture_name(const Texture *tex);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from smlua_model_utils.h
-
-
-
-
-## [smlua_model_util_get_id](#smlua_model_util_get_id)
-
-### Description
-Gets the extended model ID for the `name` of a `GeoLayout`
-
-### Lua Example
-`local enumValue = smlua_model_util_get_id(name)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| name | `string` |
-
-### Returns
-[enum ModelExtendedId](constants.md#enum-ModelExtendedId)
-
-### C Prototype
-`enum ModelExtendedId smlua_model_util_get_id(const char* name);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from smlua_obj_utils.h
-
-
-
-
-## [spawn_sync_object](#spawn_sync_object)
-
-### Description
-Spawns a synchronized object at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
-
-### Lua Example
-`local ObjectValue = spawn_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-| objSetupFunction | `Lua Function` () |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object* spawn_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);`
-
-[:arrow_up_small:](#)
-
-
-
-## [spawn_non_sync_object](#spawn_non_sync_object)
-
-### Description
-Spawns a non-synchronized object at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
-
-### Lua Example
-`local ObjectValue = spawn_non_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-| objSetupFunction | `Lua Function` () |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object* spawn_non_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_has_behavior_id](#obj_has_behavior_id)
-
-### Description
-Checks if an object has `behaviorId`
-
-### Lua Example
-`local integerValue = obj_has_behavior_id(o, behaviorId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_has_behavior_id(struct Object *o, enum BehaviorId behaviorId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_has_model_extended](#obj_has_model_extended)
-
-### Description
-Checks if an object's model is equal to `modelId`
-
-### Lua Example
-`local integerValue = obj_has_model_extended(o, modelId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_has_model_extended(struct Object *o, enum ModelExtendedId modelId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_model_id_extended](#obj_get_model_id_extended)
-
-### Description
-Returns an object's extended model id
-
-### Lua Example
-`local enumValue = obj_get_model_id_extended(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-[enum ModelExtendedId](constants.md#enum-ModelExtendedId)
-
-### C Prototype
-`enum ModelExtendedId obj_get_model_id_extended(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_model_extended](#obj_set_model_extended)
-
-### Description
-Sets an object's model to `modelId`
-
-### Lua Example
-`obj_set_model_extended(o, modelId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_model_extended(struct Object *o, enum ModelExtendedId modelId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_trajectory](#get_trajectory)
-
-### Description
-Gets a trajectory by `name`
-
-### Lua Example
-`local PointerValue = get_trajectory(name)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| name | `string` |
-
-### Returns
-- `Pointer` <`Trajectory`>
-
-### C Prototype
-`Trajectory* get_trajectory(const char* name);`
-
-[:arrow_up_small:](#)
-
-
-
-## [geo_get_current_object](#geo_get_current_object)
-
-### Description
-When used in a geo function, retrieve the current processed object
-
-### Lua Example
-`local ObjectValue = geo_get_current_object()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *geo_get_current_object(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_current_object](#get_current_object)
-
-### Description
-Gets the object currently being processed
-
-### Lua Example
-`local ObjectValue = get_current_object()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *get_current_object(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_dialog_object](#get_dialog_object)
-
-### Description
-Gets the NPC object Mario is talking to
-
-### Lua Example
-`local ObjectValue = get_dialog_object()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *get_dialog_object(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_cutscene_focus](#get_cutscene_focus)
-
-### Description
-Gets the cutscene focus object
-
-### Lua Example
-`local ObjectValue = get_cutscene_focus()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *get_cutscene_focus(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_secondary_camera_focus](#get_secondary_camera_focus)
-
-### Description
-Gets the secondary camera focus object
-
-### Lua Example
-`local ObjectValue = get_secondary_camera_focus()`
-
-### Parameters
-- None
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *get_secondary_camera_focus(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_cutscene_focus](#set_cutscene_focus)
-
-### Description
-Sets the cutscene focus object
-
-### Lua Example
-`set_cutscene_focus(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void set_cutscene_focus(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_secondary_camera_focus](#set_secondary_camera_focus)
-
-### Description
-Sets the secondary camera focus object
-
-### Lua Example
-`set_secondary_camera_focus(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- None
-
-### C Prototype
-`void set_secondary_camera_focus(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_first](#obj_get_first)
-
-### Description
-Gets the first object in an object list
-
-### Lua Example
-`local ObjectValue = obj_get_first(objList)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| objList | [enum ObjectList](constants.md#enum-ObjectList) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_first(enum ObjectList objList);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_first_with_behavior_id](#obj_get_first_with_behavior_id)
-
-### Description
-Gets the first object loaded with `behaviorId`
-
-### Lua Example
-`local ObjectValue = obj_get_first_with_behavior_id(behaviorId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_first_with_behavior_id(enum BehaviorId behaviorId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_first_with_behavior_id_and_field_s32](#obj_get_first_with_behavior_id_and_field_s32)
-
-### Description
-Gets the first object loaded with `behaviorId` and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
-
-### Lua Example
-`local ObjectValue = obj_get_first_with_behavior_id_and_field_s32(behaviorId, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-| fieldIndex | `integer` |
-| value | `integer` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_first_with_behavior_id_and_field_s32(enum BehaviorId behaviorId, s32 fieldIndex, s32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_first_with_behavior_id_and_field_f32](#obj_get_first_with_behavior_id_and_field_f32)
-
-### Description
-Gets the first object loaded with `behaviorId` and object float field (look in `object_fields.h` to get the index of a field)
-
-### Lua Example
-`local ObjectValue = obj_get_first_with_behavior_id_and_field_f32(behaviorId, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-| fieldIndex | `integer` |
-| value | `number` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_first_with_behavior_id_and_field_f32(enum BehaviorId behaviorId, s32 fieldIndex, f32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_next](#obj_get_next)
-
-### Description
-Gets the next object in an object list
-
-### Lua Example
-`local ObjectValue = obj_get_next(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_next(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_next_with_same_behavior_id](#obj_get_next_with_same_behavior_id)
-
-### Description
-Gets the next object loaded with the same behavior ID
-
-### Lua Example
-`local ObjectValue = obj_get_next_with_same_behavior_id(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_next_with_same_behavior_id(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_next_with_same_behavior_id_and_field_s32](#obj_get_next_with_same_behavior_id_and_field_s32)
-
-### Description
-Gets the next object loaded with the same behavior ID and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
-
-### Lua Example
-`local ObjectValue = obj_get_next_with_same_behavior_id_and_field_s32(o, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| value | `integer` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_next_with_same_behavior_id_and_field_s32(struct Object *o, s32 fieldIndex, s32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_next_with_same_behavior_id_and_field_f32](#obj_get_next_with_same_behavior_id_and_field_f32)
-
-### Description
-Gets the next object loaded with the same behavior ID and object float field (look in `object_fields.h` to get the index of a field)
-
-### Lua Example
-`local ObjectValue = obj_get_next_with_same_behavior_id_and_field_f32(o, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| value | `number` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_next_with_same_behavior_id_and_field_f32(struct Object *o, s32 fieldIndex, f32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_nearest_object_with_behavior_id](#obj_get_nearest_object_with_behavior_id)
-
-### Description
-Gets the nearest object with `behaviorId` to `o`
-
-### Lua Example
-`local ObjectValue = obj_get_nearest_object_with_behavior_id(o, behaviorId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_nearest_object_with_behavior_id(struct Object *o, enum BehaviorId behaviorId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_count_objects_with_behavior_id](#obj_count_objects_with_behavior_id)
-
-### Description
-Counts every object with `behaviorId`
-
-### Lua Example
-`local integerValue = obj_count_objects_with_behavior_id(behaviorId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_count_objects_with_behavior_id(enum BehaviorId behaviorId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_collided_object](#obj_get_collided_object)
-
-### Description
-Gets the corresponding collided object to an index from `o`
-
-### Lua Example
-`local ObjectValue = obj_get_collided_object(o, index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| index | `integer` |
-
-### Returns
-[Object](structs.md#Object)
-
-### C Prototype
-`struct Object *obj_get_collided_object(struct Object *o, s16 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_field_u32](#obj_get_field_u32)
-
-### Description
-Gets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`local integerValue = obj_get_field_u32(o, fieldIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`u32 obj_get_field_u32(struct Object *o, s32 fieldIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_field_s32](#obj_get_field_s32)
-
-### Description
-Gets the signed 32-bit integer value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`local integerValue = obj_get_field_s32(o, fieldIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 obj_get_field_s32(struct Object *o, s32 fieldIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_field_f32](#obj_get_field_f32)
-
-### Description
-Sets the float value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`local numberValue = obj_get_field_f32(o, fieldIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 obj_get_field_f32(struct Object *o, s32 fieldIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_field_s16](#obj_get_field_s16)
-
-### Description
-Gets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
-
-### Lua Example
-`local integerValue = obj_get_field_s16(o, fieldIndex, fieldSubIndex)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| fieldSubIndex | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s16 obj_get_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_field_u32](#obj_set_field_u32)
-
-### Description
-Sets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`obj_set_field_u32(o, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_field_u32(struct Object *o, s32 fieldIndex, u32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_field_s32](#obj_set_field_s32)
-
-### Description
-Sets the signed 32-bit integer value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`obj_set_field_s32(o, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_field_s32(struct Object *o, s32 fieldIndex, s32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_field_f32](#obj_set_field_f32)
-
-### Description
-Sets the float value from the field corresponding to `fieldIndex`
-
-### Lua Example
-`obj_set_field_f32(o, fieldIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| value | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_field_f32(struct Object *o, s32 fieldIndex, f32 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_field_s16](#obj_set_field_s16)
-
-### Description
-Sets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
-
-### Lua Example
-`obj_set_field_s16(o, fieldIndex, fieldSubIndex, value)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| fieldIndex | `integer` |
-| fieldSubIndex | `integer` |
-| value | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex, s16 value);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_get_temp_spawn_particles_info](#obj_get_temp_spawn_particles_info)
-
-### Description
-Returns a temporary particle spawn info pointer with its model loaded in from `modelId`
-
-### Lua Example
-`local SpawnParticlesInfoValue = obj_get_temp_spawn_particles_info(modelId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
-
-### Returns
-[SpawnParticlesInfo](structs.md#SpawnParticlesInfo)
-
-### C Prototype
-`struct SpawnParticlesInfo* obj_get_temp_spawn_particles_info(enum ModelExtendedId modelId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [get_temp_object_hitbox](#get_temp_object_hitbox)
-
-### Description
-Returns a temporary object hitbox pointer
-
-### Lua Example
-`local ObjectHitboxValue = get_temp_object_hitbox()`
-
-### Parameters
-- None
-
-### Returns
-[ObjectHitbox](structs.md#ObjectHitbox)
-
-### C Prototype
-`struct ObjectHitbox* get_temp_object_hitbox(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_attackable](#obj_is_attackable)
-
-### Description
-Checks if `o` is attackable
-
-### Lua Example
-`local booleanValue = obj_is_attackable(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_attackable(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_breakable_object](#obj_is_breakable_object)
-
-### Description
-Checks if `o` is breakable
-
-### Lua Example
-`local booleanValue = obj_is_breakable_object(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_breakable_object(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_bully](#obj_is_bully)
-
-### Description
-Checks if `o` is a Bully
-
-### Lua Example
-`local booleanValue = obj_is_bully(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_bully(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_coin](#obj_is_coin)
-
-### Description
-Checks if `o` is a coin
-
-### Lua Example
-`local booleanValue = obj_is_coin(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_coin(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_exclamation_box](#obj_is_exclamation_box)
-
-### Description
-Checks if `o` is an exclamation box
-
-### Lua Example
-`local booleanValue = obj_is_exclamation_box(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_exclamation_box(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_grabbable](#obj_is_grabbable)
-
-### Description
-Checks if `o` is grabbable
-
-### Lua Example
-`local booleanValue = obj_is_grabbable(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_grabbable(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_mushroom_1up](#obj_is_mushroom_1up)
-
-### Description
-Checks if `o` is a 1-Up Mushroom
-
-### Lua Example
-`local booleanValue = obj_is_mushroom_1up(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_mushroom_1up(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_secret](#obj_is_secret)
-
-### Description
-Checks if `o` is a secret
-
-### Lua Example
-`local booleanValue = obj_is_secret(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_secret(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_is_valid_for_interaction](#obj_is_valid_for_interaction)
-
-### Description
-Checks if `o` is activated, tangible, and interactible
-
-### Lua Example
-`local booleanValue = obj_is_valid_for_interaction(o)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_is_valid_for_interaction(struct Object *o);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_check_hitbox_overlap](#obj_check_hitbox_overlap)
-
-### Description
-Checks if `o1`'s hitbox is colliding with `o2`'s hitbox
-
-### Lua Example
-`local booleanValue = obj_check_hitbox_overlap(o1, o2)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o1 | [Object](structs.md#Object) |
-| o2 | [Object](structs.md#Object) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_check_hitbox_overlap(struct Object *o1, struct Object *o2);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_check_overlap_with_hitbox_params](#obj_check_overlap_with_hitbox_params)
-
-### Description
-Checks if `o`'s hitbox is colliding with the parameters of a hitbox
-
-### Lua Example
-`local booleanValue = obj_check_overlap_with_hitbox_params(o, x, y, z, h, r, d)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-| h | `number` |
-| r | `number` |
-| d | `number` |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool obj_check_overlap_with_hitbox_params(struct Object *o, f32 x, f32 y, f32 z, f32 h, f32 r, f32 d);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_set_vel](#obj_set_vel)
-
-### Description
-Sets an object's velocity to `vx`, `vy`, and `vz`
-
-### Lua Example
-`obj_set_vel(o, vx, vy, vz)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| vx | `number` |
-| vy | `number` |
-| vz | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_set_vel(struct Object *o, f32 vx, f32 vy, f32 vz);`
-
-[:arrow_up_small:](#)
-
-
-
-## [obj_move_xyz](#obj_move_xyz)
-
-### Description
-Moves the object in the direction of `dx`, `dy`, and `dz`
-
-### Lua Example
-`obj_move_xyz(o, dx, dy, dz)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| o | [Object](structs.md#Object) |
-| dx | `number` |
-| dy | `number` |
-| dz | `number` |
-
-### Returns
-- None
-
-### C Prototype
-`void obj_move_xyz(struct Object *o, f32 dx, f32 dy, f32 dz);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_whirlpools](#set_whirlpools)
-
-### Description
-Sets the parameters of one of the two whirlpools (0-indexed) in an area
-
-### Lua Example
-`set_whirlpools(x, y, z, strength, area, index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-| strength | `integer` |
-| area | `integer` |
-| index | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_whirlpools(f32 x, f32 y, f32 z, s16 strength, s16 area, s32 index);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from smlua_text_utils.h
-
-
-
-
-## [smlua_text_utils_reset_all](#smlua_text_utils_reset_all)
-
-### Description
-Resets every modified dialog back to vanilla
-
-### Lua Example
-`smlua_text_utils_reset_all()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_reset_all(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_dialog_get](#smlua_text_utils_dialog_get)
-
-### Description
-Gets the DialogEntry struct for the given `dialogId`
-
-### Lua Example
-`local DialogEntryValue = smlua_text_utils_dialog_get(dialogId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dialogId | [enum DialogId](constants.md#enum-DialogId) |
-
-### Returns
-[DialogEntry](structs.md#DialogEntry)
-
-### C Prototype
-`struct DialogEntry* smlua_text_utils_dialog_get(enum DialogId dialogId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_dialog_replace](#smlua_text_utils_dialog_replace)
-
-### Description
-Replaces `dialogId` with a custom one
-
-### Lua Example
-`smlua_text_utils_dialog_replace(dialogId, unused, linesPerBox, leftOffset, width, str)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dialogId | [enum DialogId](constants.md#enum-DialogId) |
-| unused | `integer` |
-| linesPerBox | `integer` |
-| leftOffset | `integer` |
-| width | `integer` |
-| str | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_dialog_replace(enum DialogId dialogId, u32 unused, s8 linesPerBox, s16 leftOffset, s16 width, const char* str);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_dialog_restore](#smlua_text_utils_dialog_restore)
-
-### Description
-Restores a replaced DialogEntry to its original state.
-
-### Lua Example
-`smlua_text_utils_dialog_restore(dialogId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dialogId | [enum DialogId](constants.md#enum-DialogId) |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_dialog_restore(enum DialogId dialogId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_dialog_is_replaced](#smlua_text_utils_dialog_is_replaced)
-
-### Description
-Returns whether the dialog with the given ID has been replaced
-
-### Lua Example
-`local booleanValue = smlua_text_utils_dialog_is_replaced(dialogId)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dialogId | [enum DialogId](constants.md#enum-DialogId) |
-
-### Returns
-- `boolean`
-
-### C Prototype
-`bool smlua_text_utils_dialog_is_replaced(enum DialogId dialogId);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_allocate_dialog](#smlua_text_utils_allocate_dialog)
-
-### Description
-Allocates a new dialog entry
-
-### Lua Example
-`local integerValue = smlua_text_utils_allocate_dialog()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 smlua_text_utils_allocate_dialog(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_course_acts_replace](#smlua_text_utils_course_acts_replace)
-
-### Description
-Replaces the act names of `courseNum`
-
-### Lua Example
-`smlua_text_utils_course_acts_replace(courseNum, courseName, act1, act2, act3, act4, act5, act6)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| courseName | `string` |
-| act1 | `string` |
-| act2 | `string` |
-| act3 | `string` |
-| act4 | `string` |
-| act5 | `string` |
-| act6 | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_course_acts_replace(s16 courseNum, const char* courseName, const char* act1, const char* act2, const char* act3, const char* act4, const char* act5, const char* act6);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_secret_star_replace](#smlua_text_utils_secret_star_replace)
-
-### Description
-Replaces the secret star course name of `courseNum` with `courseName`
-
-### Lua Example
-`smlua_text_utils_secret_star_replace(courseNum, courseName)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| courseName | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_secret_star_replace(s16 courseNum, const char* courseName);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_course_name_replace](#smlua_text_utils_course_name_replace)
-
-### Description
-Replaces the name of `courseNum` with `name`
-
-### Lua Example
-`smlua_text_utils_course_name_replace(courseNum, name)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| name | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_course_name_replace(s16 courseNum, const char* name);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_course_name_get](#smlua_text_utils_course_name_get)
-
-### Description
-Gets the name of `courseNum`
-
-### Lua Example
-`local stringValue = smlua_text_utils_course_name_get(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* smlua_text_utils_course_name_get(s16 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_course_name_mod_index](#smlua_text_utils_course_name_mod_index)
-
-### Description
-Gets the index of the mod that replaced the name of `courseNum`
-
-### Lua Example
-`local integerValue = smlua_text_utils_course_name_mod_index(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 smlua_text_utils_course_name_mod_index(s16 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_course_name_reset](#smlua_text_utils_course_name_reset)
-
-### Description
-Resets the name of `courseNum`
-
-### Lua Example
-`smlua_text_utils_course_name_reset(courseNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_course_name_reset(s16 courseNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_act_name_replace](#smlua_text_utils_act_name_replace)
-
-### Description
-Replaces the act name of `actNum` in `courseNum` with `name`
-
-### Lua Example
-`smlua_text_utils_act_name_replace(courseNum, actNum, name)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| actNum | `integer` |
-| name | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_act_name_replace(s16 courseNum, u8 actNum, const char* name);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_act_name_get](#smlua_text_utils_act_name_get)
-
-### Description
-Gets the act name of `actNum` in `courseNum`
-
-### Lua Example
-`local stringValue = smlua_text_utils_act_name_get(courseNum, actNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| actNum | `integer` |
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* smlua_text_utils_act_name_get(s16 courseNum, u8 actNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_act_name_mod_index](#smlua_text_utils_act_name_mod_index)
-
-### Description
-Gets the index of the mod that replaced the act name of `actNum` in `courseNum`
-
-### Lua Example
-`local integerValue = smlua_text_utils_act_name_mod_index(courseNum, actNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| actNum | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 smlua_text_utils_act_name_mod_index(s16 courseNum, u8 actNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_act_name_reset](#smlua_text_utils_act_name_reset)
-
-### Description
-Resets the act name of `actNum` in `courseNum`
-
-### Lua Example
-`smlua_text_utils_act_name_reset(courseNum, actNum)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| courseNum | `integer` |
-| actNum | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_act_name_reset(s16 courseNum, u8 actNum);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_castle_secret_stars_replace](#smlua_text_utils_castle_secret_stars_replace)
-
-### Description
-Replaces the castle secret stars text with `name`
-
-### Lua Example
-`smlua_text_utils_castle_secret_stars_replace(name)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| name | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_castle_secret_stars_replace(const char* name);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_castle_secret_stars_get](#smlua_text_utils_castle_secret_stars_get)
-
-### Description
-Gets the castle secret stars text
-
-### Lua Example
-`local stringValue = smlua_text_utils_castle_secret_stars_get()`
-
-### Parameters
-- None
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* smlua_text_utils_castle_secret_stars_get();`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_castle_secret_stars_mod_index](#smlua_text_utils_castle_secret_stars_mod_index)
-
-### Description
-Gets the index of the mod that replaced the castle secret stars text
-
-### Lua Example
-`local integerValue = smlua_text_utils_castle_secret_stars_mod_index()`
-
-### Parameters
-- None
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 smlua_text_utils_castle_secret_stars_mod_index();`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_castle_secret_stars_reset](#smlua_text_utils_castle_secret_stars_reset)
-
-### Description
-Resets the castle secret stars text
-
-### Lua Example
-`smlua_text_utils_castle_secret_stars_reset()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_castle_secret_stars_reset();`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_extra_text_replace](#smlua_text_utils_extra_text_replace)
-
-### Description
-Replace extra text (e.g. one of the castle's secret stars) with `text`
-
-### Lua Example
-`smlua_text_utils_extra_text_replace(index, text)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-| text | `string` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_extra_text_replace(s16 index, const char* text);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_extra_text_get](#smlua_text_utils_extra_text_get)
-
-### Description
-Gets the extra text at `index`
-
-### Lua Example
-`local stringValue = smlua_text_utils_extra_text_get(index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* smlua_text_utils_extra_text_get(s16 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_extra_text_mod_index](#smlua_text_utils_extra_text_mod_index)
-
-### Description
-Gets the index of the mod that replaced the extra text at `index`
-
-### Lua Example
-`local integerValue = smlua_text_utils_extra_text_mod_index(index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 smlua_text_utils_extra_text_mod_index(s16 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_extra_text_reset](#smlua_text_utils_extra_text_reset)
-
-### Description
-Resets the extra text at `index`
-
-### Lua Example
-`smlua_text_utils_extra_text_reset(index)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| index | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void smlua_text_utils_extra_text_reset(s16 index);`
-
-[:arrow_up_small:](#)
-
-
-
-## [smlua_text_utils_get_language](#smlua_text_utils_get_language)
-
-### Description
-Gets the current language
-
-### Lua Example
-`local stringValue = smlua_text_utils_get_language()`
-
-### Parameters
-- None
-
-### Returns
-- `string`
-
-### C Prototype
-`const char* smlua_text_utils_get_language(void);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from sound_init.h
-
-
-
-
-## [reset_volume](#reset_volume)
-
-### Description
-Resets if music volume has been lowered
-
-### Lua Example
-`reset_volume()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void reset_volume(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [raise_background_noise](#raise_background_noise)
-
-### Description
-Raises music volume back up to normal levels
-
-### Lua Example
-`raise_background_noise(a)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void raise_background_noise(s32 a);`
-
-[:arrow_up_small:](#)
-
-
-
-## [lower_background_noise](#lower_background_noise)
-
-### Description
-Lowers the volume of music by 40%
-
-### Lua Example
-`lower_background_noise(a)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void lower_background_noise(s32 a);`
-
-[:arrow_up_small:](#)
-
-
-
-## [disable_background_sound](#disable_background_sound)
-
-### Description
-Disables background soundbanks
-
-### Lua Example
-`disable_background_sound()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void disable_background_sound(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [enable_background_sound](#enable_background_sound)
-
-### Description
-Enables background soundbanks
-
-### Lua Example
-`enable_background_sound()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void enable_background_sound(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_menu_sounds](#play_menu_sounds)
-
-### Description
-Play menu sounds from `SOUND_MENU_FLAG_*` constants and queues rumble if `SOUND_MENU_FLAG_LETGOMARIOFACE` is one of the flags
-
-### Lua Example
-`play_menu_sounds(soundMenuFlags)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| soundMenuFlags | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void play_menu_sounds(s16 soundMenuFlags);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_painting_eject_sound](#play_painting_eject_sound)
-
-### Description
-Plays the painting eject sound effect if it has not already been played
-
-### Lua Example
-`play_painting_eject_sound()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void play_painting_eject_sound(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_infinite_stairs_music](#play_infinite_stairs_music)
-
-### Description
-Plays the infinite stairs music if you're in the endless stairs room and have less than `gLevelValues.infiniteStairsRequirement` stars
-
-### Lua Example
-`play_infinite_stairs_music()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void play_infinite_stairs_music(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_background_music](#set_background_music)
-
-### Description
-Sets the background music to `seqArgs` on sequence player `a` with a fade in time of `fadeTimer`
-
-### Lua Example
-`set_background_music(a, seqArgs, fadeTimer)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| a | `integer` |
-| seqArgs | `integer` |
-| fadeTimer | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_background_music(u16 a, u16 seqArgs, s16 fadeTimer);`
-
-[:arrow_up_small:](#)
-
-
-
-## [fadeout_music](#fadeout_music)
-
-### Description
-Fades out level, shell, and cap music
-
-### Lua Example
-`fadeout_music(fadeOutTime)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| fadeOutTime | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void fadeout_music(s16 fadeOutTime);`
-
-[:arrow_up_small:](#)
-
-
-
-## [fadeout_level_music](#fadeout_level_music)
-
-### Description
-Fades out the level sequence player
-
-### Lua Example
-`fadeout_level_music(fadeTimer)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| fadeTimer | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void fadeout_level_music(s16 fadeTimer);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_cutscene_music](#play_cutscene_music)
-
-### Description
-Plays and sets the current music to `seqArgs`
-
-### Lua Example
-`play_cutscene_music(seqArgs)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| seqArgs | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void play_cutscene_music(u16 seqArgs);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_shell_music](#play_shell_music)
-
-### Description
-Plays shell music
-
-### Lua Example
-`play_shell_music()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void play_shell_music(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [stop_shell_music](#stop_shell_music)
-
-### Description
-Stops shell music completely
-
-### Lua Example
-`stop_shell_music()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void stop_shell_music(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [play_cap_music](#play_cap_music)
-
-### Description
-Plays `seqArgs` as cap music
-
-### Lua Example
-`play_cap_music(seqArgs)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| seqArgs | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void play_cap_music(u16 seqArgs);`
-
-[:arrow_up_small:](#)
-
-
-
-## [fadeout_cap_music](#fadeout_cap_music)
-
-### Description
-Fades out cap music
-
-### Lua Example
-`fadeout_cap_music()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void fadeout_cap_music(void);`
-
-[:arrow_up_small:](#)
-
-
-
-## [stop_cap_music](#stop_cap_music)
-
-### Description
-Stops cap music completely
-
-### Lua Example
-`stop_cap_music()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void stop_cap_music(void);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from spawn_sound.h
-
-
-
-
-## [cur_obj_play_sound_1](#cur_obj_play_sound_1)
-
-### Description
-Plays a sound if the current object is visible
-
-### Lua Example
-`cur_obj_play_sound_1(soundMagic)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| soundMagic | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_play_sound_1(s32 soundMagic);`
-
-[:arrow_up_small:](#)
-
-
-
-## [cur_obj_play_sound_2](#cur_obj_play_sound_2)
-
-### Description
-Plays a sound if the current object is visible and queues rumble for specific sounds
-
-### Lua Example
-`cur_obj_play_sound_2(soundMagic)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| soundMagic | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void cur_obj_play_sound_2(s32 soundMagic);`
-
-[:arrow_up_small:](#)
-
-
-
-## [create_sound_spawner](#create_sound_spawner)
-
-### Description
-Create a sound spawner for objects that need a sound play once. (Breakable walls, King Bobomb exploding, etc)
-
-### Lua Example
-`create_sound_spawner(soundMagic)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| soundMagic | `integer` |
-
-### Returns
-- None
-
-### C Prototype
-`void create_sound_spawner(s32 soundMagic);`
-
-[:arrow_up_small:](#)
-
-
-
-## [calc_dist_to_volume_range_1](#calc_dist_to_volume_range_1)
-
-### Description
-Unused vanilla function, calculates a volume based on `distance`. If `distance` is less than 500 then 127, if `distance` is greater than 1500 then 0, if `distance` is between 500 and 1500 then it ranges linearly from 60 to 124. What an even more strange and confusing function
-
-### Lua Example
-`local integerValue = calc_dist_to_volume_range_1(distance)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| distance | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 calc_dist_to_volume_range_1(f32 distance);`
-
-[:arrow_up_small:](#)
-
-
-
-## [calc_dist_to_volume_range_2](#calc_dist_to_volume_range_2)
-
-### Description
-Unused vanilla function, calculates a volume based on `distance`. If `distance` is less than 1300 then 127, if `distance` is greater than 2300 then 0, if `distance` is between 1300 and 2300 then it ranges linearly from 60 to 127. What a strange and confusing function
-
-### Lua Example
-`local integerValue = calc_dist_to_volume_range_2(distance)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| distance | `number` |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 calc_dist_to_volume_range_2(f32 distance);`
-
-[:arrow_up_small:](#)
-
-
-
----
-# functions from surface_collision.h
-
-
-
-
-## [find_wall_collisions](#find_wall_collisions)
-
-### Description
-Detects wall collisions at a given position and adjusts the position based on the walls found. Returns the number of wall collisions detected
-
-### Lua Example
-`local integerValue = find_wall_collisions(colData)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| colData | [WallCollisionData](structs.md#WallCollisionData) |
-
-### Returns
-- `integer`
-
-### C Prototype
-`s32 find_wall_collisions(struct WallCollisionData *colData);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_ceil_height](#find_ceil_height)
-
-### Description
-Finds the height of the highest ceiling above a given position (x, y, z). If no ceiling is found, returns the default height limit of `gLevelValues.cellHeightLimit`(20000 by default)
-
-### Lua Example
-`local numberValue = find_ceil_height(x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 find_ceil_height(f32 x, f32 y, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_floor_height](#find_floor_height)
-
-### Description
-Finds the height of the highest floor below a given position (x, y, z). If no floor is found, returns the default floor height of `gLevelValues.floorLowerLimit`(-11000 by default)
-
-### Lua Example
-`local numberValue = find_floor_height(x, y, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `number` |
-| y | `number` |
-| z | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 find_floor_height(f32 x, f32 y, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_water_level](#find_water_level)
-
-### Description
-Finds the height of water at a given position (x, z), if the position is within a water region. If no water is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
-
-### Lua Example
-`local numberValue = find_water_level(x, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `number` |
-| z | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 find_water_level(f32 x, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [find_poison_gas_level](#find_poison_gas_level)
-
-### Description
-Finds the height of the poison gas at a given position (x, z), if the position is within a gas region. If no gas is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
-
-### Lua Example
-`local numberValue = find_poison_gas_level(x, z)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| x | `number` |
-| z | `number` |
-
-### Returns
-- `number`
-
-### C Prototype
-`f32 find_poison_gas_level(f32 x, f32 z);`
-
-[:arrow_up_small:](#)
-
-
-
-## [set_find_wall_direction](#set_find_wall_direction)
-
-### Description
-Sets whether collision finding functions should check wall directions.
-
-### Lua Example
-`set_find_wall_direction(dir, active, airborne)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| dir | [Vec3f](structs.md#Vec3f) |
-| active | `boolean` |
-| airborne | `boolean` |
-
-### Returns
-- None
-
-### C Prototype
-`void set_find_wall_direction(Vec3f dir, bool active, bool airborne);`
-
-[:arrow_up_small:](#)
-
-
-
-## [closest_point_to_triangle](#closest_point_to_triangle)
-
-### Description
-Gets the closest point of the triangle to `src` and returns it in `out`.
-
-### Lua Example
-`closest_point_to_triangle(surf, src, out)`
-
-### Parameters
-| Field | Type |
-| ----- | ---- |
-| surf | [Surface](structs.md#Surface) |
-| src | [Vec3f](structs.md#Vec3f) |
-| out | [Vec3f](structs.md#Vec3f) |
-
-### Returns
-- None
-
-### C Prototype
-`void closest_point_to_triangle(struct Surface* surf, Vec3f src, OUT Vec3f out);`
-
-[:arrow_up_small:](#)
-
---
diff --git a/docs/lua/functions-7.md b/docs/lua/functions-7.md
index 3c6be9bb4..bfb92be17 100644
--- a/docs/lua/functions-7.md
+++ b/docs/lua/functions-7.md
@@ -5,6 +5,4644 @@
[< prev](functions-6.md) | [1](functions.md) | [2](functions-2.md) | [3](functions-3.md) | [4](functions-4.md) | [5](functions-5.md) | [6](functions-6.md) | 7]
+---
+# functions from smlua_level_utils.h
+
+
+
+
+## [smlua_level_util_change_area](#smlua_level_util_change_area)
+
+### Description
+Instantly changes the current area to `areaIndex`
+
+### Lua Example
+`smlua_level_util_change_area(areaIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| areaIndex | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_level_util_change_area(s32 areaIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_level_util_get_info](#smlua_level_util_get_info)
+
+### Description
+Gets information on a custom level from `levelNum`
+
+### Lua Example
+`local CustomLevelInfoValue = smlua_level_util_get_info(levelNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| levelNum | `integer` |
+
+### Returns
+[CustomLevelInfo](structs.md#CustomLevelInfo)
+
+### C Prototype
+`struct CustomLevelInfo* smlua_level_util_get_info(s16 levelNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_level_util_get_info_from_short_name](#smlua_level_util_get_info_from_short_name)
+
+### Description
+Gets information on a custom level from `shortName`
+
+### Lua Example
+`local CustomLevelInfoValue = smlua_level_util_get_info_from_short_name(shortName)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| shortName | `string` |
+
+### Returns
+[CustomLevelInfo](structs.md#CustomLevelInfo)
+
+### C Prototype
+`struct CustomLevelInfo* smlua_level_util_get_info_from_short_name(const char* shortName);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_level_util_get_info_from_course_num](#smlua_level_util_get_info_from_course_num)
+
+### Description
+Gets information on a custom level from `courseNum`
+
+### Lua Example
+`local CustomLevelInfoValue = smlua_level_util_get_info_from_course_num(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+[CustomLevelInfo](structs.md#CustomLevelInfo)
+
+### C Prototype
+`struct CustomLevelInfo* smlua_level_util_get_info_from_course_num(u8 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [level_register](#level_register)
+
+### Description
+Registers a fully custom level. Level ID begins at 50
+
+### Lua Example
+`local integerValue = level_register(scriptEntryName, courseNum, fullName, shortName, acousticReach, echoLevel1, echoLevel2, echoLevel3)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| scriptEntryName | `string` |
+| courseNum | `integer` |
+| fullName | `string` |
+| shortName | `string` |
+| acousticReach | `integer` |
+| echoLevel1 | `integer` |
+| echoLevel2 | `integer` |
+| echoLevel3 | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 level_register(const char* scriptEntryName, s16 courseNum, const char* fullName, const char* shortName, u32 acousticReach, u32 echoLevel1, u32 echoLevel2, u32 echoLevel3);`
+
+[:arrow_up_small:](#)
+
+
+
+## [level_is_vanilla_level](#level_is_vanilla_level)
+
+### Description
+Checks if `levelNum` is a vanilla level
+
+### Lua Example
+`local booleanValue = level_is_vanilla_level(levelNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| levelNum | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool level_is_vanilla_level(s16 levelNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_to_warpnode](#warp_to_warpnode)
+
+### Description
+Warps to `aWarpId` of `aArea` in `aLevel` during `aAct`
+
+### Lua Example
+`local booleanValue = warp_to_warpnode(aLevel, aArea, aAct, aWarpId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| aLevel | `integer` |
+| aArea | `integer` |
+| aAct | `integer` |
+| aWarpId | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_to_warpnode(s32 aLevel, s32 aArea, s32 aAct, s32 aWarpId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_to_level](#warp_to_level)
+
+### Description
+Warps to `aArea` of `aLevel` in `aAct`
+
+### Lua Example
+`local booleanValue = warp_to_level(aLevel, aArea, aAct)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| aLevel | `integer` |
+| aArea | `integer` |
+| aAct | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_to_level(s32 aLevel, s32 aArea, s32 aAct);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_restart_level](#warp_restart_level)
+
+### Description
+Restarts the current level
+
+### Lua Example
+`local booleanValue = warp_restart_level()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_restart_level(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_to_start_level](#warp_to_start_level)
+
+### Description
+Warps to the start level (Castle Grounds by default)
+
+### Lua Example
+`local booleanValue = warp_to_start_level()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_to_start_level(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_exit_level](#warp_exit_level)
+
+### Description
+Exits the current level after `aDelay`
+
+### Lua Example
+`local booleanValue = warp_exit_level(aDelay)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| aDelay | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_exit_level(s32 aDelay);`
+
+[:arrow_up_small:](#)
+
+
+
+## [warp_to_castle](#warp_to_castle)
+
+### Description
+Warps back to the castle from `aLevel`
+
+### Lua Example
+`local booleanValue = warp_to_castle(aLevel)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| aLevel | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool warp_to_castle(s32 aLevel);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from smlua_misc_utils.h
+
+
+
+
+## [get_network_area_timer](#get_network_area_timer)
+
+### Description
+Gets the current area's networked timer
+
+### Lua Example
+`local integerValue = get_network_area_timer()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u32 get_network_area_timer(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_area_update_counter](#get_area_update_counter)
+
+### Description
+Gets the area update counter incremented when objects are updated
+
+### Lua Example
+`local integerValue = get_area_update_counter()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u16 get_area_update_counter(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_temp_s32_pointer](#get_temp_s32_pointer)
+
+### Description
+Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`
+
+### Lua Example
+`local PointerValue = get_temp_s32_pointer(initialValue)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| initialValue | `integer` |
+
+### Returns
+- `Pointer` <`integer`>
+
+### C Prototype
+`s32* get_temp_s32_pointer(s32 initialValue);`
+
+[:arrow_up_small:](#)
+
+
+
+## [deref_s32_pointer](#deref_s32_pointer)
+
+### Description
+Gets the signed 32-bit integer value from `pointer`
+
+### Lua Example
+`local integerValue = deref_s32_pointer(pointer)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| pointer | `Pointer` <`integer`> |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 deref_s32_pointer(s32* pointer);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_popup_create_global](#djui_popup_create_global)
+
+### Description
+Creates a DJUI popup that is broadcasted to every client
+
+### Lua Example
+`djui_popup_create_global(message, lines)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| message | `string` |
+| lines | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void djui_popup_create_global(const char* message, int lines);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_is_popup_disabled](#djui_is_popup_disabled)
+
+### Description
+Returns if popups are disabled
+
+### Lua Example
+`local booleanValue = djui_is_popup_disabled()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool djui_is_popup_disabled(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_set_popup_disabled_override](#djui_set_popup_disabled_override)
+
+### Description
+Sets if popups are disabled
+
+### Lua Example
+`djui_set_popup_disabled_override(value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void djui_set_popup_disabled_override(bool value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_reset_popup_disabled_override](#djui_reset_popup_disabled_override)
+
+### Description
+Resets if popups are disabled
+
+### Lua Example
+`djui_reset_popup_disabled_override()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void djui_reset_popup_disabled_override(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_is_playerlist_open](#djui_is_playerlist_open)
+
+### Description
+Checks if the DJUI playerlist is open
+
+### Lua Example
+`local booleanValue = djui_is_playerlist_open()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool djui_is_playerlist_open(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_attempting_to_open_playerlist](#djui_attempting_to_open_playerlist)
+
+### Description
+Checks if the DJUI playerlist is attempting to be opened
+
+### Lua Example
+`local booleanValue = djui_attempting_to_open_playerlist()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool djui_attempting_to_open_playerlist(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_get_playerlist_page_index](#djui_get_playerlist_page_index)
+
+### Description
+Gets the DJUI playerlist's page index
+
+### Lua Example
+`local integerValue = djui_get_playerlist_page_index()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u8 djui_get_playerlist_page_index(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_menu_get_font](#djui_menu_get_font)
+
+### Description
+Gets the DJUI menu font
+
+### Lua Example
+`local enumValue = djui_menu_get_font()`
+
+### Parameters
+- None
+
+### Returns
+[enum DjuiFontType](constants.md#enum-DjuiFontType)
+
+### C Prototype
+`enum DjuiFontType djui_menu_get_font(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_menu_get_theme](#djui_menu_get_theme)
+
+### Description
+Gets the DJUI menu theme
+
+### Lua Example
+`local DjuiThemeValue = djui_menu_get_theme()`
+
+### Parameters
+- None
+
+### Returns
+[DjuiTheme](structs.md#DjuiTheme)
+
+### C Prototype
+`struct DjuiTheme* djui_menu_get_theme(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [djui_is_playerlist_ping_visible](#djui_is_playerlist_ping_visible)
+
+### Description
+Checks if the DJUI playerlist ping icon is visible
+
+### Lua Example
+`local booleanValue = djui_is_playerlist_ping_visible()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool djui_is_playerlist_ping_visible(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_dialog_box_state](#get_dialog_box_state)
+
+### Description
+Gets the current state of the dialog box
+
+### Lua Example
+`local integerValue = get_dialog_box_state()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s8 get_dialog_box_state(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_dialog_id](#get_dialog_id)
+
+### Description
+Gets the current dialog box ID
+
+### Lua Example
+`local integerValue = get_dialog_id()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 get_dialog_id(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_last_star_or_key](#get_last_star_or_key)
+
+### Description
+Gets if the last objective collected was a star (0) or a key (1)
+
+### Lua Example
+`local integerValue = get_last_star_or_key()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u8 get_last_star_or_key(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_last_star_or_key](#set_last_star_or_key)
+
+### Description
+Sets if the last objective collected was a star (0) or a key (1)
+
+### Lua Example
+`set_last_star_or_key(value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_last_star_or_key(u8 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_last_completed_course_num](#get_last_completed_course_num)
+
+### Description
+Gets the last course a star or key was collected in
+
+### Lua Example
+`local integerValue = get_last_completed_course_num()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u8 get_last_completed_course_num(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_last_completed_course_num](#set_last_completed_course_num)
+
+### Description
+Sets the last course a star or key was collected in
+
+### Lua Example
+`set_last_completed_course_num(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_last_completed_course_num(u8 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_last_completed_star_num](#get_last_completed_star_num)
+
+### Description
+Gets the last collected star's number (1-7)
+
+### Lua Example
+`local integerValue = get_last_completed_star_num()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u8 get_last_completed_star_num(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_last_completed_star_num](#set_last_completed_star_num)
+
+### Description
+Sets the last collected star's number (1-7)
+
+### Lua Example
+`set_last_completed_star_num(starNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| starNum | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_last_completed_star_num(u8 starNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_got_file_coin_hi_score](#get_got_file_coin_hi_score)
+
+### Description
+Checks if the save file's coin "HI SCORE" was obtained with the last star or key collection
+
+### Lua Example
+`local booleanValue = get_got_file_coin_hi_score()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool get_got_file_coin_hi_score(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_got_file_coin_hi_score](#set_got_file_coin_hi_score)
+
+### Description
+Sets if the save file's coin "HI SCORE" was obtained with the last star or key collection
+
+### Lua Example
+`set_got_file_coin_hi_score(value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_got_file_coin_hi_score(bool value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_save_file_modified](#get_save_file_modified)
+
+### Description
+Checks if the save file has been modified without saving
+
+### Lua Example
+`local booleanValue = get_save_file_modified()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool get_save_file_modified(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_save_file_modified](#set_save_file_modified)
+
+### Description
+Sets if the save file has been modified without saving
+
+### Lua Example
+`set_save_file_modified(value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_save_file_modified(bool value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_hide](#hud_hide)
+
+### Description
+Hides the HUD
+
+### Lua Example
+`hud_hide()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void hud_hide(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_show](#hud_show)
+
+### Description
+Shows the HUD
+
+### Lua Example
+`hud_show()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void hud_show(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_is_hidden](#hud_is_hidden)
+
+### Description
+Checks if the HUD is hidden
+
+### Lua Example
+`local booleanValue = hud_is_hidden()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool hud_is_hidden(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_get_value](#hud_get_value)
+
+### Description
+Gets a HUD display value
+
+### Lua Example
+`local integerValue = hud_get_value(type)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| type | [enum HudDisplayValue](constants.md#enum-HudDisplayValue) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 hud_get_value(enum HudDisplayValue type);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_set_value](#hud_set_value)
+
+### Description
+Sets a HUD display value
+
+### Lua Example
+`hud_set_value(type, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| type | [enum HudDisplayValue](constants.md#enum-HudDisplayValue) |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void hud_set_value(enum HudDisplayValue type, s32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_render_power_meter](#hud_render_power_meter)
+
+### Description
+Renders a power meter on the HUD
+
+### Lua Example
+`hud_render_power_meter(health, x, y, width, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| health | `integer` |
+| x | `number` |
+| y | `number` |
+| width | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_render_power_meter_interpolated](#hud_render_power_meter_interpolated)
+
+### Description
+Renders an interpolated power meter on the HUD
+
+### Lua Example
+`hud_render_power_meter_interpolated(health, prevX, prevY, prevWidth, prevHeight, x, y, width, height)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| health | `integer` |
+| prevX | `number` |
+| prevY | `number` |
+| prevWidth | `number` |
+| prevHeight | `number` |
+| x | `number` |
+| y | `number` |
+| width | `number` |
+| height | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_get_flash](#hud_get_flash)
+
+### Description
+Gets if the star counter on the HUD should flash
+
+### Lua Example
+`local integerValue = hud_get_flash()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s8 hud_get_flash(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [hud_set_flash](#hud_set_flash)
+
+### Description
+Sets if the star counter on the HUD should flash
+
+### Lua Example
+`hud_set_flash(value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void hud_set_flash(s8 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [act_select_hud_hide](#act_select_hud_hide)
+
+### Description
+Hides part of the Act Select HUD
+
+### Lua Example
+`act_select_hud_hide(part)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
+
+### Returns
+- None
+
+### C Prototype
+`void act_select_hud_hide(enum ActSelectHudPart part);`
+
+[:arrow_up_small:](#)
+
+
+
+## [act_select_hud_show](#act_select_hud_show)
+
+### Description
+Shows part of the Act Select HUD
+
+### Lua Example
+`act_select_hud_show(part)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
+
+### Returns
+- None
+
+### C Prototype
+`void act_select_hud_show(enum ActSelectHudPart part);`
+
+[:arrow_up_small:](#)
+
+
+
+## [act_select_hud_is_hidden](#act_select_hud_is_hidden)
+
+### Description
+Checks if part of the Act Select HUD is hidden
+
+### Lua Example
+`local booleanValue = act_select_hud_is_hidden(part)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| part | [enum ActSelectHudPart](constants.md#enum-ActSelectHudPart) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool act_select_hud_is_hidden(enum ActSelectHudPart part);`
+
+[:arrow_up_small:](#)
+
+
+
+## [is_game_paused](#is_game_paused)
+
+### Description
+Checks if the game is paused
+
+### Lua Example
+`local booleanValue = is_game_paused()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool is_game_paused(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [is_transition_playing](#is_transition_playing)
+
+### Description
+Checks if a screen transition is playing
+
+### Lua Example
+`local booleanValue = is_transition_playing()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool is_transition_playing(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [allocate_mario_action](#allocate_mario_action)
+
+### Description
+Allocates an action ID with bitwise flags
+
+### Lua Example
+`local integerValue = allocate_mario_action(actFlags)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| actFlags | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`u32 allocate_mario_action(u32 actFlags);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_hand_foot_pos_x](#get_hand_foot_pos_x)
+
+### Description
+Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
+
+### Lua Example
+`local numberValue = get_hand_foot_pos_x(m, index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| index | `integer` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_hand_foot_pos_y](#get_hand_foot_pos_y)
+
+### Description
+Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but It is important to note that the positions are not updated off-screen
+
+### Lua Example
+`local numberValue = get_hand_foot_pos_y(m, index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| index | `integer` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_hand_foot_pos_y(struct MarioState* m, u8 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_hand_foot_pos_z](#get_hand_foot_pos_z)
+
+### Description
+Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
+
+### Lua Example
+`local numberValue = get_hand_foot_pos_z(m, index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| index | `integer` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_hand_foot_pos_z(struct MarioState* m, u8 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_mario_anim_part_pos](#get_mario_anim_part_pos)
+
+### Description
+Retrieves the animated part position associated to `animPart` from the MarioState `m` and stores it into `pos`. Returns `true` on success or `false` on failure
+
+### Lua Example
+`local booleanValue = get_mario_anim_part_pos(m, animPart, pos)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| m | [MarioState](structs.md#MarioState) |
+| animPart | `integer` |
+| pos | [Vec3f](structs.md#Vec3f) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool get_mario_anim_part_pos(struct MarioState *m, u32 animPart, OUT Vec3f pos);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_current_save_file_num](#get_current_save_file_num)
+
+### Description
+Gets the current save file number (1-indexed)
+
+### Lua Example
+`local integerValue = get_current_save_file_num()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 get_current_save_file_num(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [save_file_get_using_backup_slot](#save_file_get_using_backup_slot)
+
+### Description
+Checks if the save file is using its backup slot
+
+### Lua Example
+`local booleanValue = save_file_get_using_backup_slot()`
+
+### Parameters
+- None
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool save_file_get_using_backup_slot(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [save_file_set_using_backup_slot](#save_file_set_using_backup_slot)
+
+### Description
+Sets if the save file should use its backup slot
+
+### Lua Example
+`save_file_set_using_backup_slot(usingBackupSlot)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| usingBackupSlot | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void save_file_set_using_backup_slot(bool usingBackupSlot);`
+
+[:arrow_up_small:](#)
+
+
+
+## [movtexqc_register](#movtexqc_register)
+
+### Description
+Registers a custom moving texture entry (used for vanilla water boxes)
+
+### Lua Example
+`movtexqc_register(name, level, area, type)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| name | `string` |
+| level | `integer` |
+| area | `integer` |
+| type | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void movtexqc_register(const char* name, s16 level, s16 area, s16 type);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_water_level](#get_water_level)
+
+### Description
+Gets the water level in an area corresponding to `index` (0-indexed)
+
+### Lua Example
+`local integerValue = get_water_level(index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 get_water_level(u8 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_water_level](#set_water_level)
+
+### Description
+Sets the water level in an area corresponding to `index` (0-indexed)
+
+### Lua Example
+`set_water_level(index, height, sync)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+| height | `integer` |
+| sync | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_water_level(u8 index, s16 height, bool sync);`
+
+[:arrow_up_small:](#)
+
+
+
+## [course_is_main_course](#course_is_main_course)
+
+### Description
+Checks if a course is a main course and not the castle or secret levels
+
+### Lua Example
+`local booleanValue = course_is_main_course(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool course_is_main_course(u16 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_ttc_speed_setting](#get_ttc_speed_setting)
+
+### Description
+Gets TTC's speed setting
+
+### Lua Example
+`local integerValue = get_ttc_speed_setting()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 get_ttc_speed_setting(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_ttc_speed_setting](#set_ttc_speed_setting)
+
+### Description
+Sets TTC's speed setting (TTC_SPEED_*)
+
+### Lua Example
+`set_ttc_speed_setting(speed)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| speed | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_ttc_speed_setting(s16 speed);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_time](#get_time)
+
+### Description
+Gets the Unix Timestamp
+
+### Lua Example
+`local integerValue = get_time()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s64 get_time(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_date_and_time](#get_date_and_time)
+
+### Description
+Gets the system clock's date and time
+
+### Lua Example
+`local DateTimeValue = get_date_and_time()`
+
+### Parameters
+- None
+
+### Returns
+[DateTime](structs.md#DateTime)
+
+### C Prototype
+`struct DateTime* get_date_and_time(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_envfx](#get_envfx)
+
+### Description
+Gets the non overridden environment effect (e.g. snow)
+
+### Lua Example
+`local integerValue = get_envfx()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u16 get_envfx(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_override_envfx](#set_override_envfx)
+
+### Description
+Sets the override environment effect (e.g. snow)
+
+### Lua Example
+`set_override_envfx(envfx)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| envfx | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_override_envfx(s32 envfx);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_global_timer](#get_global_timer)
+
+### Description
+Gets the global timer that has been ticking at 30 frames per second since game boot
+
+### Lua Example
+`local integerValue = get_global_timer()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`u32 get_global_timer(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_dialog_response](#get_dialog_response)
+
+### Description
+Gets the choice selected inside of a dialog box (0-1)
+
+### Lua Example
+`local integerValue = get_dialog_response()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 get_dialog_response(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_local_discord_id](#get_local_discord_id)
+
+### Description
+Gets the local discord ID if it isn't disabled, otherwise "0" is returned
+
+### Lua Example
+`local stringValue = get_local_discord_id()`
+
+### Parameters
+- None
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* get_local_discord_id(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_coopnet_id](#get_coopnet_id)
+
+### Description
+Gets the CoopNet ID of a player with `localIndex` if CoopNet is being used and the player is connected, otherwise "-1" is returned
+
+### Lua Example
+`local stringValue = get_coopnet_id(localIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| localIndex | `integer` |
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* get_coopnet_id(s8 localIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_volume_master](#get_volume_master)
+
+### Description
+Gets the master volume level
+
+### Lua Example
+`local numberValue = get_volume_master()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_volume_master(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_volume_level](#get_volume_level)
+
+### Description
+Gets the volume level of music
+
+### Lua Example
+`local numberValue = get_volume_level()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_volume_level(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_volume_sfx](#get_volume_sfx)
+
+### Description
+Gets the volume level of sound effects
+
+### Lua Example
+`local numberValue = get_volume_sfx()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_volume_sfx(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_volume_env](#get_volume_env)
+
+### Description
+Gets the volume level of environment sounds effects
+
+### Lua Example
+`local numberValue = get_volume_env()`
+
+### Parameters
+- None
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 get_volume_env(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_volume_master](#set_volume_master)
+
+### Description
+Sets the master volume level
+
+### Lua Example
+`set_volume_master(volume)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| volume | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_volume_master(f32 volume);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_volume_level](#set_volume_level)
+
+### Description
+Sets the volume level of music
+
+### Lua Example
+`set_volume_level(volume)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| volume | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_volume_level(f32 volume);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_volume_sfx](#set_volume_sfx)
+
+### Description
+Sets the volume level of sound effects
+
+### Lua Example
+`set_volume_sfx(volume)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| volume | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_volume_sfx(f32 volume);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_volume_env](#set_volume_env)
+
+### Description
+Sets the volume level of environment sounds effects
+
+### Lua Example
+`set_volume_env(volume)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| volume | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_volume_env(f32 volume);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_environment_region](#get_environment_region)
+
+### Description
+Gets an environment region (gas/water boxes) height value
+
+### Lua Example
+`local integerValue = get_environment_region(index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 get_environment_region(u8 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_environment_region](#set_environment_region)
+
+### Description
+Sets an environment region (gas/water boxes) height value
+
+### Lua Example
+`set_environment_region(index, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_environment_region(u8 index, s16 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [mod_file_exists](#mod_file_exists)
+
+### Description
+Checks if a file exists inside of a mod
+
+### Lua Example
+`local booleanValue = mod_file_exists(filename)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| filename | `string` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool mod_file_exists(const char* filename);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_active_mod](#get_active_mod)
+
+### Description
+Gets the mod currently being processed
+
+### Lua Example
+`local ModValue = get_active_mod()`
+
+### Parameters
+- None
+
+### Returns
+[Mod](structs.md#Mod)
+
+### C Prototype
+`struct Mod* get_active_mod(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_window_title](#set_window_title)
+
+### Description
+Sets the window title to a custom title
+
+### Lua Example
+`set_window_title(title)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| title | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_window_title(const char* title);`
+
+[:arrow_up_small:](#)
+
+
+
+## [reset_window_title](#reset_window_title)
+
+### Description
+Resets the window title
+
+### Lua Example
+`reset_window_title()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void reset_window_title(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_os_name](#get_os_name)
+
+### Description
+Gets the name of the operating system the game is running on
+
+### Lua Example
+`local stringValue = get_os_name()`
+
+### Parameters
+- None
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* get_os_name(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_root](#geo_get_current_root)
+
+### Description
+Gets the current GraphNodeRoot
+
+### Lua Example
+`local GraphNodeRootValue = geo_get_current_root()`
+
+### Parameters
+- None
+
+### Returns
+[GraphNodeRoot](structs.md#GraphNodeRoot)
+
+### C Prototype
+`struct GraphNodeRoot* geo_get_current_root(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_master_list](#geo_get_current_master_list)
+
+### Description
+Gets the current GraphNodeMasterList
+
+### Lua Example
+`local GraphNodeMasterListValue = geo_get_current_master_list()`
+
+### Parameters
+- None
+
+### Returns
+[GraphNodeMasterList](structs.md#GraphNodeMasterList)
+
+### C Prototype
+`struct GraphNodeMasterList* geo_get_current_master_list(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_perspective](#geo_get_current_perspective)
+
+### Description
+Gets the current GraphNodePerspective
+
+### Lua Example
+`local GraphNodePerspectiveValue = geo_get_current_perspective()`
+
+### Parameters
+- None
+
+### Returns
+[GraphNodePerspective](structs.md#GraphNodePerspective)
+
+### C Prototype
+`struct GraphNodePerspective* geo_get_current_perspective(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_camera](#geo_get_current_camera)
+
+### Description
+Gets the current GraphNodeCamera
+
+### Lua Example
+`local GraphNodeCameraValue = geo_get_current_camera()`
+
+### Parameters
+- None
+
+### Returns
+[GraphNodeCamera](structs.md#GraphNodeCamera)
+
+### C Prototype
+`struct GraphNodeCamera* geo_get_current_camera(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_held_object](#geo_get_current_held_object)
+
+### Description
+Gets the current GraphNodeHeldObject
+
+### Lua Example
+`local GraphNodeHeldObjectValue = geo_get_current_held_object()`
+
+### Parameters
+- None
+
+### Returns
+[GraphNodeHeldObject](structs.md#GraphNodeHeldObject)
+
+### C Prototype
+`struct GraphNodeHeldObject* geo_get_current_held_object(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [texture_to_lua_table](#texture_to_lua_table)
+
+### Description
+Converts a texture's pixels to a Lua table. Returns nil if failed. Otherwise, returns a table as a pure memory buffer. Supports rgba16 and rgba32 textures
+
+### Lua Example
+`texture_to_lua_table(tex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| tex | `Pointer` <`Texture`> |
+
+### Returns
+- None
+
+### C Prototype
+`void texture_to_lua_table(const Texture *tex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_texture_name](#get_texture_name)
+
+### Description
+Gets the name of the provided texture pointer `tex`
+
+### Lua Example
+`local stringValue = get_texture_name(tex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| tex | `Pointer` <`Texture`> |
+
+### Returns
+- `string`
+
+### C Prototype
+`const char *get_texture_name(const Texture *tex);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from smlua_model_utils.h
+
+
+
+
+## [smlua_model_util_get_id](#smlua_model_util_get_id)
+
+### Description
+Gets the extended model ID for the `name` of a `GeoLayout`
+
+### Lua Example
+`local enumValue = smlua_model_util_get_id(name)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| name | `string` |
+
+### Returns
+[enum ModelExtendedId](constants.md#enum-ModelExtendedId)
+
+### C Prototype
+`enum ModelExtendedId smlua_model_util_get_id(const char* name);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from smlua_obj_utils.h
+
+
+
+
+## [spawn_sync_object](#spawn_sync_object)
+
+### Description
+Spawns a synchronized object at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
+
+### Lua Example
+`local ObjectValue = spawn_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+| objSetupFunction | `Lua Function` () |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object* spawn_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);`
+
+[:arrow_up_small:](#)
+
+
+
+## [spawn_non_sync_object](#spawn_non_sync_object)
+
+### Description
+Spawns a non-synchronized object at `x`, `y`, and `z` as a child object of the local Mario with his rotation. You can change the fields of the object in `objSetupFunction`
+
+### Lua Example
+`local ObjectValue = spawn_non_sync_object(behaviorId, modelId, x, y, z, objSetupFunction)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+| objSetupFunction | `Lua Function` () |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object* spawn_non_sync_object(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_has_behavior_id](#obj_has_behavior_id)
+
+### Description
+Checks if an object has `behaviorId`
+
+### Lua Example
+`local integerValue = obj_has_behavior_id(o, behaviorId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_has_behavior_id(struct Object *o, enum BehaviorId behaviorId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_has_model_extended](#obj_has_model_extended)
+
+### Description
+Checks if an object's model is equal to `modelId`
+
+### Lua Example
+`local integerValue = obj_has_model_extended(o, modelId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_has_model_extended(struct Object *o, enum ModelExtendedId modelId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_model_id_extended](#obj_get_model_id_extended)
+
+### Description
+Returns an object's extended model id
+
+### Lua Example
+`local enumValue = obj_get_model_id_extended(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+[enum ModelExtendedId](constants.md#enum-ModelExtendedId)
+
+### C Prototype
+`enum ModelExtendedId obj_get_model_id_extended(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_model_extended](#obj_set_model_extended)
+
+### Description
+Sets an object's model to `modelId`
+
+### Lua Example
+`obj_set_model_extended(o, modelId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_model_extended(struct Object *o, enum ModelExtendedId modelId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_trajectory](#get_trajectory)
+
+### Description
+Gets a trajectory by `name`
+
+### Lua Example
+`local PointerValue = get_trajectory(name)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| name | `string` |
+
+### Returns
+- `Pointer` <`Trajectory`>
+
+### C Prototype
+`Trajectory* get_trajectory(const char* name);`
+
+[:arrow_up_small:](#)
+
+
+
+## [geo_get_current_object](#geo_get_current_object)
+
+### Description
+When used in a geo function, retrieve the current processed object
+
+### Lua Example
+`local ObjectValue = geo_get_current_object()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *geo_get_current_object(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_current_object](#get_current_object)
+
+### Description
+Gets the object currently being processed
+
+### Lua Example
+`local ObjectValue = get_current_object()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *get_current_object(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_dialog_object](#get_dialog_object)
+
+### Description
+Gets the NPC object Mario is talking to
+
+### Lua Example
+`local ObjectValue = get_dialog_object()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *get_dialog_object(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_cutscene_focus](#get_cutscene_focus)
+
+### Description
+Gets the cutscene focus object
+
+### Lua Example
+`local ObjectValue = get_cutscene_focus()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *get_cutscene_focus(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_secondary_camera_focus](#get_secondary_camera_focus)
+
+### Description
+Gets the secondary camera focus object
+
+### Lua Example
+`local ObjectValue = get_secondary_camera_focus()`
+
+### Parameters
+- None
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *get_secondary_camera_focus(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_cutscene_focus](#set_cutscene_focus)
+
+### Description
+Sets the cutscene focus object
+
+### Lua Example
+`set_cutscene_focus(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void set_cutscene_focus(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_secondary_camera_focus](#set_secondary_camera_focus)
+
+### Description
+Sets the secondary camera focus object
+
+### Lua Example
+`set_secondary_camera_focus(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- None
+
+### C Prototype
+`void set_secondary_camera_focus(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_first](#obj_get_first)
+
+### Description
+Gets the first object in an object list
+
+### Lua Example
+`local ObjectValue = obj_get_first(objList)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| objList | [enum ObjectList](constants.md#enum-ObjectList) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_first(enum ObjectList objList);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_first_with_behavior_id](#obj_get_first_with_behavior_id)
+
+### Description
+Gets the first object loaded with `behaviorId`
+
+### Lua Example
+`local ObjectValue = obj_get_first_with_behavior_id(behaviorId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_first_with_behavior_id(enum BehaviorId behaviorId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_first_with_behavior_id_and_field_s32](#obj_get_first_with_behavior_id_and_field_s32)
+
+### Description
+Gets the first object loaded with `behaviorId` and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
+
+### Lua Example
+`local ObjectValue = obj_get_first_with_behavior_id_and_field_s32(behaviorId, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+| fieldIndex | `integer` |
+| value | `integer` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_first_with_behavior_id_and_field_s32(enum BehaviorId behaviorId, s32 fieldIndex, s32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_first_with_behavior_id_and_field_f32](#obj_get_first_with_behavior_id_and_field_f32)
+
+### Description
+Gets the first object loaded with `behaviorId` and object float field (look in `object_fields.h` to get the index of a field)
+
+### Lua Example
+`local ObjectValue = obj_get_first_with_behavior_id_and_field_f32(behaviorId, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+| fieldIndex | `integer` |
+| value | `number` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_first_with_behavior_id_and_field_f32(enum BehaviorId behaviorId, s32 fieldIndex, f32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_next](#obj_get_next)
+
+### Description
+Gets the next object in an object list
+
+### Lua Example
+`local ObjectValue = obj_get_next(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_next(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_next_with_same_behavior_id](#obj_get_next_with_same_behavior_id)
+
+### Description
+Gets the next object loaded with the same behavior ID
+
+### Lua Example
+`local ObjectValue = obj_get_next_with_same_behavior_id(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_next_with_same_behavior_id(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_next_with_same_behavior_id_and_field_s32](#obj_get_next_with_same_behavior_id_and_field_s32)
+
+### Description
+Gets the next object loaded with the same behavior ID and object signed 32-bit integer field (look in `object_fields.h` to get the index of a field)
+
+### Lua Example
+`local ObjectValue = obj_get_next_with_same_behavior_id_and_field_s32(o, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| value | `integer` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_next_with_same_behavior_id_and_field_s32(struct Object *o, s32 fieldIndex, s32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_next_with_same_behavior_id_and_field_f32](#obj_get_next_with_same_behavior_id_and_field_f32)
+
+### Description
+Gets the next object loaded with the same behavior ID and object float field (look in `object_fields.h` to get the index of a field)
+
+### Lua Example
+`local ObjectValue = obj_get_next_with_same_behavior_id_and_field_f32(o, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| value | `number` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_next_with_same_behavior_id_and_field_f32(struct Object *o, s32 fieldIndex, f32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_nearest_object_with_behavior_id](#obj_get_nearest_object_with_behavior_id)
+
+### Description
+Gets the nearest object with `behaviorId` to `o`
+
+### Lua Example
+`local ObjectValue = obj_get_nearest_object_with_behavior_id(o, behaviorId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_nearest_object_with_behavior_id(struct Object *o, enum BehaviorId behaviorId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_count_objects_with_behavior_id](#obj_count_objects_with_behavior_id)
+
+### Description
+Counts every object with `behaviorId`
+
+### Lua Example
+`local integerValue = obj_count_objects_with_behavior_id(behaviorId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| behaviorId | [enum BehaviorId](constants.md#enum-BehaviorId) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_count_objects_with_behavior_id(enum BehaviorId behaviorId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_collided_object](#obj_get_collided_object)
+
+### Description
+Gets the corresponding collided object to an index from `o`
+
+### Lua Example
+`local ObjectValue = obj_get_collided_object(o, index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| index | `integer` |
+
+### Returns
+[Object](structs.md#Object)
+
+### C Prototype
+`struct Object *obj_get_collided_object(struct Object *o, s16 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_field_u32](#obj_get_field_u32)
+
+### Description
+Gets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`local integerValue = obj_get_field_u32(o, fieldIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`u32 obj_get_field_u32(struct Object *o, s32 fieldIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_field_s32](#obj_get_field_s32)
+
+### Description
+Gets the signed 32-bit integer value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`local integerValue = obj_get_field_s32(o, fieldIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 obj_get_field_s32(struct Object *o, s32 fieldIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_field_f32](#obj_get_field_f32)
+
+### Description
+Sets the float value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`local numberValue = obj_get_field_f32(o, fieldIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 obj_get_field_f32(struct Object *o, s32 fieldIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_field_s16](#obj_get_field_s16)
+
+### Description
+Gets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
+
+### Lua Example
+`local integerValue = obj_get_field_s16(o, fieldIndex, fieldSubIndex)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| fieldSubIndex | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s16 obj_get_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_field_u32](#obj_set_field_u32)
+
+### Description
+Sets the unsigned 32-bit integer value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`obj_set_field_u32(o, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_field_u32(struct Object *o, s32 fieldIndex, u32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_field_s32](#obj_set_field_s32)
+
+### Description
+Sets the signed 32-bit integer value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`obj_set_field_s32(o, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_field_s32(struct Object *o, s32 fieldIndex, s32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_field_f32](#obj_set_field_f32)
+
+### Description
+Sets the float value from the field corresponding to `fieldIndex`
+
+### Lua Example
+`obj_set_field_f32(o, fieldIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| value | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_field_f32(struct Object *o, s32 fieldIndex, f32 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_field_s16](#obj_set_field_s16)
+
+### Description
+Sets the signed 32-bit integer value from the sub field corresponding to `fieldSubIndex` from the field corresponding to `fieldIndex`
+
+### Lua Example
+`obj_set_field_s16(o, fieldIndex, fieldSubIndex, value)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| fieldIndex | `integer` |
+| fieldSubIndex | `integer` |
+| value | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_field_s16(struct Object *o, s32 fieldIndex, s32 fieldSubIndex, s16 value);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_get_temp_spawn_particles_info](#obj_get_temp_spawn_particles_info)
+
+### Description
+Returns a temporary particle spawn info pointer with its model loaded in from `modelId`
+
+### Lua Example
+`local SpawnParticlesInfoValue = obj_get_temp_spawn_particles_info(modelId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| modelId | [enum ModelExtendedId](constants.md#enum-ModelExtendedId) |
+
+### Returns
+[SpawnParticlesInfo](structs.md#SpawnParticlesInfo)
+
+### C Prototype
+`struct SpawnParticlesInfo* obj_get_temp_spawn_particles_info(enum ModelExtendedId modelId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [get_temp_object_hitbox](#get_temp_object_hitbox)
+
+### Description
+Returns a temporary object hitbox pointer
+
+### Lua Example
+`local ObjectHitboxValue = get_temp_object_hitbox()`
+
+### Parameters
+- None
+
+### Returns
+[ObjectHitbox](structs.md#ObjectHitbox)
+
+### C Prototype
+`struct ObjectHitbox* get_temp_object_hitbox(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_attackable](#obj_is_attackable)
+
+### Description
+Checks if `o` is attackable
+
+### Lua Example
+`local booleanValue = obj_is_attackable(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_attackable(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_breakable_object](#obj_is_breakable_object)
+
+### Description
+Checks if `o` is breakable
+
+### Lua Example
+`local booleanValue = obj_is_breakable_object(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_breakable_object(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_bully](#obj_is_bully)
+
+### Description
+Checks if `o` is a Bully
+
+### Lua Example
+`local booleanValue = obj_is_bully(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_bully(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_coin](#obj_is_coin)
+
+### Description
+Checks if `o` is a coin
+
+### Lua Example
+`local booleanValue = obj_is_coin(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_coin(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_exclamation_box](#obj_is_exclamation_box)
+
+### Description
+Checks if `o` is an exclamation box
+
+### Lua Example
+`local booleanValue = obj_is_exclamation_box(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_exclamation_box(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_grabbable](#obj_is_grabbable)
+
+### Description
+Checks if `o` is grabbable
+
+### Lua Example
+`local booleanValue = obj_is_grabbable(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_grabbable(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_mushroom_1up](#obj_is_mushroom_1up)
+
+### Description
+Checks if `o` is a 1-Up Mushroom
+
+### Lua Example
+`local booleanValue = obj_is_mushroom_1up(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_mushroom_1up(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_secret](#obj_is_secret)
+
+### Description
+Checks if `o` is a secret
+
+### Lua Example
+`local booleanValue = obj_is_secret(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_secret(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_is_valid_for_interaction](#obj_is_valid_for_interaction)
+
+### Description
+Checks if `o` is activated, tangible, and interactible
+
+### Lua Example
+`local booleanValue = obj_is_valid_for_interaction(o)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_is_valid_for_interaction(struct Object *o);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_check_hitbox_overlap](#obj_check_hitbox_overlap)
+
+### Description
+Checks if `o1`'s hitbox is colliding with `o2`'s hitbox
+
+### Lua Example
+`local booleanValue = obj_check_hitbox_overlap(o1, o2)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o1 | [Object](structs.md#Object) |
+| o2 | [Object](structs.md#Object) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_check_hitbox_overlap(struct Object *o1, struct Object *o2);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_check_overlap_with_hitbox_params](#obj_check_overlap_with_hitbox_params)
+
+### Description
+Checks if `o`'s hitbox is colliding with the parameters of a hitbox
+
+### Lua Example
+`local booleanValue = obj_check_overlap_with_hitbox_params(o, x, y, z, h, r, d)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+| h | `number` |
+| r | `number` |
+| d | `number` |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool obj_check_overlap_with_hitbox_params(struct Object *o, f32 x, f32 y, f32 z, f32 h, f32 r, f32 d);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_set_vel](#obj_set_vel)
+
+### Description
+Sets an object's velocity to `vx`, `vy`, and `vz`
+
+### Lua Example
+`obj_set_vel(o, vx, vy, vz)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| vx | `number` |
+| vy | `number` |
+| vz | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_set_vel(struct Object *o, f32 vx, f32 vy, f32 vz);`
+
+[:arrow_up_small:](#)
+
+
+
+## [obj_move_xyz](#obj_move_xyz)
+
+### Description
+Moves the object in the direction of `dx`, `dy`, and `dz`
+
+### Lua Example
+`obj_move_xyz(o, dx, dy, dz)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| o | [Object](structs.md#Object) |
+| dx | `number` |
+| dy | `number` |
+| dz | `number` |
+
+### Returns
+- None
+
+### C Prototype
+`void obj_move_xyz(struct Object *o, f32 dx, f32 dy, f32 dz);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_whirlpools](#set_whirlpools)
+
+### Description
+Sets the parameters of one of the two whirlpools (0-indexed) in an area
+
+### Lua Example
+`set_whirlpools(x, y, z, strength, area, index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+| strength | `integer` |
+| area | `integer` |
+| index | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_whirlpools(f32 x, f32 y, f32 z, s16 strength, s16 area, s32 index);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from smlua_text_utils.h
+
+
+
+
+## [smlua_text_utils_reset_all](#smlua_text_utils_reset_all)
+
+### Description
+Resets every modified dialog back to vanilla
+
+### Lua Example
+`smlua_text_utils_reset_all()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_reset_all(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_dialog_get](#smlua_text_utils_dialog_get)
+
+### Description
+Gets the DialogEntry struct for the given `dialogId`
+
+### Lua Example
+`local DialogEntryValue = smlua_text_utils_dialog_get(dialogId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dialogId | [enum DialogId](constants.md#enum-DialogId) |
+
+### Returns
+[DialogEntry](structs.md#DialogEntry)
+
+### C Prototype
+`struct DialogEntry* smlua_text_utils_dialog_get(enum DialogId dialogId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_dialog_replace](#smlua_text_utils_dialog_replace)
+
+### Description
+Replaces `dialogId` with a custom one
+
+### Lua Example
+`smlua_text_utils_dialog_replace(dialogId, unused, linesPerBox, leftOffset, width, str)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dialogId | [enum DialogId](constants.md#enum-DialogId) |
+| unused | `integer` |
+| linesPerBox | `integer` |
+| leftOffset | `integer` |
+| width | `integer` |
+| str | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_dialog_replace(enum DialogId dialogId, u32 unused, s8 linesPerBox, s16 leftOffset, s16 width, const char* str);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_dialog_restore](#smlua_text_utils_dialog_restore)
+
+### Description
+Restores a replaced DialogEntry to its original state.
+
+### Lua Example
+`smlua_text_utils_dialog_restore(dialogId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dialogId | [enum DialogId](constants.md#enum-DialogId) |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_dialog_restore(enum DialogId dialogId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_dialog_is_replaced](#smlua_text_utils_dialog_is_replaced)
+
+### Description
+Returns whether the dialog with the given ID has been replaced
+
+### Lua Example
+`local booleanValue = smlua_text_utils_dialog_is_replaced(dialogId)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dialogId | [enum DialogId](constants.md#enum-DialogId) |
+
+### Returns
+- `boolean`
+
+### C Prototype
+`bool smlua_text_utils_dialog_is_replaced(enum DialogId dialogId);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_allocate_dialog](#smlua_text_utils_allocate_dialog)
+
+### Description
+Allocates a new dialog entry
+
+### Lua Example
+`local integerValue = smlua_text_utils_allocate_dialog()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 smlua_text_utils_allocate_dialog(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_course_acts_replace](#smlua_text_utils_course_acts_replace)
+
+### Description
+Replaces the act names of `courseNum`
+
+### Lua Example
+`smlua_text_utils_course_acts_replace(courseNum, courseName, act1, act2, act3, act4, act5, act6)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| courseName | `string` |
+| act1 | `string` |
+| act2 | `string` |
+| act3 | `string` |
+| act4 | `string` |
+| act5 | `string` |
+| act6 | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_course_acts_replace(s16 courseNum, const char* courseName, const char* act1, const char* act2, const char* act3, const char* act4, const char* act5, const char* act6);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_secret_star_replace](#smlua_text_utils_secret_star_replace)
+
+### Description
+Replaces the secret star course name of `courseNum` with `courseName`
+
+### Lua Example
+`smlua_text_utils_secret_star_replace(courseNum, courseName)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| courseName | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_secret_star_replace(s16 courseNum, const char* courseName);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_course_name_replace](#smlua_text_utils_course_name_replace)
+
+### Description
+Replaces the name of `courseNum` with `name`
+
+### Lua Example
+`smlua_text_utils_course_name_replace(courseNum, name)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| name | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_course_name_replace(s16 courseNum, const char* name);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_course_name_get](#smlua_text_utils_course_name_get)
+
+### Description
+Gets the name of `courseNum`
+
+### Lua Example
+`local stringValue = smlua_text_utils_course_name_get(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* smlua_text_utils_course_name_get(s16 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_course_name_mod_index](#smlua_text_utils_course_name_mod_index)
+
+### Description
+Gets the index of the mod that replaced the name of `courseNum`
+
+### Lua Example
+`local integerValue = smlua_text_utils_course_name_mod_index(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 smlua_text_utils_course_name_mod_index(s16 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_course_name_reset](#smlua_text_utils_course_name_reset)
+
+### Description
+Resets the name of `courseNum`
+
+### Lua Example
+`smlua_text_utils_course_name_reset(courseNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_course_name_reset(s16 courseNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_act_name_replace](#smlua_text_utils_act_name_replace)
+
+### Description
+Replaces the act name of `actNum` in `courseNum` with `name`
+
+### Lua Example
+`smlua_text_utils_act_name_replace(courseNum, actNum, name)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| actNum | `integer` |
+| name | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_act_name_replace(s16 courseNum, u8 actNum, const char* name);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_act_name_get](#smlua_text_utils_act_name_get)
+
+### Description
+Gets the act name of `actNum` in `courseNum`
+
+### Lua Example
+`local stringValue = smlua_text_utils_act_name_get(courseNum, actNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| actNum | `integer` |
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* smlua_text_utils_act_name_get(s16 courseNum, u8 actNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_act_name_mod_index](#smlua_text_utils_act_name_mod_index)
+
+### Description
+Gets the index of the mod that replaced the act name of `actNum` in `courseNum`
+
+### Lua Example
+`local integerValue = smlua_text_utils_act_name_mod_index(courseNum, actNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| actNum | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 smlua_text_utils_act_name_mod_index(s16 courseNum, u8 actNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_act_name_reset](#smlua_text_utils_act_name_reset)
+
+### Description
+Resets the act name of `actNum` in `courseNum`
+
+### Lua Example
+`smlua_text_utils_act_name_reset(courseNum, actNum)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| courseNum | `integer` |
+| actNum | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_act_name_reset(s16 courseNum, u8 actNum);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_castle_secret_stars_replace](#smlua_text_utils_castle_secret_stars_replace)
+
+### Description
+Replaces the castle secret stars text with `name`
+
+### Lua Example
+`smlua_text_utils_castle_secret_stars_replace(name)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| name | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_castle_secret_stars_replace(const char* name);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_castle_secret_stars_get](#smlua_text_utils_castle_secret_stars_get)
+
+### Description
+Gets the castle secret stars text
+
+### Lua Example
+`local stringValue = smlua_text_utils_castle_secret_stars_get()`
+
+### Parameters
+- None
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* smlua_text_utils_castle_secret_stars_get();`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_castle_secret_stars_mod_index](#smlua_text_utils_castle_secret_stars_mod_index)
+
+### Description
+Gets the index of the mod that replaced the castle secret stars text
+
+### Lua Example
+`local integerValue = smlua_text_utils_castle_secret_stars_mod_index()`
+
+### Parameters
+- None
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 smlua_text_utils_castle_secret_stars_mod_index();`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_castle_secret_stars_reset](#smlua_text_utils_castle_secret_stars_reset)
+
+### Description
+Resets the castle secret stars text
+
+### Lua Example
+`smlua_text_utils_castle_secret_stars_reset()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_castle_secret_stars_reset();`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_extra_text_replace](#smlua_text_utils_extra_text_replace)
+
+### Description
+Replace extra text (e.g. one of the castle's secret stars) with `text`
+
+### Lua Example
+`smlua_text_utils_extra_text_replace(index, text)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+| text | `string` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_extra_text_replace(s16 index, const char* text);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_extra_text_get](#smlua_text_utils_extra_text_get)
+
+### Description
+Gets the extra text at `index`
+
+### Lua Example
+`local stringValue = smlua_text_utils_extra_text_get(index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* smlua_text_utils_extra_text_get(s16 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_extra_text_mod_index](#smlua_text_utils_extra_text_mod_index)
+
+### Description
+Gets the index of the mod that replaced the extra text at `index`
+
+### Lua Example
+`local integerValue = smlua_text_utils_extra_text_mod_index(index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 smlua_text_utils_extra_text_mod_index(s16 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_extra_text_reset](#smlua_text_utils_extra_text_reset)
+
+### Description
+Resets the extra text at `index`
+
+### Lua Example
+`smlua_text_utils_extra_text_reset(index)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| index | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void smlua_text_utils_extra_text_reset(s16 index);`
+
+[:arrow_up_small:](#)
+
+
+
+## [smlua_text_utils_get_language](#smlua_text_utils_get_language)
+
+### Description
+Gets the current language
+
+### Lua Example
+`local stringValue = smlua_text_utils_get_language()`
+
+### Parameters
+- None
+
+### Returns
+- `string`
+
+### C Prototype
+`const char* smlua_text_utils_get_language(void);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from sound_init.h
+
+
+
+
+## [reset_volume](#reset_volume)
+
+### Description
+Resets if music volume has been lowered
+
+### Lua Example
+`reset_volume()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void reset_volume(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [raise_background_noise](#raise_background_noise)
+
+### Description
+Raises music volume back up to normal levels
+
+### Lua Example
+`raise_background_noise(a)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void raise_background_noise(s32 a);`
+
+[:arrow_up_small:](#)
+
+
+
+## [lower_background_noise](#lower_background_noise)
+
+### Description
+Lowers the volume of music by 40%
+
+### Lua Example
+`lower_background_noise(a)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void lower_background_noise(s32 a);`
+
+[:arrow_up_small:](#)
+
+
+
+## [disable_background_sound](#disable_background_sound)
+
+### Description
+Disables background soundbanks
+
+### Lua Example
+`disable_background_sound()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void disable_background_sound(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [enable_background_sound](#enable_background_sound)
+
+### Description
+Enables background soundbanks
+
+### Lua Example
+`enable_background_sound()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void enable_background_sound(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_menu_sounds](#play_menu_sounds)
+
+### Description
+Play menu sounds from `SOUND_MENU_FLAG_*` constants and queues rumble if `SOUND_MENU_FLAG_LETGOMARIOFACE` is one of the flags
+
+### Lua Example
+`play_menu_sounds(soundMenuFlags)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| soundMenuFlags | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void play_menu_sounds(s16 soundMenuFlags);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_painting_eject_sound](#play_painting_eject_sound)
+
+### Description
+Plays the painting eject sound effect if it has not already been played
+
+### Lua Example
+`play_painting_eject_sound()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void play_painting_eject_sound(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_infinite_stairs_music](#play_infinite_stairs_music)
+
+### Description
+Plays the infinite stairs music if you're in the endless stairs room and have less than `gLevelValues.infiniteStairsRequirement` stars
+
+### Lua Example
+`play_infinite_stairs_music()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void play_infinite_stairs_music(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_background_music](#set_background_music)
+
+### Description
+Sets the background music to `seqArgs` on sequence player `a` with a fade in time of `fadeTimer`
+
+### Lua Example
+`set_background_music(a, seqArgs, fadeTimer)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| a | `integer` |
+| seqArgs | `integer` |
+| fadeTimer | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_background_music(u16 a, u16 seqArgs, s16 fadeTimer);`
+
+[:arrow_up_small:](#)
+
+
+
+## [fadeout_music](#fadeout_music)
+
+### Description
+Fades out level, shell, and cap music
+
+### Lua Example
+`fadeout_music(fadeOutTime)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| fadeOutTime | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void fadeout_music(s16 fadeOutTime);`
+
+[:arrow_up_small:](#)
+
+
+
+## [fadeout_level_music](#fadeout_level_music)
+
+### Description
+Fades out the level sequence player
+
+### Lua Example
+`fadeout_level_music(fadeTimer)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| fadeTimer | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void fadeout_level_music(s16 fadeTimer);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_cutscene_music](#play_cutscene_music)
+
+### Description
+Plays and sets the current music to `seqArgs`
+
+### Lua Example
+`play_cutscene_music(seqArgs)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| seqArgs | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void play_cutscene_music(u16 seqArgs);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_shell_music](#play_shell_music)
+
+### Description
+Plays shell music
+
+### Lua Example
+`play_shell_music()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void play_shell_music(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [stop_shell_music](#stop_shell_music)
+
+### Description
+Stops shell music completely
+
+### Lua Example
+`stop_shell_music()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void stop_shell_music(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [play_cap_music](#play_cap_music)
+
+### Description
+Plays `seqArgs` as cap music
+
+### Lua Example
+`play_cap_music(seqArgs)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| seqArgs | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void play_cap_music(u16 seqArgs);`
+
+[:arrow_up_small:](#)
+
+
+
+## [fadeout_cap_music](#fadeout_cap_music)
+
+### Description
+Fades out cap music
+
+### Lua Example
+`fadeout_cap_music()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void fadeout_cap_music(void);`
+
+[:arrow_up_small:](#)
+
+
+
+## [stop_cap_music](#stop_cap_music)
+
+### Description
+Stops cap music completely
+
+### Lua Example
+`stop_cap_music()`
+
+### Parameters
+- None
+
+### Returns
+- None
+
+### C Prototype
+`void stop_cap_music(void);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from spawn_sound.h
+
+
+
+
+## [cur_obj_play_sound_1](#cur_obj_play_sound_1)
+
+### Description
+Plays a sound if the current object is visible
+
+### Lua Example
+`cur_obj_play_sound_1(soundMagic)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| soundMagic | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_play_sound_1(s32 soundMagic);`
+
+[:arrow_up_small:](#)
+
+
+
+## [cur_obj_play_sound_2](#cur_obj_play_sound_2)
+
+### Description
+Plays a sound if the current object is visible and queues rumble for specific sounds
+
+### Lua Example
+`cur_obj_play_sound_2(soundMagic)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| soundMagic | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void cur_obj_play_sound_2(s32 soundMagic);`
+
+[:arrow_up_small:](#)
+
+
+
+## [create_sound_spawner](#create_sound_spawner)
+
+### Description
+Create a sound spawner for objects that need a sound play once. (Breakable walls, King Bobomb exploding, etc)
+
+### Lua Example
+`create_sound_spawner(soundMagic)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| soundMagic | `integer` |
+
+### Returns
+- None
+
+### C Prototype
+`void create_sound_spawner(s32 soundMagic);`
+
+[:arrow_up_small:](#)
+
+
+
+## [calc_dist_to_volume_range_1](#calc_dist_to_volume_range_1)
+
+### Description
+Unused vanilla function, calculates a volume based on `distance`. If `distance` is less than 500 then 127, if `distance` is greater than 1500 then 0, if `distance` is between 500 and 1500 then it ranges linearly from 60 to 124. What an even more strange and confusing function
+
+### Lua Example
+`local integerValue = calc_dist_to_volume_range_1(distance)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| distance | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 calc_dist_to_volume_range_1(f32 distance);`
+
+[:arrow_up_small:](#)
+
+
+
+## [calc_dist_to_volume_range_2](#calc_dist_to_volume_range_2)
+
+### Description
+Unused vanilla function, calculates a volume based on `distance`. If `distance` is less than 1300 then 127, if `distance` is greater than 2300 then 0, if `distance` is between 1300 and 2300 then it ranges linearly from 60 to 127. What a strange and confusing function
+
+### Lua Example
+`local integerValue = calc_dist_to_volume_range_2(distance)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| distance | `number` |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 calc_dist_to_volume_range_2(f32 distance);`
+
+[:arrow_up_small:](#)
+
+
+
+---
+# functions from surface_collision.h
+
+
+
+
+## [find_wall_collisions](#find_wall_collisions)
+
+### Description
+Detects wall collisions at a given position and adjusts the position based on the walls found. Returns the number of wall collisions detected
+
+### Lua Example
+`local integerValue = find_wall_collisions(colData)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| colData | [WallCollisionData](structs.md#WallCollisionData) |
+
+### Returns
+- `integer`
+
+### C Prototype
+`s32 find_wall_collisions(struct WallCollisionData *colData);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_ceil_height](#find_ceil_height)
+
+### Description
+Finds the height of the highest ceiling above a given position (x, y, z). If no ceiling is found, returns the default height limit of `gLevelValues.cellHeightLimit`(20000 by default)
+
+### Lua Example
+`local numberValue = find_ceil_height(x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 find_ceil_height(f32 x, f32 y, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_floor_height](#find_floor_height)
+
+### Description
+Finds the height of the highest floor below a given position (x, y, z). If no floor is found, returns the default floor height of `gLevelValues.floorLowerLimit`(-11000 by default)
+
+### Lua Example
+`local numberValue = find_floor_height(x, y, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `number` |
+| y | `number` |
+| z | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 find_floor_height(f32 x, f32 y, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_water_level](#find_water_level)
+
+### Description
+Finds the height of water at a given position (x, z), if the position is within a water region. If no water is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
+
+### Lua Example
+`local numberValue = find_water_level(x, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `number` |
+| z | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 find_water_level(f32 x, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [find_poison_gas_level](#find_poison_gas_level)
+
+### Description
+Finds the height of the poison gas at a given position (x, z), if the position is within a gas region. If no gas is found, returns the default height of `gLevelValues.floorLowerLimit`(-11000 by default)
+
+### Lua Example
+`local numberValue = find_poison_gas_level(x, z)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| x | `number` |
+| z | `number` |
+
+### Returns
+- `number`
+
+### C Prototype
+`f32 find_poison_gas_level(f32 x, f32 z);`
+
+[:arrow_up_small:](#)
+
+
+
+## [set_find_wall_direction](#set_find_wall_direction)
+
+### Description
+Sets whether collision finding functions should check wall directions.
+
+### Lua Example
+`set_find_wall_direction(dir, active, airborne)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| dir | [Vec3f](structs.md#Vec3f) |
+| active | `boolean` |
+| airborne | `boolean` |
+
+### Returns
+- None
+
+### C Prototype
+`void set_find_wall_direction(Vec3f dir, bool active, bool airborne);`
+
+[:arrow_up_small:](#)
+
+
+
+## [closest_point_to_triangle](#closest_point_to_triangle)
+
+### Description
+Gets the closest point of the triangle to `src` and returns it in `out`.
+
+### Lua Example
+`closest_point_to_triangle(surf, src, out)`
+
+### Parameters
+| Field | Type |
+| ----- | ---- |
+| surf | [Surface](structs.md#Surface) |
+| src | [Vec3f](structs.md#Vec3f) |
+| out | [Vec3f](structs.md#Vec3f) |
+
+### Returns
+- None
+
+### C Prototype
+`void closest_point_to_triangle(struct Surface* surf, Vec3f src, OUT Vec3f out);`
+
+[:arrow_up_small:](#)
+
+
+
---
# functions from surface_load.h
diff --git a/docs/lua/functions.md b/docs/lua/functions.md
index 1783c3bae..9fe4cc414 100644
--- a/docs/lua/functions.md
+++ b/docs/lua/functions.md
@@ -1354,9 +1354,6 @@
- [mod_fs_get](functions-5.md#mod_fs_get)
- [mod_fs_reload](functions-5.md#mod_fs_reload)
- [mod_fs_create](functions-5.md#mod_fs_create)
- - [mod_fs_delete](functions-5.md#mod_fs_delete)
- - [mod_fs_save](functions-5.md#mod_fs_save)
- - [mod_fs_set_public](functions-5.md#mod_fs_set_public)
- [mod_fs_get_filename](functions-5.md#mod_fs_get_filename)
- [mod_fs_get_file](functions-5.md#mod_fs_get_file)
- [mod_fs_create_file](functions-5.md#mod_fs_create_file)
@@ -1364,6 +1361,9 @@
- [mod_fs_copy_file](functions-5.md#mod_fs_copy_file)
- [mod_fs_delete_file](functions-5.md#mod_fs_delete_file)
- [mod_fs_clear](functions-5.md#mod_fs_clear)
+ - [mod_fs_save](functions-5.md#mod_fs_save)
+ - [mod_fs_delete](functions-5.md#mod_fs_delete)
+ - [mod_fs_set_public](functions-5.md#mod_fs_set_public)
- [mod_fs_file_read_bool](functions-5.md#mod_fs_file_read_bool)
- [mod_fs_file_read_integer](functions-5.md#mod_fs_file_read_integer)
- [mod_fs_file_read_number](functions-5.md#mod_fs_file_read_number)
@@ -1377,9 +1377,11 @@
- [mod_fs_file_write_string](functions-5.md#mod_fs_file_write_string)
- [mod_fs_file_write_line](functions-5.md#mod_fs_file_write_line)
- [mod_fs_file_seek](functions-5.md#mod_fs_file_seek)
+ - [mod_fs_file_rewind](functions-5.md#mod_fs_file_rewind)
- [mod_fs_file_is_eof](functions-5.md#mod_fs_file_is_eof)
- [mod_fs_file_fill](functions-5.md#mod_fs_file_fill)
- [mod_fs_file_erase](functions-5.md#mod_fs_file_erase)
+ - [mod_fs_file_set_text_mode](functions-5.md#mod_fs_file_set_text_mode)
- [mod_fs_file_set_public](functions-5.md#mod_fs_file_set_public)
- [mod_fs_hide_errors](functions-5.md#mod_fs_hide_errors)
- [mod_fs_get_last_error](functions-5.md#mod_fs_get_last_error)
@@ -1393,6 +1395,7 @@
- [mod_storage_load](functions-5.md#mod_storage_load)
- [mod_storage_load_number](functions-5.md#mod_storage_load_number)
- [mod_storage_load_bool](functions-5.md#mod_storage_load_bool)
+ - [mod_storage_load_all](functions-5.md#mod_storage_load_all)
- [mod_storage_exists](functions-5.md#mod_storage_exists)
- [mod_storage_remove](functions-5.md#mod_storage_remove)
- [mod_storage_clear](functions-5.md#mod_storage_clear)
@@ -1516,232 +1519,232 @@
- object_helpers.c
- - [clear_move_flag](functions-5.md#clear_move_flag)
- - [set_room_override](functions-5.md#set_room_override)
- - [obj_update_pos_from_parent_transformation](functions-5.md#obj_update_pos_from_parent_transformation)
- - [obj_apply_scale_to_matrix](functions-5.md#obj_apply_scale_to_matrix)
- - [create_transformation_from_matrices](functions-5.md#create_transformation_from_matrices)
- - [obj_set_held_state](functions-5.md#obj_set_held_state)
- - [lateral_dist_between_objects](functions-5.md#lateral_dist_between_objects)
- - [dist_between_objects](functions-5.md#dist_between_objects)
- - [dist_between_object_and_point](functions-5.md#dist_between_object_and_point)
- - [cur_obj_forward_vel_approach_upward](functions-5.md#cur_obj_forward_vel_approach_upward)
- - [approach_f32_signed](functions-5.md#approach_f32_signed)
- - [approach_f32_symmetric](functions-5.md#approach_f32_symmetric)
- - [approach_s16_symmetric](functions-5.md#approach_s16_symmetric)
- - [cur_obj_rotate_yaw_toward](functions-5.md#cur_obj_rotate_yaw_toward)
- - [obj_angle_to_object](functions-5.md#obj_angle_to_object)
- - [obj_pitch_to_object](functions-5.md#obj_pitch_to_object)
- - [obj_angle_to_point](functions-5.md#obj_angle_to_point)
- - [obj_turn_toward_object](functions-5.md#obj_turn_toward_object)
- - [obj_set_parent_relative_pos](functions-5.md#obj_set_parent_relative_pos)
- - [obj_set_pos](functions-5.md#obj_set_pos)
- - [obj_set_angle](functions-5.md#obj_set_angle)
- - [obj_set_move_angle](functions-5.md#obj_set_move_angle)
- - [obj_set_face_angle](functions-5.md#obj_set_face_angle)
- - [obj_set_gfx_angle](functions-5.md#obj_set_gfx_angle)
- - [obj_set_gfx_pos](functions-5.md#obj_set_gfx_pos)
- - [obj_set_gfx_scale](functions-5.md#obj_set_gfx_scale)
- - [spawn_water_droplet](functions-5.md#spawn_water_droplet)
- - [obj_build_relative_transform](functions-5.md#obj_build_relative_transform)
- - [cur_obj_move_using_vel](functions-5.md#cur_obj_move_using_vel)
- - [obj_copy_graph_y_offset](functions-5.md#obj_copy_graph_y_offset)
- - [obj_copy_pos_and_angle](functions-5.md#obj_copy_pos_and_angle)
- - [obj_copy_pos](functions-5.md#obj_copy_pos)
- - [obj_copy_angle](functions-5.md#obj_copy_angle)
- - [obj_set_gfx_pos_from_pos](functions-5.md#obj_set_gfx_pos_from_pos)
- - [obj_init_animation](functions-5.md#obj_init_animation)
- - [linear_mtxf_mul_vec3f](functions-5.md#linear_mtxf_mul_vec3f)
- - [linear_mtxf_transpose_mul_vec3f](functions-5.md#linear_mtxf_transpose_mul_vec3f)
- - [obj_apply_scale_to_transform](functions-5.md#obj_apply_scale_to_transform)
- - [obj_copy_scale](functions-5.md#obj_copy_scale)
- - [obj_scale_xyz](functions-5.md#obj_scale_xyz)
- - [obj_scale](functions-5.md#obj_scale)
- - [cur_obj_scale](functions-5.md#cur_obj_scale)
- - [cur_obj_init_animation](functions-5.md#cur_obj_init_animation)
- - [cur_obj_init_animation_with_sound](functions-5.md#cur_obj_init_animation_with_sound)
- - [obj_init_animation_with_accel_and_sound](functions-5.md#obj_init_animation_with_accel_and_sound)
- - [cur_obj_init_animation_with_accel_and_sound](functions-5.md#cur_obj_init_animation_with_accel_and_sound)
- - [obj_init_animation_with_sound](functions-5.md#obj_init_animation_with_sound)
- - [cur_obj_enable_rendering_and_become_tangible](functions-5.md#cur_obj_enable_rendering_and_become_tangible)
- - [cur_obj_enable_rendering](functions-5.md#cur_obj_enable_rendering)
- - [cur_obj_disable_rendering_and_become_intangible](functions-5.md#cur_obj_disable_rendering_and_become_intangible)
- - [cur_obj_disable_rendering](functions-5.md#cur_obj_disable_rendering)
- - [cur_obj_unhide](functions-5.md#cur_obj_unhide)
- - [cur_obj_hide](functions-5.md#cur_obj_hide)
- - [cur_obj_set_pos_relative](functions-5.md#cur_obj_set_pos_relative)
- - [cur_obj_set_pos_relative_to_parent](functions-5.md#cur_obj_set_pos_relative_to_parent)
- - [cur_obj_enable_rendering_2](functions-5.md#cur_obj_enable_rendering_2)
- - [cur_obj_unused_init_on_floor](functions-5.md#cur_obj_unused_init_on_floor)
- - [obj_set_face_angle_to_move_angle](functions-5.md#obj_set_face_angle_to_move_angle)
- - [get_object_list_from_behavior](functions-5.md#get_object_list_from_behavior)
- - [cur_obj_nearest_object_with_behavior](functions-5.md#cur_obj_nearest_object_with_behavior)
- - [cur_obj_dist_to_nearest_object_with_behavior](functions-5.md#cur_obj_dist_to_nearest_object_with_behavior)
- - [cur_obj_find_nearest_pole](functions-5.md#cur_obj_find_nearest_pole)
- - [cur_obj_find_nearest_object_with_behavior](functions-5.md#cur_obj_find_nearest_object_with_behavior)
- - [cur_obj_count_objects_with_behavior](functions-5.md#cur_obj_count_objects_with_behavior)
- - [find_unimportant_object](functions-5.md#find_unimportant_object)
- - [count_unimportant_objects](functions-5.md#count_unimportant_objects)
- - [count_objects_with_behavior](functions-5.md#count_objects_with_behavior)
- - [find_object_with_behavior](functions-5.md#find_object_with_behavior)
- - [cur_obj_find_nearby_held_actor](functions-5.md#cur_obj_find_nearby_held_actor)
- - [cur_obj_reset_timer_and_subaction](functions-5.md#cur_obj_reset_timer_and_subaction)
- - [cur_obj_change_action](functions-5.md#cur_obj_change_action)
- - [cur_obj_set_vel_from_mario_vel](functions-5.md#cur_obj_set_vel_from_mario_vel)
- - [cur_obj_reverse_animation](functions-5.md#cur_obj_reverse_animation)
- - [cur_obj_extend_animation_if_at_end](functions-5.md#cur_obj_extend_animation_if_at_end)
- - [cur_obj_check_if_near_animation_end](functions-5.md#cur_obj_check_if_near_animation_end)
- - [cur_obj_check_if_at_animation_end](functions-5.md#cur_obj_check_if_at_animation_end)
- - [cur_obj_check_anim_frame](functions-5.md#cur_obj_check_anim_frame)
- - [cur_obj_check_anim_frame_in_range](functions-5.md#cur_obj_check_anim_frame_in_range)
- - [cur_obj_check_frame_prior_current_frame](functions-5.md#cur_obj_check_frame_prior_current_frame)
- - [mario_is_in_air_action](functions-5.md#mario_is_in_air_action)
- - [mario_is_dive_sliding](functions-5.md#mario_is_dive_sliding)
- - [cur_obj_set_y_vel_and_animation](functions-5.md#cur_obj_set_y_vel_and_animation)
- - [cur_obj_unrender_and_reset_state](functions-5.md#cur_obj_unrender_and_reset_state)
- - [cur_obj_move_after_thrown_or_dropped](functions-5.md#cur_obj_move_after_thrown_or_dropped)
- - [cur_obj_get_thrown_or_placed](functions-5.md#cur_obj_get_thrown_or_placed)
- - [cur_obj_get_dropped](functions-5.md#cur_obj_get_dropped)
- - [mario_set_flag](functions-5.md#mario_set_flag)
- - [cur_obj_clear_interact_status_flag](functions-5.md#cur_obj_clear_interact_status_flag)
- - [obj_mark_for_deletion](functions-5.md#obj_mark_for_deletion)
- - [cur_obj_disable](functions-5.md#cur_obj_disable)
- - [cur_obj_become_intangible](functions-5.md#cur_obj_become_intangible)
- - [cur_obj_become_tangible](functions-5.md#cur_obj_become_tangible)
- - [obj_become_tangible](functions-5.md#obj_become_tangible)
- - [cur_obj_update_floor_height](functions-5.md#cur_obj_update_floor_height)
- - [cur_obj_update_floor_height_and_get_floor](functions-5.md#cur_obj_update_floor_height_and_get_floor)
- - [apply_drag_to_value](functions-5.md#apply_drag_to_value)
- - [cur_obj_apply_drag_xz](functions-5.md#cur_obj_apply_drag_xz)
- - [cur_obj_move_xz](functions-5.md#cur_obj_move_xz)
- - [cur_obj_move_update_underwater_flags](functions-5.md#cur_obj_move_update_underwater_flags)
- - [cur_obj_move_update_ground_air_flags](functions-5.md#cur_obj_move_update_ground_air_flags)
- - [cur_obj_move_y_and_get_water_level](functions-5.md#cur_obj_move_y_and_get_water_level)
- - [cur_obj_move_y](functions-5.md#cur_obj_move_y)
- - [cur_obj_unused_resolve_wall_collisions](functions-5.md#cur_obj_unused_resolve_wall_collisions)
- - [abs_angle_diff](functions-5.md#abs_angle_diff)
- - [cur_obj_move_xz_using_fvel_and_yaw](functions-5.md#cur_obj_move_xz_using_fvel_and_yaw)
- - [cur_obj_move_y_with_terminal_vel](functions-5.md#cur_obj_move_y_with_terminal_vel)
- - [cur_obj_compute_vel_xz](functions-5.md#cur_obj_compute_vel_xz)
- - [increment_velocity_toward_range](functions-5.md#increment_velocity_toward_range)
- - [obj_check_if_collided_with_object](functions-5.md#obj_check_if_collided_with_object)
- - [cur_obj_set_behavior](functions-5.md#cur_obj_set_behavior)
- - [obj_set_behavior](functions-5.md#obj_set_behavior)
- - [cur_obj_has_behavior](functions-5.md#cur_obj_has_behavior)
- - [obj_has_behavior](functions-5.md#obj_has_behavior)
- - [cur_obj_lateral_dist_from_obj_to_home](functions-5.md#cur_obj_lateral_dist_from_obj_to_home)
- - [cur_obj_lateral_dist_from_mario_to_home](functions-5.md#cur_obj_lateral_dist_from_mario_to_home)
- - [cur_obj_lateral_dist_to_home](functions-5.md#cur_obj_lateral_dist_to_home)
- - [cur_obj_outside_home_square](functions-5.md#cur_obj_outside_home_square)
- - [cur_obj_outside_home_rectangle](functions-5.md#cur_obj_outside_home_rectangle)
- - [cur_obj_set_pos_to_home](functions-5.md#cur_obj_set_pos_to_home)
- - [cur_obj_set_pos_to_home_and_stop](functions-5.md#cur_obj_set_pos_to_home_and_stop)
- - [cur_obj_shake_y](functions-5.md#cur_obj_shake_y)
- - [cur_obj_start_cam_event](functions-5.md#cur_obj_start_cam_event)
- - [set_mario_interact_hoot_if_in_range](functions-5.md#set_mario_interact_hoot_if_in_range)
- - [obj_set_billboard](functions-5.md#obj_set_billboard)
- - [obj_set_cylboard](functions-5.md#obj_set_cylboard)
- - [cur_obj_set_billboard_if_vanilla_cam](functions-5.md#cur_obj_set_billboard_if_vanilla_cam)
- - [obj_set_hitbox_radius_and_height](functions-5.md#obj_set_hitbox_radius_and_height)
- - [obj_set_hurtbox_radius_and_height](functions-5.md#obj_set_hurtbox_radius_and_height)
- - [cur_obj_set_hitbox_radius_and_height](functions-5.md#cur_obj_set_hitbox_radius_and_height)
- - [cur_obj_set_hurtbox_radius_and_height](functions-5.md#cur_obj_set_hurtbox_radius_and_height)
- - [obj_spawn_loot_coins](functions-5.md#obj_spawn_loot_coins)
- - [obj_spawn_loot_blue_coins](functions-5.md#obj_spawn_loot_blue_coins)
- - [obj_spawn_loot_yellow_coins](functions-5.md#obj_spawn_loot_yellow_coins)
- - [cur_obj_spawn_loot_coin_at_mario_pos](functions-5.md#cur_obj_spawn_loot_coin_at_mario_pos)
- - [cur_obj_abs_y_dist_to_home](functions-5.md#cur_obj_abs_y_dist_to_home)
- - [cur_obj_advance_looping_anim](functions-5.md#cur_obj_advance_looping_anim)
- - [cur_obj_detect_steep_floor](functions-5.md#cur_obj_detect_steep_floor)
- - [cur_obj_resolve_wall_collisions](functions-5.md#cur_obj_resolve_wall_collisions)
- - [cur_obj_update_floor](functions-5.md#cur_obj_update_floor)
- - [cur_obj_update_floor_and_resolve_wall_collisions](functions-5.md#cur_obj_update_floor_and_resolve_wall_collisions)
- - [cur_obj_update_floor_and_walls](functions-5.md#cur_obj_update_floor_and_walls)
- - [cur_obj_move_standard](functions-5.md#cur_obj_move_standard)
- - [cur_obj_within_12k_bounds](functions-5.md#cur_obj_within_12k_bounds)
- - [cur_obj_move_using_vel_and_gravity](functions-5.md#cur_obj_move_using_vel_and_gravity)
- - [cur_obj_move_using_fvel_and_gravity](functions-5.md#cur_obj_move_using_fvel_and_gravity)
- - [obj_set_pos_relative](functions-5.md#obj_set_pos_relative)
- - [cur_obj_angle_to_home](functions-5.md#cur_obj_angle_to_home)
- - [obj_set_gfx_pos_at_obj_pos](functions-5.md#obj_set_gfx_pos_at_obj_pos)
- - [obj_translate_local](functions-5.md#obj_translate_local)
- - [obj_build_transform_from_pos_and_angle](functions-5.md#obj_build_transform_from_pos_and_angle)
- - [obj_set_throw_matrix_from_transform](functions-5.md#obj_set_throw_matrix_from_transform)
- - [obj_build_transform_relative_to_parent](functions-5.md#obj_build_transform_relative_to_parent)
- - [obj_create_transform_from_self](functions-5.md#obj_create_transform_from_self)
- - [cur_obj_rotate_move_angle_using_vel](functions-5.md#cur_obj_rotate_move_angle_using_vel)
- - [cur_obj_rotate_face_angle_using_vel](functions-5.md#cur_obj_rotate_face_angle_using_vel)
- - [cur_obj_set_face_angle_to_move_angle](functions-5.md#cur_obj_set_face_angle_to_move_angle)
- - [cur_obj_follow_path](functions-5.md#cur_obj_follow_path)
- - [chain_segment_init](functions-5.md#chain_segment_init)
- - [random_f32_around_zero](functions-5.md#random_f32_around_zero)
- - [obj_scale_random](functions-5.md#obj_scale_random)
- - [obj_translate_xyz_random](functions-5.md#obj_translate_xyz_random)
- - [obj_translate_xz_random](functions-5.md#obj_translate_xz_random)
- - [obj_build_vel_from_transform](functions-5.md#obj_build_vel_from_transform)
- - [cur_obj_set_pos_via_transform](functions-5.md#cur_obj_set_pos_via_transform)
- - [cur_obj_reflect_move_angle_off_wall](functions-5.md#cur_obj_reflect_move_angle_off_wall)
- - [cur_obj_spawn_particles](functions-5.md#cur_obj_spawn_particles)
- - [obj_set_hitbox](functions-5.md#obj_set_hitbox)
- - [signum_positive](functions-5.md#signum_positive)
- - [cur_obj_wait_then_blink](functions-5.md#cur_obj_wait_then_blink)
- - [cur_obj_is_mario_ground_pounding_platform](functions-5.md#cur_obj_is_mario_ground_pounding_platform)
- - [obj_is_mario_ground_pounding_platform](functions-5.md#obj_is_mario_ground_pounding_platform)
- - [spawn_mist_particles](functions-5.md#spawn_mist_particles)
- - [spawn_mist_particles_with_sound](functions-5.md#spawn_mist_particles_with_sound)
- - [cur_obj_push_mario_away](functions-5.md#cur_obj_push_mario_away)
- - [cur_obj_push_mario_away_from_cylinder](functions-5.md#cur_obj_push_mario_away_from_cylinder)
- - [bhv_dust_smoke_loop](functions-5.md#bhv_dust_smoke_loop)
- - [stub_obj_helpers_3](functions-5.md#stub_obj_helpers_3)
- - [cur_obj_scale_over_time](functions-5.md#cur_obj_scale_over_time)
- - [cur_obj_set_pos_to_home_with_debug](functions-5.md#cur_obj_set_pos_to_home_with_debug)
- - [stub_obj_helpers_4](functions-5.md#stub_obj_helpers_4)
- - [cur_obj_is_mario_on_platform](functions-5.md#cur_obj_is_mario_on_platform)
- - [cur_obj_is_any_player_on_platform](functions-5.md#cur_obj_is_any_player_on_platform)
- - [cur_obj_shake_y_until](functions-5.md#cur_obj_shake_y_until)
- - [cur_obj_move_up_and_down](functions-5.md#cur_obj_move_up_and_down)
- - [spawn_star_with_no_lvl_exit](functions-5.md#spawn_star_with_no_lvl_exit)
- - [spawn_base_star_with_no_lvl_exit](functions-5.md#spawn_base_star_with_no_lvl_exit)
- - [bit_shift_left](functions-5.md#bit_shift_left)
- - [cur_obj_mario_far_away](functions-5.md#cur_obj_mario_far_away)
- - [is_mario_moving_fast_or_in_air](functions-5.md#is_mario_moving_fast_or_in_air)
- - [is_item_in_array](functions-5.md#is_item_in_array)
- - [bhv_init_room](functions-5.md#bhv_init_room)
- - [cur_obj_enable_rendering_if_mario_in_room](functions-5.md#cur_obj_enable_rendering_if_mario_in_room)
- - [cur_obj_set_hitbox_and_die_if_attacked](functions-5.md#cur_obj_set_hitbox_and_die_if_attacked)
- - [obj_explode_and_spawn_coins](functions-5.md#obj_explode_and_spawn_coins)
- - [cur_obj_if_hit_wall_bounce_away](functions-5.md#cur_obj_if_hit_wall_bounce_away)
- - [cur_obj_hide_if_mario_far_away_y](functions-5.md#cur_obj_hide_if_mario_far_away_y)
- - [obj_is_hidden](functions-5.md#obj_is_hidden)
- - [enable_time_stop](functions-5.md#enable_time_stop)
- - [enable_time_stop_if_alone](functions-5.md#enable_time_stop_if_alone)
- - [disable_time_stop](functions-5.md#disable_time_stop)
- - [set_time_stop_flags](functions-5.md#set_time_stop_flags)
- - [set_time_stop_flags_if_alone](functions-5.md#set_time_stop_flags_if_alone)
- - [clear_time_stop_flags](functions-5.md#clear_time_stop_flags)
- - [cur_obj_can_mario_activate_textbox](functions-5.md#cur_obj_can_mario_activate_textbox)
- - [cur_obj_can_mario_activate_textbox_2](functions-5.md#cur_obj_can_mario_activate_textbox_2)
- - [cur_obj_end_dialog](functions-5.md#cur_obj_end_dialog)
- - [cur_obj_has_model](functions-5.md#cur_obj_has_model)
- - [cur_obj_align_gfx_with_floor](functions-5.md#cur_obj_align_gfx_with_floor)
- - [mario_is_within_rectangle](functions-5.md#mario_is_within_rectangle)
- - [cur_obj_shake_screen](functions-5.md#cur_obj_shake_screen)
- - [obj_attack_collided_from_other_object](functions-5.md#obj_attack_collided_from_other_object)
- - [cur_obj_was_attacked_or_ground_pounded](functions-5.md#cur_obj_was_attacked_or_ground_pounded)
- - [obj_copy_behavior_params](functions-5.md#obj_copy_behavior_params)
- - [cur_obj_init_animation_and_anim_frame](functions-5.md#cur_obj_init_animation_and_anim_frame)
- - [cur_obj_init_animation_and_check_if_near_end](functions-5.md#cur_obj_init_animation_and_check_if_near_end)
- - [cur_obj_init_animation_and_extend_if_at_end](functions-5.md#cur_obj_init_animation_and_extend_if_at_end)
- - [cur_obj_check_grabbed_mario](functions-5.md#cur_obj_check_grabbed_mario)
- - [player_performed_grab_escape_action](functions-5.md#player_performed_grab_escape_action)
- - [cur_obj_unused_play_footstep_sound](functions-5.md#cur_obj_unused_play_footstep_sound)
- - [enable_time_stop_including_mario](functions-5.md#enable_time_stop_including_mario)
- - [disable_time_stop_including_mario](functions-5.md#disable_time_stop_including_mario)
- - [cur_obj_check_interacted](functions-5.md#cur_obj_check_interacted)
- - [cur_obj_spawn_loot_blue_coin](functions-5.md#cur_obj_spawn_loot_blue_coin)
- - [cur_obj_spawn_star_at_y_offset](functions-5.md#cur_obj_spawn_star_at_y_offset)
- - [cur_obj_set_home_once](functions-5.md#cur_obj_set_home_once)
- - [get_trajectory_length](functions-5.md#get_trajectory_length)
+ - [clear_move_flag](functions-6.md#clear_move_flag)
+ - [set_room_override](functions-6.md#set_room_override)
+ - [obj_update_pos_from_parent_transformation](functions-6.md#obj_update_pos_from_parent_transformation)
+ - [obj_apply_scale_to_matrix](functions-6.md#obj_apply_scale_to_matrix)
+ - [create_transformation_from_matrices](functions-6.md#create_transformation_from_matrices)
+ - [obj_set_held_state](functions-6.md#obj_set_held_state)
+ - [lateral_dist_between_objects](functions-6.md#lateral_dist_between_objects)
+ - [dist_between_objects](functions-6.md#dist_between_objects)
+ - [dist_between_object_and_point](functions-6.md#dist_between_object_and_point)
+ - [cur_obj_forward_vel_approach_upward](functions-6.md#cur_obj_forward_vel_approach_upward)
+ - [approach_f32_signed](functions-6.md#approach_f32_signed)
+ - [approach_f32_symmetric](functions-6.md#approach_f32_symmetric)
+ - [approach_s16_symmetric](functions-6.md#approach_s16_symmetric)
+ - [cur_obj_rotate_yaw_toward](functions-6.md#cur_obj_rotate_yaw_toward)
+ - [obj_angle_to_object](functions-6.md#obj_angle_to_object)
+ - [obj_pitch_to_object](functions-6.md#obj_pitch_to_object)
+ - [obj_angle_to_point](functions-6.md#obj_angle_to_point)
+ - [obj_turn_toward_object](functions-6.md#obj_turn_toward_object)
+ - [obj_set_parent_relative_pos](functions-6.md#obj_set_parent_relative_pos)
+ - [obj_set_pos](functions-6.md#obj_set_pos)
+ - [obj_set_angle](functions-6.md#obj_set_angle)
+ - [obj_set_move_angle](functions-6.md#obj_set_move_angle)
+ - [obj_set_face_angle](functions-6.md#obj_set_face_angle)
+ - [obj_set_gfx_angle](functions-6.md#obj_set_gfx_angle)
+ - [obj_set_gfx_pos](functions-6.md#obj_set_gfx_pos)
+ - [obj_set_gfx_scale](functions-6.md#obj_set_gfx_scale)
+ - [spawn_water_droplet](functions-6.md#spawn_water_droplet)
+ - [obj_build_relative_transform](functions-6.md#obj_build_relative_transform)
+ - [cur_obj_move_using_vel](functions-6.md#cur_obj_move_using_vel)
+ - [obj_copy_graph_y_offset](functions-6.md#obj_copy_graph_y_offset)
+ - [obj_copy_pos_and_angle](functions-6.md#obj_copy_pos_and_angle)
+ - [obj_copy_pos](functions-6.md#obj_copy_pos)
+ - [obj_copy_angle](functions-6.md#obj_copy_angle)
+ - [obj_set_gfx_pos_from_pos](functions-6.md#obj_set_gfx_pos_from_pos)
+ - [obj_init_animation](functions-6.md#obj_init_animation)
+ - [linear_mtxf_mul_vec3f](functions-6.md#linear_mtxf_mul_vec3f)
+ - [linear_mtxf_transpose_mul_vec3f](functions-6.md#linear_mtxf_transpose_mul_vec3f)
+ - [obj_apply_scale_to_transform](functions-6.md#obj_apply_scale_to_transform)
+ - [obj_copy_scale](functions-6.md#obj_copy_scale)
+ - [obj_scale_xyz](functions-6.md#obj_scale_xyz)
+ - [obj_scale](functions-6.md#obj_scale)
+ - [cur_obj_scale](functions-6.md#cur_obj_scale)
+ - [cur_obj_init_animation](functions-6.md#cur_obj_init_animation)
+ - [cur_obj_init_animation_with_sound](functions-6.md#cur_obj_init_animation_with_sound)
+ - [obj_init_animation_with_accel_and_sound](functions-6.md#obj_init_animation_with_accel_and_sound)
+ - [cur_obj_init_animation_with_accel_and_sound](functions-6.md#cur_obj_init_animation_with_accel_and_sound)
+ - [obj_init_animation_with_sound](functions-6.md#obj_init_animation_with_sound)
+ - [cur_obj_enable_rendering_and_become_tangible](functions-6.md#cur_obj_enable_rendering_and_become_tangible)
+ - [cur_obj_enable_rendering](functions-6.md#cur_obj_enable_rendering)
+ - [cur_obj_disable_rendering_and_become_intangible](functions-6.md#cur_obj_disable_rendering_and_become_intangible)
+ - [cur_obj_disable_rendering](functions-6.md#cur_obj_disable_rendering)
+ - [cur_obj_unhide](functions-6.md#cur_obj_unhide)
+ - [cur_obj_hide](functions-6.md#cur_obj_hide)
+ - [cur_obj_set_pos_relative](functions-6.md#cur_obj_set_pos_relative)
+ - [cur_obj_set_pos_relative_to_parent](functions-6.md#cur_obj_set_pos_relative_to_parent)
+ - [cur_obj_enable_rendering_2](functions-6.md#cur_obj_enable_rendering_2)
+ - [cur_obj_unused_init_on_floor](functions-6.md#cur_obj_unused_init_on_floor)
+ - [obj_set_face_angle_to_move_angle](functions-6.md#obj_set_face_angle_to_move_angle)
+ - [get_object_list_from_behavior](functions-6.md#get_object_list_from_behavior)
+ - [cur_obj_nearest_object_with_behavior](functions-6.md#cur_obj_nearest_object_with_behavior)
+ - [cur_obj_dist_to_nearest_object_with_behavior](functions-6.md#cur_obj_dist_to_nearest_object_with_behavior)
+ - [cur_obj_find_nearest_pole](functions-6.md#cur_obj_find_nearest_pole)
+ - [cur_obj_find_nearest_object_with_behavior](functions-6.md#cur_obj_find_nearest_object_with_behavior)
+ - [cur_obj_count_objects_with_behavior](functions-6.md#cur_obj_count_objects_with_behavior)
+ - [find_unimportant_object](functions-6.md#find_unimportant_object)
+ - [count_unimportant_objects](functions-6.md#count_unimportant_objects)
+ - [count_objects_with_behavior](functions-6.md#count_objects_with_behavior)
+ - [find_object_with_behavior](functions-6.md#find_object_with_behavior)
+ - [cur_obj_find_nearby_held_actor](functions-6.md#cur_obj_find_nearby_held_actor)
+ - [cur_obj_reset_timer_and_subaction](functions-6.md#cur_obj_reset_timer_and_subaction)
+ - [cur_obj_change_action](functions-6.md#cur_obj_change_action)
+ - [cur_obj_set_vel_from_mario_vel](functions-6.md#cur_obj_set_vel_from_mario_vel)
+ - [cur_obj_reverse_animation](functions-6.md#cur_obj_reverse_animation)
+ - [cur_obj_extend_animation_if_at_end](functions-6.md#cur_obj_extend_animation_if_at_end)
+ - [cur_obj_check_if_near_animation_end](functions-6.md#cur_obj_check_if_near_animation_end)
+ - [cur_obj_check_if_at_animation_end](functions-6.md#cur_obj_check_if_at_animation_end)
+ - [cur_obj_check_anim_frame](functions-6.md#cur_obj_check_anim_frame)
+ - [cur_obj_check_anim_frame_in_range](functions-6.md#cur_obj_check_anim_frame_in_range)
+ - [cur_obj_check_frame_prior_current_frame](functions-6.md#cur_obj_check_frame_prior_current_frame)
+ - [mario_is_in_air_action](functions-6.md#mario_is_in_air_action)
+ - [mario_is_dive_sliding](functions-6.md#mario_is_dive_sliding)
+ - [cur_obj_set_y_vel_and_animation](functions-6.md#cur_obj_set_y_vel_and_animation)
+ - [cur_obj_unrender_and_reset_state](functions-6.md#cur_obj_unrender_and_reset_state)
+ - [cur_obj_move_after_thrown_or_dropped](functions-6.md#cur_obj_move_after_thrown_or_dropped)
+ - [cur_obj_get_thrown_or_placed](functions-6.md#cur_obj_get_thrown_or_placed)
+ - [cur_obj_get_dropped](functions-6.md#cur_obj_get_dropped)
+ - [mario_set_flag](functions-6.md#mario_set_flag)
+ - [cur_obj_clear_interact_status_flag](functions-6.md#cur_obj_clear_interact_status_flag)
+ - [obj_mark_for_deletion](functions-6.md#obj_mark_for_deletion)
+ - [cur_obj_disable](functions-6.md#cur_obj_disable)
+ - [cur_obj_become_intangible](functions-6.md#cur_obj_become_intangible)
+ - [cur_obj_become_tangible](functions-6.md#cur_obj_become_tangible)
+ - [obj_become_tangible](functions-6.md#obj_become_tangible)
+ - [cur_obj_update_floor_height](functions-6.md#cur_obj_update_floor_height)
+ - [cur_obj_update_floor_height_and_get_floor](functions-6.md#cur_obj_update_floor_height_and_get_floor)
+ - [apply_drag_to_value](functions-6.md#apply_drag_to_value)
+ - [cur_obj_apply_drag_xz](functions-6.md#cur_obj_apply_drag_xz)
+ - [cur_obj_move_xz](functions-6.md#cur_obj_move_xz)
+ - [cur_obj_move_update_underwater_flags](functions-6.md#cur_obj_move_update_underwater_flags)
+ - [cur_obj_move_update_ground_air_flags](functions-6.md#cur_obj_move_update_ground_air_flags)
+ - [cur_obj_move_y_and_get_water_level](functions-6.md#cur_obj_move_y_and_get_water_level)
+ - [cur_obj_move_y](functions-6.md#cur_obj_move_y)
+ - [cur_obj_unused_resolve_wall_collisions](functions-6.md#cur_obj_unused_resolve_wall_collisions)
+ - [abs_angle_diff](functions-6.md#abs_angle_diff)
+ - [cur_obj_move_xz_using_fvel_and_yaw](functions-6.md#cur_obj_move_xz_using_fvel_and_yaw)
+ - [cur_obj_move_y_with_terminal_vel](functions-6.md#cur_obj_move_y_with_terminal_vel)
+ - [cur_obj_compute_vel_xz](functions-6.md#cur_obj_compute_vel_xz)
+ - [increment_velocity_toward_range](functions-6.md#increment_velocity_toward_range)
+ - [obj_check_if_collided_with_object](functions-6.md#obj_check_if_collided_with_object)
+ - [cur_obj_set_behavior](functions-6.md#cur_obj_set_behavior)
+ - [obj_set_behavior](functions-6.md#obj_set_behavior)
+ - [cur_obj_has_behavior](functions-6.md#cur_obj_has_behavior)
+ - [obj_has_behavior](functions-6.md#obj_has_behavior)
+ - [cur_obj_lateral_dist_from_obj_to_home](functions-6.md#cur_obj_lateral_dist_from_obj_to_home)
+ - [cur_obj_lateral_dist_from_mario_to_home](functions-6.md#cur_obj_lateral_dist_from_mario_to_home)
+ - [cur_obj_lateral_dist_to_home](functions-6.md#cur_obj_lateral_dist_to_home)
+ - [cur_obj_outside_home_square](functions-6.md#cur_obj_outside_home_square)
+ - [cur_obj_outside_home_rectangle](functions-6.md#cur_obj_outside_home_rectangle)
+ - [cur_obj_set_pos_to_home](functions-6.md#cur_obj_set_pos_to_home)
+ - [cur_obj_set_pos_to_home_and_stop](functions-6.md#cur_obj_set_pos_to_home_and_stop)
+ - [cur_obj_shake_y](functions-6.md#cur_obj_shake_y)
+ - [cur_obj_start_cam_event](functions-6.md#cur_obj_start_cam_event)
+ - [set_mario_interact_hoot_if_in_range](functions-6.md#set_mario_interact_hoot_if_in_range)
+ - [obj_set_billboard](functions-6.md#obj_set_billboard)
+ - [obj_set_cylboard](functions-6.md#obj_set_cylboard)
+ - [cur_obj_set_billboard_if_vanilla_cam](functions-6.md#cur_obj_set_billboard_if_vanilla_cam)
+ - [obj_set_hitbox_radius_and_height](functions-6.md#obj_set_hitbox_radius_and_height)
+ - [obj_set_hurtbox_radius_and_height](functions-6.md#obj_set_hurtbox_radius_and_height)
+ - [cur_obj_set_hitbox_radius_and_height](functions-6.md#cur_obj_set_hitbox_radius_and_height)
+ - [cur_obj_set_hurtbox_radius_and_height](functions-6.md#cur_obj_set_hurtbox_radius_and_height)
+ - [obj_spawn_loot_coins](functions-6.md#obj_spawn_loot_coins)
+ - [obj_spawn_loot_blue_coins](functions-6.md#obj_spawn_loot_blue_coins)
+ - [obj_spawn_loot_yellow_coins](functions-6.md#obj_spawn_loot_yellow_coins)
+ - [cur_obj_spawn_loot_coin_at_mario_pos](functions-6.md#cur_obj_spawn_loot_coin_at_mario_pos)
+ - [cur_obj_abs_y_dist_to_home](functions-6.md#cur_obj_abs_y_dist_to_home)
+ - [cur_obj_advance_looping_anim](functions-6.md#cur_obj_advance_looping_anim)
+ - [cur_obj_detect_steep_floor](functions-6.md#cur_obj_detect_steep_floor)
+ - [cur_obj_resolve_wall_collisions](functions-6.md#cur_obj_resolve_wall_collisions)
+ - [cur_obj_update_floor](functions-6.md#cur_obj_update_floor)
+ - [cur_obj_update_floor_and_resolve_wall_collisions](functions-6.md#cur_obj_update_floor_and_resolve_wall_collisions)
+ - [cur_obj_update_floor_and_walls](functions-6.md#cur_obj_update_floor_and_walls)
+ - [cur_obj_move_standard](functions-6.md#cur_obj_move_standard)
+ - [cur_obj_within_12k_bounds](functions-6.md#cur_obj_within_12k_bounds)
+ - [cur_obj_move_using_vel_and_gravity](functions-6.md#cur_obj_move_using_vel_and_gravity)
+ - [cur_obj_move_using_fvel_and_gravity](functions-6.md#cur_obj_move_using_fvel_and_gravity)
+ - [obj_set_pos_relative](functions-6.md#obj_set_pos_relative)
+ - [cur_obj_angle_to_home](functions-6.md#cur_obj_angle_to_home)
+ - [obj_set_gfx_pos_at_obj_pos](functions-6.md#obj_set_gfx_pos_at_obj_pos)
+ - [obj_translate_local](functions-6.md#obj_translate_local)
+ - [obj_build_transform_from_pos_and_angle](functions-6.md#obj_build_transform_from_pos_and_angle)
+ - [obj_set_throw_matrix_from_transform](functions-6.md#obj_set_throw_matrix_from_transform)
+ - [obj_build_transform_relative_to_parent](functions-6.md#obj_build_transform_relative_to_parent)
+ - [obj_create_transform_from_self](functions-6.md#obj_create_transform_from_self)
+ - [cur_obj_rotate_move_angle_using_vel](functions-6.md#cur_obj_rotate_move_angle_using_vel)
+ - [cur_obj_rotate_face_angle_using_vel](functions-6.md#cur_obj_rotate_face_angle_using_vel)
+ - [cur_obj_set_face_angle_to_move_angle](functions-6.md#cur_obj_set_face_angle_to_move_angle)
+ - [cur_obj_follow_path](functions-6.md#cur_obj_follow_path)
+ - [chain_segment_init](functions-6.md#chain_segment_init)
+ - [random_f32_around_zero](functions-6.md#random_f32_around_zero)
+ - [obj_scale_random](functions-6.md#obj_scale_random)
+ - [obj_translate_xyz_random](functions-6.md#obj_translate_xyz_random)
+ - [obj_translate_xz_random](functions-6.md#obj_translate_xz_random)
+ - [obj_build_vel_from_transform](functions-6.md#obj_build_vel_from_transform)
+ - [cur_obj_set_pos_via_transform](functions-6.md#cur_obj_set_pos_via_transform)
+ - [cur_obj_reflect_move_angle_off_wall](functions-6.md#cur_obj_reflect_move_angle_off_wall)
+ - [cur_obj_spawn_particles](functions-6.md#cur_obj_spawn_particles)
+ - [obj_set_hitbox](functions-6.md#obj_set_hitbox)
+ - [signum_positive](functions-6.md#signum_positive)
+ - [cur_obj_wait_then_blink](functions-6.md#cur_obj_wait_then_blink)
+ - [cur_obj_is_mario_ground_pounding_platform](functions-6.md#cur_obj_is_mario_ground_pounding_platform)
+ - [obj_is_mario_ground_pounding_platform](functions-6.md#obj_is_mario_ground_pounding_platform)
+ - [spawn_mist_particles](functions-6.md#spawn_mist_particles)
+ - [spawn_mist_particles_with_sound](functions-6.md#spawn_mist_particles_with_sound)
+ - [cur_obj_push_mario_away](functions-6.md#cur_obj_push_mario_away)
+ - [cur_obj_push_mario_away_from_cylinder](functions-6.md#cur_obj_push_mario_away_from_cylinder)
+ - [bhv_dust_smoke_loop](functions-6.md#bhv_dust_smoke_loop)
+ - [stub_obj_helpers_3](functions-6.md#stub_obj_helpers_3)
+ - [cur_obj_scale_over_time](functions-6.md#cur_obj_scale_over_time)
+ - [cur_obj_set_pos_to_home_with_debug](functions-6.md#cur_obj_set_pos_to_home_with_debug)
+ - [stub_obj_helpers_4](functions-6.md#stub_obj_helpers_4)
+ - [cur_obj_is_mario_on_platform](functions-6.md#cur_obj_is_mario_on_platform)
+ - [cur_obj_is_any_player_on_platform](functions-6.md#cur_obj_is_any_player_on_platform)
+ - [cur_obj_shake_y_until](functions-6.md#cur_obj_shake_y_until)
+ - [cur_obj_move_up_and_down](functions-6.md#cur_obj_move_up_and_down)
+ - [spawn_star_with_no_lvl_exit](functions-6.md#spawn_star_with_no_lvl_exit)
+ - [spawn_base_star_with_no_lvl_exit](functions-6.md#spawn_base_star_with_no_lvl_exit)
+ - [bit_shift_left](functions-6.md#bit_shift_left)
+ - [cur_obj_mario_far_away](functions-6.md#cur_obj_mario_far_away)
+ - [is_mario_moving_fast_or_in_air](functions-6.md#is_mario_moving_fast_or_in_air)
+ - [is_item_in_array](functions-6.md#is_item_in_array)
+ - [bhv_init_room](functions-6.md#bhv_init_room)
+ - [cur_obj_enable_rendering_if_mario_in_room](functions-6.md#cur_obj_enable_rendering_if_mario_in_room)
+ - [cur_obj_set_hitbox_and_die_if_attacked](functions-6.md#cur_obj_set_hitbox_and_die_if_attacked)
+ - [obj_explode_and_spawn_coins](functions-6.md#obj_explode_and_spawn_coins)
+ - [cur_obj_if_hit_wall_bounce_away](functions-6.md#cur_obj_if_hit_wall_bounce_away)
+ - [cur_obj_hide_if_mario_far_away_y](functions-6.md#cur_obj_hide_if_mario_far_away_y)
+ - [obj_is_hidden](functions-6.md#obj_is_hidden)
+ - [enable_time_stop](functions-6.md#enable_time_stop)
+ - [enable_time_stop_if_alone](functions-6.md#enable_time_stop_if_alone)
+ - [disable_time_stop](functions-6.md#disable_time_stop)
+ - [set_time_stop_flags](functions-6.md#set_time_stop_flags)
+ - [set_time_stop_flags_if_alone](functions-6.md#set_time_stop_flags_if_alone)
+ - [clear_time_stop_flags](functions-6.md#clear_time_stop_flags)
+ - [cur_obj_can_mario_activate_textbox](functions-6.md#cur_obj_can_mario_activate_textbox)
+ - [cur_obj_can_mario_activate_textbox_2](functions-6.md#cur_obj_can_mario_activate_textbox_2)
+ - [cur_obj_end_dialog](functions-6.md#cur_obj_end_dialog)
+ - [cur_obj_has_model](functions-6.md#cur_obj_has_model)
+ - [cur_obj_align_gfx_with_floor](functions-6.md#cur_obj_align_gfx_with_floor)
+ - [mario_is_within_rectangle](functions-6.md#mario_is_within_rectangle)
+ - [cur_obj_shake_screen](functions-6.md#cur_obj_shake_screen)
+ - [obj_attack_collided_from_other_object](functions-6.md#obj_attack_collided_from_other_object)
+ - [cur_obj_was_attacked_or_ground_pounded](functions-6.md#cur_obj_was_attacked_or_ground_pounded)
+ - [obj_copy_behavior_params](functions-6.md#obj_copy_behavior_params)
+ - [cur_obj_init_animation_and_anim_frame](functions-6.md#cur_obj_init_animation_and_anim_frame)
+ - [cur_obj_init_animation_and_check_if_near_end](functions-6.md#cur_obj_init_animation_and_check_if_near_end)
+ - [cur_obj_init_animation_and_extend_if_at_end](functions-6.md#cur_obj_init_animation_and_extend_if_at_end)
+ - [cur_obj_check_grabbed_mario](functions-6.md#cur_obj_check_grabbed_mario)
+ - [player_performed_grab_escape_action](functions-6.md#player_performed_grab_escape_action)
+ - [cur_obj_unused_play_footstep_sound](functions-6.md#cur_obj_unused_play_footstep_sound)
+ - [enable_time_stop_including_mario](functions-6.md#enable_time_stop_including_mario)
+ - [disable_time_stop_including_mario](functions-6.md#disable_time_stop_including_mario)
+ - [cur_obj_check_interacted](functions-6.md#cur_obj_check_interacted)
+ - [cur_obj_spawn_loot_blue_coin](functions-6.md#cur_obj_spawn_loot_blue_coin)
+ - [cur_obj_spawn_star_at_y_offset](functions-6.md#cur_obj_spawn_star_at_y_offset)
+ - [cur_obj_set_home_once](functions-6.md#cur_obj_set_home_once)
+ - [get_trajectory_length](functions-6.md#get_trajectory_length)
@@ -1956,234 +1959,234 @@
- smlua_level_utils.h
- - [smlua_level_util_change_area](functions-6.md#smlua_level_util_change_area)
- - [smlua_level_util_get_info](functions-6.md#smlua_level_util_get_info)
- - [smlua_level_util_get_info_from_short_name](functions-6.md#smlua_level_util_get_info_from_short_name)
- - [smlua_level_util_get_info_from_course_num](functions-6.md#smlua_level_util_get_info_from_course_num)
- - [level_register](functions-6.md#level_register)
- - [level_is_vanilla_level](functions-6.md#level_is_vanilla_level)
- - [warp_to_warpnode](functions-6.md#warp_to_warpnode)
- - [warp_to_level](functions-6.md#warp_to_level)
- - [warp_restart_level](functions-6.md#warp_restart_level)
- - [warp_to_start_level](functions-6.md#warp_to_start_level)
- - [warp_exit_level](functions-6.md#warp_exit_level)
- - [warp_to_castle](functions-6.md#warp_to_castle)
+ - [smlua_level_util_change_area](functions-7.md#smlua_level_util_change_area)
+ - [smlua_level_util_get_info](functions-7.md#smlua_level_util_get_info)
+ - [smlua_level_util_get_info_from_short_name](functions-7.md#smlua_level_util_get_info_from_short_name)
+ - [smlua_level_util_get_info_from_course_num](functions-7.md#smlua_level_util_get_info_from_course_num)
+ - [level_register](functions-7.md#level_register)
+ - [level_is_vanilla_level](functions-7.md#level_is_vanilla_level)
+ - [warp_to_warpnode](functions-7.md#warp_to_warpnode)
+ - [warp_to_level](functions-7.md#warp_to_level)
+ - [warp_restart_level](functions-7.md#warp_restart_level)
+ - [warp_to_start_level](functions-7.md#warp_to_start_level)
+ - [warp_exit_level](functions-7.md#warp_exit_level)
+ - [warp_to_castle](functions-7.md#warp_to_castle)
- smlua_misc_utils.h
- - [get_network_area_timer](functions-6.md#get_network_area_timer)
- - [get_area_update_counter](functions-6.md#get_area_update_counter)
- - [get_temp_s32_pointer](functions-6.md#get_temp_s32_pointer)
- - [deref_s32_pointer](functions-6.md#deref_s32_pointer)
- - [djui_popup_create_global](functions-6.md#djui_popup_create_global)
- - [djui_is_popup_disabled](functions-6.md#djui_is_popup_disabled)
- - [djui_set_popup_disabled_override](functions-6.md#djui_set_popup_disabled_override)
- - [djui_reset_popup_disabled_override](functions-6.md#djui_reset_popup_disabled_override)
- - [djui_is_playerlist_open](functions-6.md#djui_is_playerlist_open)
- - [djui_attempting_to_open_playerlist](functions-6.md#djui_attempting_to_open_playerlist)
- - [djui_get_playerlist_page_index](functions-6.md#djui_get_playerlist_page_index)
- - [djui_menu_get_font](functions-6.md#djui_menu_get_font)
- - [djui_menu_get_theme](functions-6.md#djui_menu_get_theme)
- - [djui_is_playerlist_ping_visible](functions-6.md#djui_is_playerlist_ping_visible)
- - [get_dialog_box_state](functions-6.md#get_dialog_box_state)
- - [get_dialog_id](functions-6.md#get_dialog_id)
- - [get_last_star_or_key](functions-6.md#get_last_star_or_key)
- - [set_last_star_or_key](functions-6.md#set_last_star_or_key)
- - [get_last_completed_course_num](functions-6.md#get_last_completed_course_num)
- - [set_last_completed_course_num](functions-6.md#set_last_completed_course_num)
- - [get_last_completed_star_num](functions-6.md#get_last_completed_star_num)
- - [set_last_completed_star_num](functions-6.md#set_last_completed_star_num)
- - [get_got_file_coin_hi_score](functions-6.md#get_got_file_coin_hi_score)
- - [set_got_file_coin_hi_score](functions-6.md#set_got_file_coin_hi_score)
- - [get_save_file_modified](functions-6.md#get_save_file_modified)
- - [set_save_file_modified](functions-6.md#set_save_file_modified)
- - [hud_hide](functions-6.md#hud_hide)
- - [hud_show](functions-6.md#hud_show)
- - [hud_is_hidden](functions-6.md#hud_is_hidden)
- - [hud_get_value](functions-6.md#hud_get_value)
- - [hud_set_value](functions-6.md#hud_set_value)
- - [hud_render_power_meter](functions-6.md#hud_render_power_meter)
- - [hud_render_power_meter_interpolated](functions-6.md#hud_render_power_meter_interpolated)
- - [hud_get_flash](functions-6.md#hud_get_flash)
- - [hud_set_flash](functions-6.md#hud_set_flash)
- - [act_select_hud_hide](functions-6.md#act_select_hud_hide)
- - [act_select_hud_show](functions-6.md#act_select_hud_show)
- - [act_select_hud_is_hidden](functions-6.md#act_select_hud_is_hidden)
- - [is_game_paused](functions-6.md#is_game_paused)
- - [is_transition_playing](functions-6.md#is_transition_playing)
- - [allocate_mario_action](functions-6.md#allocate_mario_action)
- - [get_hand_foot_pos_x](functions-6.md#get_hand_foot_pos_x)
- - [get_hand_foot_pos_y](functions-6.md#get_hand_foot_pos_y)
- - [get_hand_foot_pos_z](functions-6.md#get_hand_foot_pos_z)
- - [get_mario_anim_part_pos](functions-6.md#get_mario_anim_part_pos)
- - [get_current_save_file_num](functions-6.md#get_current_save_file_num)
- - [save_file_get_using_backup_slot](functions-6.md#save_file_get_using_backup_slot)
- - [save_file_set_using_backup_slot](functions-6.md#save_file_set_using_backup_slot)
- - [movtexqc_register](functions-6.md#movtexqc_register)
- - [get_water_level](functions-6.md#get_water_level)
- - [set_water_level](functions-6.md#set_water_level)
- - [course_is_main_course](functions-6.md#course_is_main_course)
- - [get_ttc_speed_setting](functions-6.md#get_ttc_speed_setting)
- - [set_ttc_speed_setting](functions-6.md#set_ttc_speed_setting)
- - [get_time](functions-6.md#get_time)
- - [get_date_and_time](functions-6.md#get_date_and_time)
- - [get_envfx](functions-6.md#get_envfx)
- - [set_override_envfx](functions-6.md#set_override_envfx)
- - [get_global_timer](functions-6.md#get_global_timer)
- - [get_dialog_response](functions-6.md#get_dialog_response)
- - [get_local_discord_id](functions-6.md#get_local_discord_id)
- - [get_coopnet_id](functions-6.md#get_coopnet_id)
- - [get_volume_master](functions-6.md#get_volume_master)
- - [get_volume_level](functions-6.md#get_volume_level)
- - [get_volume_sfx](functions-6.md#get_volume_sfx)
- - [get_volume_env](functions-6.md#get_volume_env)
- - [set_volume_master](functions-6.md#set_volume_master)
- - [set_volume_level](functions-6.md#set_volume_level)
- - [set_volume_sfx](functions-6.md#set_volume_sfx)
- - [set_volume_env](functions-6.md#set_volume_env)
- - [get_environment_region](functions-6.md#get_environment_region)
- - [set_environment_region](functions-6.md#set_environment_region)
- - [mod_file_exists](functions-6.md#mod_file_exists)
- - [get_active_mod](functions-6.md#get_active_mod)
- - [set_window_title](functions-6.md#set_window_title)
- - [reset_window_title](functions-6.md#reset_window_title)
- - [get_os_name](functions-6.md#get_os_name)
- - [geo_get_current_root](functions-6.md#geo_get_current_root)
- - [geo_get_current_master_list](functions-6.md#geo_get_current_master_list)
- - [geo_get_current_perspective](functions-6.md#geo_get_current_perspective)
- - [geo_get_current_camera](functions-6.md#geo_get_current_camera)
- - [geo_get_current_held_object](functions-6.md#geo_get_current_held_object)
- - [texture_to_lua_table](functions-6.md#texture_to_lua_table)
- - [get_texture_name](functions-6.md#get_texture_name)
+ - [get_network_area_timer](functions-7.md#get_network_area_timer)
+ - [get_area_update_counter](functions-7.md#get_area_update_counter)
+ - [get_temp_s32_pointer](functions-7.md#get_temp_s32_pointer)
+ - [deref_s32_pointer](functions-7.md#deref_s32_pointer)
+ - [djui_popup_create_global](functions-7.md#djui_popup_create_global)
+ - [djui_is_popup_disabled](functions-7.md#djui_is_popup_disabled)
+ - [djui_set_popup_disabled_override](functions-7.md#djui_set_popup_disabled_override)
+ - [djui_reset_popup_disabled_override](functions-7.md#djui_reset_popup_disabled_override)
+ - [djui_is_playerlist_open](functions-7.md#djui_is_playerlist_open)
+ - [djui_attempting_to_open_playerlist](functions-7.md#djui_attempting_to_open_playerlist)
+ - [djui_get_playerlist_page_index](functions-7.md#djui_get_playerlist_page_index)
+ - [djui_menu_get_font](functions-7.md#djui_menu_get_font)
+ - [djui_menu_get_theme](functions-7.md#djui_menu_get_theme)
+ - [djui_is_playerlist_ping_visible](functions-7.md#djui_is_playerlist_ping_visible)
+ - [get_dialog_box_state](functions-7.md#get_dialog_box_state)
+ - [get_dialog_id](functions-7.md#get_dialog_id)
+ - [get_last_star_or_key](functions-7.md#get_last_star_or_key)
+ - [set_last_star_or_key](functions-7.md#set_last_star_or_key)
+ - [get_last_completed_course_num](functions-7.md#get_last_completed_course_num)
+ - [set_last_completed_course_num](functions-7.md#set_last_completed_course_num)
+ - [get_last_completed_star_num](functions-7.md#get_last_completed_star_num)
+ - [set_last_completed_star_num](functions-7.md#set_last_completed_star_num)
+ - [get_got_file_coin_hi_score](functions-7.md#get_got_file_coin_hi_score)
+ - [set_got_file_coin_hi_score](functions-7.md#set_got_file_coin_hi_score)
+ - [get_save_file_modified](functions-7.md#get_save_file_modified)
+ - [set_save_file_modified](functions-7.md#set_save_file_modified)
+ - [hud_hide](functions-7.md#hud_hide)
+ - [hud_show](functions-7.md#hud_show)
+ - [hud_is_hidden](functions-7.md#hud_is_hidden)
+ - [hud_get_value](functions-7.md#hud_get_value)
+ - [hud_set_value](functions-7.md#hud_set_value)
+ - [hud_render_power_meter](functions-7.md#hud_render_power_meter)
+ - [hud_render_power_meter_interpolated](functions-7.md#hud_render_power_meter_interpolated)
+ - [hud_get_flash](functions-7.md#hud_get_flash)
+ - [hud_set_flash](functions-7.md#hud_set_flash)
+ - [act_select_hud_hide](functions-7.md#act_select_hud_hide)
+ - [act_select_hud_show](functions-7.md#act_select_hud_show)
+ - [act_select_hud_is_hidden](functions-7.md#act_select_hud_is_hidden)
+ - [is_game_paused](functions-7.md#is_game_paused)
+ - [is_transition_playing](functions-7.md#is_transition_playing)
+ - [allocate_mario_action](functions-7.md#allocate_mario_action)
+ - [get_hand_foot_pos_x](functions-7.md#get_hand_foot_pos_x)
+ - [get_hand_foot_pos_y](functions-7.md#get_hand_foot_pos_y)
+ - [get_hand_foot_pos_z](functions-7.md#get_hand_foot_pos_z)
+ - [get_mario_anim_part_pos](functions-7.md#get_mario_anim_part_pos)
+ - [get_current_save_file_num](functions-7.md#get_current_save_file_num)
+ - [save_file_get_using_backup_slot](functions-7.md#save_file_get_using_backup_slot)
+ - [save_file_set_using_backup_slot](functions-7.md#save_file_set_using_backup_slot)
+ - [movtexqc_register](functions-7.md#movtexqc_register)
+ - [get_water_level](functions-7.md#get_water_level)
+ - [set_water_level](functions-7.md#set_water_level)
+ - [course_is_main_course](functions-7.md#course_is_main_course)
+ - [get_ttc_speed_setting](functions-7.md#get_ttc_speed_setting)
+ - [set_ttc_speed_setting](functions-7.md#set_ttc_speed_setting)
+ - [get_time](functions-7.md#get_time)
+ - [get_date_and_time](functions-7.md#get_date_and_time)
+ - [get_envfx](functions-7.md#get_envfx)
+ - [set_override_envfx](functions-7.md#set_override_envfx)
+ - [get_global_timer](functions-7.md#get_global_timer)
+ - [get_dialog_response](functions-7.md#get_dialog_response)
+ - [get_local_discord_id](functions-7.md#get_local_discord_id)
+ - [get_coopnet_id](functions-7.md#get_coopnet_id)
+ - [get_volume_master](functions-7.md#get_volume_master)
+ - [get_volume_level](functions-7.md#get_volume_level)
+ - [get_volume_sfx](functions-7.md#get_volume_sfx)
+ - [get_volume_env](functions-7.md#get_volume_env)
+ - [set_volume_master](functions-7.md#set_volume_master)
+ - [set_volume_level](functions-7.md#set_volume_level)
+ - [set_volume_sfx](functions-7.md#set_volume_sfx)
+ - [set_volume_env](functions-7.md#set_volume_env)
+ - [get_environment_region](functions-7.md#get_environment_region)
+ - [set_environment_region](functions-7.md#set_environment_region)
+ - [mod_file_exists](functions-7.md#mod_file_exists)
+ - [get_active_mod](functions-7.md#get_active_mod)
+ - [set_window_title](functions-7.md#set_window_title)
+ - [reset_window_title](functions-7.md#reset_window_title)
+ - [get_os_name](functions-7.md#get_os_name)
+ - [geo_get_current_root](functions-7.md#geo_get_current_root)
+ - [geo_get_current_master_list](functions-7.md#geo_get_current_master_list)
+ - [geo_get_current_perspective](functions-7.md#geo_get_current_perspective)
+ - [geo_get_current_camera](functions-7.md#geo_get_current_camera)
+ - [geo_get_current_held_object](functions-7.md#geo_get_current_held_object)
+ - [texture_to_lua_table](functions-7.md#texture_to_lua_table)
+ - [get_texture_name](functions-7.md#get_texture_name)
- smlua_model_utils.h
- - [smlua_model_util_get_id](functions-6.md#smlua_model_util_get_id)
+ - [smlua_model_util_get_id](functions-7.md#smlua_model_util_get_id)
- smlua_obj_utils.h
- - [spawn_sync_object](functions-6.md#spawn_sync_object)
- - [spawn_non_sync_object](functions-6.md#spawn_non_sync_object)
- - [obj_has_behavior_id](functions-6.md#obj_has_behavior_id)
- - [obj_has_model_extended](functions-6.md#obj_has_model_extended)
- - [obj_get_model_id_extended](functions-6.md#obj_get_model_id_extended)
- - [obj_set_model_extended](functions-6.md#obj_set_model_extended)
- - [get_trajectory](functions-6.md#get_trajectory)
- - [geo_get_current_object](functions-6.md#geo_get_current_object)
- - [get_current_object](functions-6.md#get_current_object)
- - [get_dialog_object](functions-6.md#get_dialog_object)
- - [get_cutscene_focus](functions-6.md#get_cutscene_focus)
- - [get_secondary_camera_focus](functions-6.md#get_secondary_camera_focus)
- - [set_cutscene_focus](functions-6.md#set_cutscene_focus)
- - [set_secondary_camera_focus](functions-6.md#set_secondary_camera_focus)
- - [obj_get_first](functions-6.md#obj_get_first)
- - [obj_get_first_with_behavior_id](functions-6.md#obj_get_first_with_behavior_id)
- - [obj_get_first_with_behavior_id_and_field_s32](functions-6.md#obj_get_first_with_behavior_id_and_field_s32)
- - [obj_get_first_with_behavior_id_and_field_f32](functions-6.md#obj_get_first_with_behavior_id_and_field_f32)
- - [obj_get_next](functions-6.md#obj_get_next)
- - [obj_get_next_with_same_behavior_id](functions-6.md#obj_get_next_with_same_behavior_id)
- - [obj_get_next_with_same_behavior_id_and_field_s32](functions-6.md#obj_get_next_with_same_behavior_id_and_field_s32)
- - [obj_get_next_with_same_behavior_id_and_field_f32](functions-6.md#obj_get_next_with_same_behavior_id_and_field_f32)
- - [obj_get_nearest_object_with_behavior_id](functions-6.md#obj_get_nearest_object_with_behavior_id)
- - [obj_count_objects_with_behavior_id](functions-6.md#obj_count_objects_with_behavior_id)
- - [obj_get_collided_object](functions-6.md#obj_get_collided_object)
- - [obj_get_field_u32](functions-6.md#obj_get_field_u32)
- - [obj_get_field_s32](functions-6.md#obj_get_field_s32)
- - [obj_get_field_f32](functions-6.md#obj_get_field_f32)
- - [obj_get_field_s16](functions-6.md#obj_get_field_s16)
- - [obj_set_field_u32](functions-6.md#obj_set_field_u32)
- - [obj_set_field_s32](functions-6.md#obj_set_field_s32)
- - [obj_set_field_f32](functions-6.md#obj_set_field_f32)
- - [obj_set_field_s16](functions-6.md#obj_set_field_s16)
- - [obj_get_temp_spawn_particles_info](functions-6.md#obj_get_temp_spawn_particles_info)
- - [get_temp_object_hitbox](functions-6.md#get_temp_object_hitbox)
- - [obj_is_attackable](functions-6.md#obj_is_attackable)
- - [obj_is_breakable_object](functions-6.md#obj_is_breakable_object)
- - [obj_is_bully](functions-6.md#obj_is_bully)
- - [obj_is_coin](functions-6.md#obj_is_coin)
- - [obj_is_exclamation_box](functions-6.md#obj_is_exclamation_box)
- - [obj_is_grabbable](functions-6.md#obj_is_grabbable)
- - [obj_is_mushroom_1up](functions-6.md#obj_is_mushroom_1up)
- - [obj_is_secret](functions-6.md#obj_is_secret)
- - [obj_is_valid_for_interaction](functions-6.md#obj_is_valid_for_interaction)
- - [obj_check_hitbox_overlap](functions-6.md#obj_check_hitbox_overlap)
- - [obj_check_overlap_with_hitbox_params](functions-6.md#obj_check_overlap_with_hitbox_params)
- - [obj_set_vel](functions-6.md#obj_set_vel)
- - [obj_move_xyz](functions-6.md#obj_move_xyz)
- - [set_whirlpools](functions-6.md#set_whirlpools)
+ - [spawn_sync_object](functions-7.md#spawn_sync_object)
+ - [spawn_non_sync_object](functions-7.md#spawn_non_sync_object)
+ - [obj_has_behavior_id](functions-7.md#obj_has_behavior_id)
+ - [obj_has_model_extended](functions-7.md#obj_has_model_extended)
+ - [obj_get_model_id_extended](functions-7.md#obj_get_model_id_extended)
+ - [obj_set_model_extended](functions-7.md#obj_set_model_extended)
+ - [get_trajectory](functions-7.md#get_trajectory)
+ - [geo_get_current_object](functions-7.md#geo_get_current_object)
+ - [get_current_object](functions-7.md#get_current_object)
+ - [get_dialog_object](functions-7.md#get_dialog_object)
+ - [get_cutscene_focus](functions-7.md#get_cutscene_focus)
+ - [get_secondary_camera_focus](functions-7.md#get_secondary_camera_focus)
+ - [set_cutscene_focus](functions-7.md#set_cutscene_focus)
+ - [set_secondary_camera_focus](functions-7.md#set_secondary_camera_focus)
+ - [obj_get_first](functions-7.md#obj_get_first)
+ - [obj_get_first_with_behavior_id](functions-7.md#obj_get_first_with_behavior_id)
+ - [obj_get_first_with_behavior_id_and_field_s32](functions-7.md#obj_get_first_with_behavior_id_and_field_s32)
+ - [obj_get_first_with_behavior_id_and_field_f32](functions-7.md#obj_get_first_with_behavior_id_and_field_f32)
+ - [obj_get_next](functions-7.md#obj_get_next)
+ - [obj_get_next_with_same_behavior_id](functions-7.md#obj_get_next_with_same_behavior_id)
+ - [obj_get_next_with_same_behavior_id_and_field_s32](functions-7.md#obj_get_next_with_same_behavior_id_and_field_s32)
+ - [obj_get_next_with_same_behavior_id_and_field_f32](functions-7.md#obj_get_next_with_same_behavior_id_and_field_f32)
+ - [obj_get_nearest_object_with_behavior_id](functions-7.md#obj_get_nearest_object_with_behavior_id)
+ - [obj_count_objects_with_behavior_id](functions-7.md#obj_count_objects_with_behavior_id)
+ - [obj_get_collided_object](functions-7.md#obj_get_collided_object)
+ - [obj_get_field_u32](functions-7.md#obj_get_field_u32)
+ - [obj_get_field_s32](functions-7.md#obj_get_field_s32)
+ - [obj_get_field_f32](functions-7.md#obj_get_field_f32)
+ - [obj_get_field_s16](functions-7.md#obj_get_field_s16)
+ - [obj_set_field_u32](functions-7.md#obj_set_field_u32)
+ - [obj_set_field_s32](functions-7.md#obj_set_field_s32)
+ - [obj_set_field_f32](functions-7.md#obj_set_field_f32)
+ - [obj_set_field_s16](functions-7.md#obj_set_field_s16)
+ - [obj_get_temp_spawn_particles_info](functions-7.md#obj_get_temp_spawn_particles_info)
+ - [get_temp_object_hitbox](functions-7.md#get_temp_object_hitbox)
+ - [obj_is_attackable](functions-7.md#obj_is_attackable)
+ - [obj_is_breakable_object](functions-7.md#obj_is_breakable_object)
+ - [obj_is_bully](functions-7.md#obj_is_bully)
+ - [obj_is_coin](functions-7.md#obj_is_coin)
+ - [obj_is_exclamation_box](functions-7.md#obj_is_exclamation_box)
+ - [obj_is_grabbable](functions-7.md#obj_is_grabbable)
+ - [obj_is_mushroom_1up](functions-7.md#obj_is_mushroom_1up)
+ - [obj_is_secret](functions-7.md#obj_is_secret)
+ - [obj_is_valid_for_interaction](functions-7.md#obj_is_valid_for_interaction)
+ - [obj_check_hitbox_overlap](functions-7.md#obj_check_hitbox_overlap)
+ - [obj_check_overlap_with_hitbox_params](functions-7.md#obj_check_overlap_with_hitbox_params)
+ - [obj_set_vel](functions-7.md#obj_set_vel)
+ - [obj_move_xyz](functions-7.md#obj_move_xyz)
+ - [set_whirlpools](functions-7.md#set_whirlpools)
- smlua_text_utils.h
- - [smlua_text_utils_reset_all](functions-6.md#smlua_text_utils_reset_all)
- - [smlua_text_utils_dialog_get](functions-6.md#smlua_text_utils_dialog_get)
- - [smlua_text_utils_dialog_replace](functions-6.md#smlua_text_utils_dialog_replace)
- - [smlua_text_utils_dialog_restore](functions-6.md#smlua_text_utils_dialog_restore)
- - [smlua_text_utils_dialog_is_replaced](functions-6.md#smlua_text_utils_dialog_is_replaced)
- - [smlua_text_utils_allocate_dialog](functions-6.md#smlua_text_utils_allocate_dialog)
- - [smlua_text_utils_course_acts_replace](functions-6.md#smlua_text_utils_course_acts_replace)
- - [smlua_text_utils_secret_star_replace](functions-6.md#smlua_text_utils_secret_star_replace)
- - [smlua_text_utils_course_name_replace](functions-6.md#smlua_text_utils_course_name_replace)
- - [smlua_text_utils_course_name_get](functions-6.md#smlua_text_utils_course_name_get)
- - [smlua_text_utils_course_name_mod_index](functions-6.md#smlua_text_utils_course_name_mod_index)
- - [smlua_text_utils_course_name_reset](functions-6.md#smlua_text_utils_course_name_reset)
- - [smlua_text_utils_act_name_replace](functions-6.md#smlua_text_utils_act_name_replace)
- - [smlua_text_utils_act_name_get](functions-6.md#smlua_text_utils_act_name_get)
- - [smlua_text_utils_act_name_mod_index](functions-6.md#smlua_text_utils_act_name_mod_index)
- - [smlua_text_utils_act_name_reset](functions-6.md#smlua_text_utils_act_name_reset)
- - [smlua_text_utils_castle_secret_stars_replace](functions-6.md#smlua_text_utils_castle_secret_stars_replace)
- - [smlua_text_utils_castle_secret_stars_get](functions-6.md#smlua_text_utils_castle_secret_stars_get)
- - [smlua_text_utils_castle_secret_stars_mod_index](functions-6.md#smlua_text_utils_castle_secret_stars_mod_index)
- - [smlua_text_utils_castle_secret_stars_reset](functions-6.md#smlua_text_utils_castle_secret_stars_reset)
- - [smlua_text_utils_extra_text_replace](functions-6.md#smlua_text_utils_extra_text_replace)
- - [smlua_text_utils_extra_text_get](functions-6.md#smlua_text_utils_extra_text_get)
- - [smlua_text_utils_extra_text_mod_index](functions-6.md#smlua_text_utils_extra_text_mod_index)
- - [smlua_text_utils_extra_text_reset](functions-6.md#smlua_text_utils_extra_text_reset)
- - [smlua_text_utils_get_language](functions-6.md#smlua_text_utils_get_language)
+ - [smlua_text_utils_reset_all](functions-7.md#smlua_text_utils_reset_all)
+ - [smlua_text_utils_dialog_get](functions-7.md#smlua_text_utils_dialog_get)
+ - [smlua_text_utils_dialog_replace](functions-7.md#smlua_text_utils_dialog_replace)
+ - [smlua_text_utils_dialog_restore](functions-7.md#smlua_text_utils_dialog_restore)
+ - [smlua_text_utils_dialog_is_replaced](functions-7.md#smlua_text_utils_dialog_is_replaced)
+ - [smlua_text_utils_allocate_dialog](functions-7.md#smlua_text_utils_allocate_dialog)
+ - [smlua_text_utils_course_acts_replace](functions-7.md#smlua_text_utils_course_acts_replace)
+ - [smlua_text_utils_secret_star_replace](functions-7.md#smlua_text_utils_secret_star_replace)
+ - [smlua_text_utils_course_name_replace](functions-7.md#smlua_text_utils_course_name_replace)
+ - [smlua_text_utils_course_name_get](functions-7.md#smlua_text_utils_course_name_get)
+ - [smlua_text_utils_course_name_mod_index](functions-7.md#smlua_text_utils_course_name_mod_index)
+ - [smlua_text_utils_course_name_reset](functions-7.md#smlua_text_utils_course_name_reset)
+ - [smlua_text_utils_act_name_replace](functions-7.md#smlua_text_utils_act_name_replace)
+ - [smlua_text_utils_act_name_get](functions-7.md#smlua_text_utils_act_name_get)
+ - [smlua_text_utils_act_name_mod_index](functions-7.md#smlua_text_utils_act_name_mod_index)
+ - [smlua_text_utils_act_name_reset](functions-7.md#smlua_text_utils_act_name_reset)
+ - [smlua_text_utils_castle_secret_stars_replace](functions-7.md#smlua_text_utils_castle_secret_stars_replace)
+ - [smlua_text_utils_castle_secret_stars_get](functions-7.md#smlua_text_utils_castle_secret_stars_get)
+ - [smlua_text_utils_castle_secret_stars_mod_index](functions-7.md#smlua_text_utils_castle_secret_stars_mod_index)
+ - [smlua_text_utils_castle_secret_stars_reset](functions-7.md#smlua_text_utils_castle_secret_stars_reset)
+ - [smlua_text_utils_extra_text_replace](functions-7.md#smlua_text_utils_extra_text_replace)
+ - [smlua_text_utils_extra_text_get](functions-7.md#smlua_text_utils_extra_text_get)
+ - [smlua_text_utils_extra_text_mod_index](functions-7.md#smlua_text_utils_extra_text_mod_index)
+ - [smlua_text_utils_extra_text_reset](functions-7.md#smlua_text_utils_extra_text_reset)
+ - [smlua_text_utils_get_language](functions-7.md#smlua_text_utils_get_language)
- sound_init.h
- - [reset_volume](functions-6.md#reset_volume)
- - [raise_background_noise](functions-6.md#raise_background_noise)
- - [lower_background_noise](functions-6.md#lower_background_noise)
- - [disable_background_sound](functions-6.md#disable_background_sound)
- - [enable_background_sound](functions-6.md#enable_background_sound)
- - [play_menu_sounds](functions-6.md#play_menu_sounds)
- - [play_painting_eject_sound](functions-6.md#play_painting_eject_sound)
- - [play_infinite_stairs_music](functions-6.md#play_infinite_stairs_music)
- - [set_background_music](functions-6.md#set_background_music)
- - [fadeout_music](functions-6.md#fadeout_music)
- - [fadeout_level_music](functions-6.md#fadeout_level_music)
- - [play_cutscene_music](functions-6.md#play_cutscene_music)
- - [play_shell_music](functions-6.md#play_shell_music)
- - [stop_shell_music](functions-6.md#stop_shell_music)
- - [play_cap_music](functions-6.md#play_cap_music)
- - [fadeout_cap_music](functions-6.md#fadeout_cap_music)
- - [stop_cap_music](functions-6.md#stop_cap_music)
+ - [reset_volume](functions-7.md#reset_volume)
+ - [raise_background_noise](functions-7.md#raise_background_noise)
+ - [lower_background_noise](functions-7.md#lower_background_noise)
+ - [disable_background_sound](functions-7.md#disable_background_sound)
+ - [enable_background_sound](functions-7.md#enable_background_sound)
+ - [play_menu_sounds](functions-7.md#play_menu_sounds)
+ - [play_painting_eject_sound](functions-7.md#play_painting_eject_sound)
+ - [play_infinite_stairs_music](functions-7.md#play_infinite_stairs_music)
+ - [set_background_music](functions-7.md#set_background_music)
+ - [fadeout_music](functions-7.md#fadeout_music)
+ - [fadeout_level_music](functions-7.md#fadeout_level_music)
+ - [play_cutscene_music](functions-7.md#play_cutscene_music)
+ - [play_shell_music](functions-7.md#play_shell_music)
+ - [stop_shell_music](functions-7.md#stop_shell_music)
+ - [play_cap_music](functions-7.md#play_cap_music)
+ - [fadeout_cap_music](functions-7.md#fadeout_cap_music)
+ - [stop_cap_music](functions-7.md#stop_cap_music)
- spawn_sound.h
- - [cur_obj_play_sound_1](functions-6.md#cur_obj_play_sound_1)
- - [cur_obj_play_sound_2](functions-6.md#cur_obj_play_sound_2)
- - [create_sound_spawner](functions-6.md#create_sound_spawner)
- - [calc_dist_to_volume_range_1](functions-6.md#calc_dist_to_volume_range_1)
- - [calc_dist_to_volume_range_2](functions-6.md#calc_dist_to_volume_range_2)
+ - [cur_obj_play_sound_1](functions-7.md#cur_obj_play_sound_1)
+ - [cur_obj_play_sound_2](functions-7.md#cur_obj_play_sound_2)
+ - [create_sound_spawner](functions-7.md#create_sound_spawner)
+ - [calc_dist_to_volume_range_1](functions-7.md#calc_dist_to_volume_range_1)
+ - [calc_dist_to_volume_range_2](functions-7.md#calc_dist_to_volume_range_2)
- surface_collision.h
- - [find_wall_collisions](functions-6.md#find_wall_collisions)
- - [find_ceil_height](functions-6.md#find_ceil_height)
- - [find_floor_height](functions-6.md#find_floor_height)
- - [find_water_level](functions-6.md#find_water_level)
- - [find_poison_gas_level](functions-6.md#find_poison_gas_level)
- - [set_find_wall_direction](functions-6.md#set_find_wall_direction)
- - [closest_point_to_triangle](functions-6.md#closest_point_to_triangle)
+ - [find_wall_collisions](functions-7.md#find_wall_collisions)
+ - [find_ceil_height](functions-7.md#find_ceil_height)
+ - [find_floor_height](functions-7.md#find_floor_height)
+ - [find_water_level](functions-7.md#find_water_level)
+ - [find_poison_gas_level](functions-7.md#find_poison_gas_level)
+ - [set_find_wall_direction](functions-7.md#set_find_wall_direction)
+ - [closest_point_to_triangle](functions-7.md#closest_point_to_triangle)
diff --git a/docs/lua/guides/lighting-engine.md b/docs/lua/guides/lighting-engine.md
index 54c5963cf..1805a4201 100644
--- a/docs/lua/guides/lighting-engine.md
+++ b/docs/lua/guides/lighting-engine.md
@@ -1,3 +1,5 @@
+## [:rewind: Lua Reference](../lua.md)
+
# How to use the Lighting Engine
## Section 1: Preparation
diff --git a/docs/lua/guides/mario-state.md b/docs/lua/guides/mario-state.md
index 7b215e650..f24cd0dd0 100644
--- a/docs/lua/guides/mario-state.md
+++ b/docs/lua/guides/mario-state.md
@@ -1,3 +1,5 @@
+## [:rewind: Lua Reference](../lua.md)
+
# How to use `gMarioStates`
## Section 1: What is `gMarioStates`?
diff --git a/docs/lua/guides/modfs.md b/docs/lua/guides/modfs.md
new file mode 100644
index 000000000..41be978bb
--- /dev/null
+++ b/docs/lua/guides/modfs.md
@@ -0,0 +1,272 @@
+## [:rewind: Lua Reference](../lua.md)
+
+# ModFS
+
+`ModFS` enables a small, sandboxed file system for mods. It allows to store and retrieve binary and text files, no matter their content.
+Each mod has its own file system, and can allow other mods to read its files.
+
+
+
+## Specs
+
+### File system
+
+Each ModFS file system:
+- Has a maximum size of **32 MB** (`MOD_FS_MAX_SIZE`). Files can be any size, as long as the cumulative sum of file sizes doesn't exceed this limit.
+- Can store at most **512 files** (`MOD_FS_MAX_FILES`).
+- Is stored on disk as a `.modfs` file, which is a ZIP file, containing all files written in it.
+
+The ModFS files are located in the `sav` directory at the usual save file location:
+- Windows: `%appdata%/sm64coopdx`
+- Linux: `~/.local/share/sm64coopdx`
+- MacOS: `~/Library/Application Support/sm64coopdx`
+
+### Files
+
+- The maximum filepath length is **256 characters** (`MOD_FS_MAX_PATH`), including the NUL terminator.
+- Filepaths have the following restrictions:
+ - Cannot start, end or have two or more consecutive `/`
+ - Can contain only valid ASCII characters, no `*` or `\`
+ - Cannot be called `properties.json` (this name is reserved for ModFS internal properties)
+ - Only the following extensions (and extension-less files) are allowed:
+ - text: `.txt`, `.json`, `.ini`, `.sav`
+ - actors: `.bin`, `.col`
+ - behaviors: `.bhv`
+ - textures: `.tex`, `.png`
+ - levels: `.lvl`
+ - audio: `.m64`, `.aiff`, `.mp3`, `.ogg`
+
+
+
+## [`ModFs`](../structs.md#ModFs)
+
+The object holding the file system of the mod.
+
+### Fields
+
+All fields are immutable.
+
+| Name | Type |
+| ----- | ---- |
+| mod | [Mod](../structs.md#Mod) |
+| modPath | `string` |
+| numFiles | `integer` |
+| totalSize | `integer` |
+| isPublic | `boolean` |
+
+Fields can be accessed in Lua with the dot `.` character:
+```lua
+print("The ModFS " .. modFs.modPath .. " contains " .. modFs.numFiles .. " files.")
+```
+
+### Methods
+
+| Name | Reference |
+| ---- | --------- |
+| get_filename | [`mod_fs_get_filename`](../functions-5.md#mod_fs_get_filename) |
+| get_file | [`mod_fs_get_file`](../functions-5.md#mod_fs_get_file) |
+| create_file | [`mod_fs_create_file`](../functions-5.md#mod_fs_create_file) |
+| move_file | [`mod_fs_move_file`](../functions-5.md#mod_fs_move_file) |
+| copy_file | [`mod_fs_copy_file`](../functions-5.md#mod_fs_copy_file) |
+| delete_file | [`mod_fs_delete_file`](../functions-5.md#mod_fs_delete_file) |
+| clear | [`mod_fs_clear`](../functions-5.md#mod_fs_clear) |
+| save | [`mod_fs_save`](../functions-5.md#mod_fs_save) |
+| delete | [`mod_fs_delete`](../functions-5.md#mod_fs_delete) |
+| set_public | [`mod_fs_set_public`](../functions-5.md#mod_fs_set_public) |
+
+Methods can be called in Lua with the colon `:` character:
+```lua
+print("The first file of ModFS " .. modFs.modPath .. " is named " .. modFs:get_filename(0) .. ".")
+```
+
+
+
+## [`ModFsFile`](../structs.md#ModFsFile)
+
+A handle to a ModFS file.
+
+### Fields
+
+All fields are immutable.
+
+| Field | Type |
+| ----- | ---- |
+| modFs | [ModFs](../structs.md#ModFs) |
+| filepath | `string` |
+| size | `integer` |
+| offset | `integer` |
+| isText | `boolean` |
+| isPublic | `boolean` |
+
+Fields can be accessed in Lua with the dot `.` character:
+```lua
+print("The ModFS file " .. file.filepath .. " is " .. file.size .. " bytes long.")
+```
+
+### Methods
+
+| Name | Reference |
+| ---- | --------- |
+| read_bool | [`mod_fs_file_read_bool`](../functions-5.md#mod_fs_file_read_bool) |
+| read_integer | [`mod_fs_file_read_integer`](../functions-5.md#mod_fs_file_read_integer) |
+| read_number | [`mod_fs_file_read_number`](../functions-5.md#mod_fs_file_read_number) |
+| read_bytes | [`mod_fs_file_read_bytes`](../functions-5.md#mod_fs_file_read_bytes) |
+| read_string | [`mod_fs_file_read_string`](../functions-5.md#mod_fs_file_read_string) |
+| read_line | [`mod_fs_file_read_line`](../functions-5.md#mod_fs_file_read_line) |
+| write_bool | [`mod_fs_file_write_bool`](../functions-5.md#mod_fs_file_write_bool) |
+| write_integer | [`mod_fs_file_write_integer`](../functions-5.md#mod_fs_file_write_integer) |
+| write_number | [`mod_fs_file_write_number`](../functions-5.md#mod_fs_file_write_number) |
+| write_bytes | [`mod_fs_file_write_bytes`](../functions-5.md#mod_fs_file_write_bytes) |
+| write_string | [`mod_fs_file_write_string`](../functions-5.md#mod_fs_file_write_string) |
+| write_line | [`mod_fs_file_write_line`](../functions-5.md#mod_fs_file_write_line) |
+| seek | [`mod_fs_file_seek`](../functions-5.md#mod_fs_file_seek) |
+| rewind | [`mod_fs_file_rewind`](../functions-5.md#mod_fs_file_rewind) |
+| is_eof | [`mod_fs_file_is_eof`](../functions-5.md#mod_fs_file_is_eof) |
+| fill | [`mod_fs_file_fill`](../functions-5.md#mod_fs_file_fill) |
+| erase | [`mod_fs_file_erase`](../functions-5.md#mod_fs_file_erase) |
+| set_text_mode | [`mod_fs_file_set_text_mode`](../functions-5.md#mod_fs_file_set_text_mode) |
+| set_public | [`mod_fs_file_set_public`](../functions-5.md#mod_fs_file_set_public) |
+
+Methods can be called in Lua with the colon `:` character:
+```lua
+file:erase(file.size)
+print("The ModFS file " .. file.filepath .. " is now empty.")
+```
+
+
+
+## Error handling
+
+All errors coming from ModFS functions are not blocking. However, they appear in the console and raise the "Mod has script errors" message.
+
+- The function [`mod_fs_hide_errors`](../functions-5.md#mod_fs_hide_errors) can suppress the ModFS errors from the console.
+- Use the function [`mod_fs_get_last_error`](../functions-5.md#mod_fs_get_last_error) to retrieve the last error raised by ModFS. This function always return an error message if an error occurred, even if errors are hidden.
+
+
+
+## Usage with other sm64coopdx features
+
+One of the strengths of this feature is its interactions with other existing features of sm64coopdx:
+- Load models with `smlua_model_util_get_id`
+- Load textures with `get_texture_info`
+- Load collisions with `smlua_collision_util_get`
+- Load sequences with `smlua_audio_utils_replace_sequence`
+- Load audio streams with `audio_stream_load`
+- Load audio samples with `audio_sample_load`
+
+These functions can take a **ModFS URI** as argument instead of a resource name.
+Generate a ModFS URI from a `ModFs` object with the following code:
+```lua
+local uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "")
+```
+
+Here are some examples:
+
+```lua
+-- Models
+local custom_geo_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "custom_geo.bin")
+local E_MODEL_CUSTOM = smlua_model_util_get_id(custom_geo_uri)
+
+-- Textures (both PNG and TEX)
+local texture_png_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "texture.png")
+local TEXTURE_PNG = get_texture_info(texture_png_uri)
+local texture_tex_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "texture.tex")
+local TEXTURE_TEX = get_texture_info(texture_tex_uri)
+
+-- Collisions
+local custom_col_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "custom_col.col")
+local COL_CUSTOM = smlua_collision_util_get(custom_col_uri)
+
+-- Sequences
+local custom_m64_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "custom.m64")
+smlua_audio_utils_replace_sequence(SEQ_LEVEL_GRASS, 0x11, 0x80, custom_m64_uri)
+
+-- Streams
+local custom_stream_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "custom_stream.mp3")
+local custom_stream = audio_stream_load(custom_stream_uri)
+
+-- Samples
+local custom_sample_uri = string.format(MOD_FS_URI_FORMAT, modFs.modPath, "custom_sample.mp3")
+local custom_sample = audio_sample_load(custom_sample_uri)
+```
+
+
+
+## Good practices
+
+### Always valid `ModFs` object
+
+Use the following piece of code to always retrieve a valid `ModFs` object:
+```lua
+local modFs = mod_fs_get() or mod_fs_create()
+```
+If the ModFS for the current mod doesn't exist, it will create one.
+
+
+
+### Always valid `ModFsFile` object
+
+Use the following piece of code to always retrieve a valid `ModFsFile` object:
+```lua
+local file = modFs:get_file("myfile.txt") or modFs:create_file("myfile.txt", true)
+```
+Like previously, if the file doesn't exist, it will create one.
+
+To make sure the file is empty when requested, add the following line to clear the existing file content.
+```lua
+file:erase(file.size)
+```
+
+
+
+### Correctly initialize a file
+
+The `get_file` method of a `ModFs` object opens a file only if the file is not loaded yet. Subsequent calls with the same filename will return the file handle without resetting its offset or mode.
+For example, one function could write to a file while another could read from the same file, so it's better to set the appropriate file offset and mode when it's needed before starting reading/writing:
+```lua
+local file = modFs:get_file("myfile.txt")
+file:set_text_mode(true) -- Set mode to text
+file:rewind() -- Reset offset to the beginning of the file
+```
+
+
+
+### Methods over functions
+
+Always use `ModFs` and `ModFsFile` objects methods over regular functions.
+It's more clear that way and helps to reduce errors:
+```lua
+-- Don't
+local file = mod_fs_create_file(modFs, "myfile.txt", true)
+
+-- Do
+local file = modFs:create_file("myfile.txt", true)
+```
+```lua
+-- Don't
+mod_fs_file_write_string(file, "some text")
+
+-- Do
+file:write_string("some text")
+```
+
+
+
+### Handle possible failures
+
+In addition to error messages that can be retrieved with [`mod_fs_get_last_error`](../functions-5.md#mod_fs_get_last_error), almost all ModFS functions have a boolean return value indicating if the function succeeded or failed.
+```lua
+if not modFs:delete_file("somefile") then
+ print(mod_fs_get_last_error())
+end
+```
+
+
+
+### Don't forget to save
+
+ModFS are not saved automatically when writing to files.
+The mod has to explicitly call the method `save` to save its ModFS on the disk.
+```lua
+modFs:save()
+```
diff --git a/docs/lua/guides/object-lists.md b/docs/lua/guides/object-lists.md
index 3a9ab5fbe..1d8a77ed8 100644
--- a/docs/lua/guides/object-lists.md
+++ b/docs/lua/guides/object-lists.md
@@ -1,3 +1,5 @@
+## [:rewind: Lua Reference](../lua.md)
+
# Every Behavior's Object List
| Behavior | Object List |
diff --git a/docs/lua/lua.md b/docs/lua/lua.md
index 4d579c0a9..553659b33 100644
--- a/docs/lua/lua.md
+++ b/docs/lua/lua.md
@@ -34,6 +34,8 @@ Save file locations:
- [Hooks](guides/hooks.md)
- [gMarioStates](guides/mario-state.md)
- [Behavior Object Lists](guides/object-lists.md)
+- [Lighting Engine](guides/lighting-engine.md)
+- [ModFS](guides/modfs.md)
## Important notes on player indices
diff --git a/docs/lua/structs.md b/docs/lua/structs.md
index 0083c2a6c..e11caf9f4 100644
--- a/docs/lua/structs.md
+++ b/docs/lua/structs.md
@@ -1956,7 +1956,7 @@
| Field | Type | Access |
| ----- | ---- | ------ |
-| file | [ModFile](structs.md#ModFile) | |
+| filepath | `string` | read-only |
| isStream | `boolean` | read-only |
| baseVolume | `number` | |
| loaded | `boolean` | read-only |
@@ -2002,6 +2002,21 @@
| totalSize | `integer` | read-only |
| isPublic | `boolean` | read-only |
+**Functions:**
+
+| Name | Reference |
+| ---- | --------- |
+| get_filename | [`mod_fs_get_filename`](functions-5.md#mod_fs_get_filename) |
+| get_file | [`mod_fs_get_file`](functions-5.md#mod_fs_get_file) |
+| create_file | [`mod_fs_create_file`](functions-5.md#mod_fs_create_file) |
+| move_file | [`mod_fs_move_file`](functions-5.md#mod_fs_move_file) |
+| copy_file | [`mod_fs_copy_file`](functions-5.md#mod_fs_copy_file) |
+| delete_file | [`mod_fs_delete_file`](functions-5.md#mod_fs_delete_file) |
+| clear | [`mod_fs_clear`](functions-5.md#mod_fs_clear) |
+| save | [`mod_fs_save`](functions-5.md#mod_fs_save) |
+| delete | [`mod_fs_delete`](functions-5.md#mod_fs_delete) |
+| set_public | [`mod_fs_set_public`](functions-5.md#mod_fs_set_public) |
+
[:arrow_up_small:](#)
@@ -2017,6 +2032,30 @@
| isText | `boolean` | read-only |
| isPublic | `boolean` | read-only |
+**Functions:**
+
+| Name | Reference |
+| ---- | --------- |
+| read_bool | [`mod_fs_file_read_bool`](functions-5.md#mod_fs_file_read_bool) |
+| read_integer | [`mod_fs_file_read_integer`](functions-5.md#mod_fs_file_read_integer) |
+| read_number | [`mod_fs_file_read_number`](functions-5.md#mod_fs_file_read_number) |
+| read_bytes | [`mod_fs_file_read_bytes`](functions-5.md#mod_fs_file_read_bytes) |
+| read_string | [`mod_fs_file_read_string`](functions-5.md#mod_fs_file_read_string) |
+| read_line | [`mod_fs_file_read_line`](functions-5.md#mod_fs_file_read_line) |
+| write_bool | [`mod_fs_file_write_bool`](functions-5.md#mod_fs_file_write_bool) |
+| write_integer | [`mod_fs_file_write_integer`](functions-5.md#mod_fs_file_write_integer) |
+| write_number | [`mod_fs_file_write_number`](functions-5.md#mod_fs_file_write_number) |
+| write_bytes | [`mod_fs_file_write_bytes`](functions-5.md#mod_fs_file_write_bytes) |
+| write_string | [`mod_fs_file_write_string`](functions-5.md#mod_fs_file_write_string) |
+| write_line | [`mod_fs_file_write_line`](functions-5.md#mod_fs_file_write_line) |
+| seek | [`mod_fs_file_seek`](functions-5.md#mod_fs_file_seek) |
+| rewind | [`mod_fs_file_rewind`](functions-5.md#mod_fs_file_rewind) |
+| is_eof | [`mod_fs_file_is_eof`](functions-5.md#mod_fs_file_is_eof) |
+| fill | [`mod_fs_file_fill`](functions-5.md#mod_fs_file_fill) |
+| erase | [`mod_fs_file_erase`](functions-5.md#mod_fs_file_erase) |
+| set_text_mode | [`mod_fs_file_set_text_mode`](functions-5.md#mod_fs_file_set_text_mode) |
+| set_public | [`mod_fs_file_set_public`](functions-5.md#mod_fs_file_set_public) |
+
[:arrow_up_small:](#)
diff --git a/src/pc/chat_commands.c b/src/pc/chat_commands.c
index 40d132b7d..adb2bec1e 100644
--- a/src/pc/chat_commands.c
+++ b/src/pc/chat_commands.c
@@ -8,6 +8,7 @@
#include "pc/network/moderator_list.h"
#include "pc/debuglog.h"
#include "pc/lua/utils/smlua_level_utils.h"
+#include "pc/mods/mods_utils.h"
#include "level_table.h"
#ifdef DEVELOPMENT
#include "pc/dev/chat.h"
@@ -39,10 +40,6 @@ static struct NetworkPlayer* chat_get_network_player(const char* name) {
return NULL;
}
-static bool str_starts_with(const char* pre, const char* str) {
- return strncmp(pre, str, strlen(pre)) == 0;
-}
-
static void chat_construct_player_message(struct NetworkPlayer* np, char* msg) {
char built[256] = { 0 };
snprintf(built, 256, "\\#fff982\\");
@@ -124,7 +121,7 @@ bool exec_chat_command(char* command) {
return true;
}
- if (str_starts_with("/kick ", command)) {
+ if (str_starts_with(command, "/kick ")) {
if (gNetworkType != NT_SERVER && !npl->moderator) {
djui_chat_message_create(DLANG(CHAT, NO_PERMS));
return true;
@@ -152,7 +149,7 @@ bool exec_chat_command(char* command) {
return true;
}
- if (str_starts_with("/ban ", command)) {
+ if (str_starts_with(command, "/ban ")) {
if (gNetworkType != NT_SERVER && !npl->moderator) {
djui_chat_message_create(DLANG(CHAT, NO_PERMS));
return true;
@@ -180,7 +177,7 @@ bool exec_chat_command(char* command) {
return true;
}
- if (str_starts_with("/permban ", command)) {
+ if (str_starts_with(command, "/permban ")) {
if (gNetworkType != NT_SERVER && !npl->moderator) {
djui_chat_message_create(DLANG(CHAT, NO_PERMS));
return true;
@@ -208,7 +205,7 @@ bool exec_chat_command(char* command) {
return true;
}
- if (str_starts_with("/moderator ", command)) {
+ if (str_starts_with(command, "/moderator ")) {
if (gNetworkType != NT_SERVER) {
djui_chat_message_create(DLANG(CHAT, SERVER_ONLY));
return true;
@@ -237,7 +234,7 @@ bool exec_chat_command(char* command) {
return true;
}
- if (str_starts_with("/nametags ", command)) {
+ if (str_starts_with(command, "/nametags ")) {
char *option = &command[10];
if (strcmp("show-tag", option) == 0) {
gNametagsSettings.showSelfTag = !gNametagsSettings.showSelfTag;
diff --git a/src/pc/dev/chat.c b/src/pc/dev/chat.c
index dc5a08fc1..7118c4665 100644
--- a/src/pc/dev/chat.c
+++ b/src/pc/dev/chat.c
@@ -8,15 +8,12 @@
#include "pc/network/moderator_list.h"
#include "pc/debuglog.h"
#include "pc/lua/utils/smlua_level_utils.h"
+#include "pc/mods/mods_utils.h"
#include "level_table.h"
#include "game/save_file.h"
#ifdef DEVELOPMENT
-static bool str_starts_with(const char* pre, char* str) {
- return strncmp(pre, str, strlen(pre)) == 0;
-}
-
// For case insensitivity
static const char *upper(char *str) {
static char buffer[50];
@@ -74,7 +71,7 @@ bool exec_dev_chat_command(char* command) {
return true;
}
- if (str_starts_with("/warp ", command)) {
+ if (str_starts_with(command, "/warp ")) {
static const struct { const char *name; s32 num; } sLevelNumByName[] = {
#undef STUB_LEVEL
#undef DEFINE_LEVEL
@@ -169,7 +166,7 @@ bool exec_dev_chat_command(char* command) {
return true;
}
- if (str_starts_with("/lua ", command)) {
+ if (str_starts_with(command, "/lua ")) {
smlua_exec_str(&command[5]);
return true;
}
@@ -179,7 +176,7 @@ bool exec_dev_chat_command(char* command) {
return true;
}
- if (str_starts_with("/luaf ", command)) {
+ if (str_starts_with(command, "/luaf ")) {
smlua_exec_file(&command[6]);
return true;
}
diff --git a/src/pc/lua/smlua.c b/src/pc/lua/smlua.c
index 762e502da..cd2502050 100644
--- a/src/pc/lua/smlua.c
+++ b/src/pc/lua/smlua.c
@@ -4,6 +4,8 @@
#include "game/hardcoded.h"
#include "pc/mods/mods.h"
#include "pc/mods/mods_utils.h"
+#include "pc/mods/mod_storage.h"
+#include "pc/mods/mod_fs.h"
#include "pc/crash_handler.h"
#include "pc/lua/utils/smlua_text_utils.h"
#include "pc/lua/utils/smlua_audio_utils.h"
@@ -352,7 +354,7 @@ void smlua_init(void) {
for (int j = 0; j < mod->fileCount; j++) {
struct ModFile* file = &mod->files[j];
// skip loading non-lua files
- if (!(str_ends_with(file->relativePath, ".lua") || str_ends_with(file->relativePath, ".luac"))) {
+ if (!(path_ends_with(file->relativePath, ".lua") || path_ends_with(file->relativePath, ".luac"))) {
continue;
}
@@ -418,6 +420,8 @@ void smlua_shutdown(void) {
smlua_model_util_clear();
smlua_level_util_reset();
smlua_anim_util_reset();
+ mod_storage_shutdown();
+ mod_fs_shutdown();
lua_State* L = gLuaState;
if (L != NULL) {
lua_close(L);
diff --git a/src/pc/lua/smlua_autogen.h b/src/pc/lua/smlua_autogen.h
index 53b49e5ed..5267c76e6 100644
--- a/src/pc/lua/smlua_autogen.h
+++ b/src/pc/lua/smlua_autogen.h
@@ -13,4 +13,7 @@
// Optional parameters must be contiguous until the last parameter (a mandatory parameter following an optional parameter is not allowed)
#define OPTIONAL
+// A macro to tell autogen the field `name` is a function member of the struct that calls `c_function`
+#define FUNCTION(name, c_function)
+
#endif // SMLUA_AUTOGEN_H
diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c
index bc8ca1cca..4f7da423a 100644
--- a/src/pc/lua/smlua_cobject.c
+++ b/src/pc/lua/smlua_cobject.c
@@ -98,7 +98,9 @@ static const char *sLuaLvtNames[] = {
[LVT_TRAJECTORY_P] = "Trajectory Pointer",
[LVT_TEXTURE_P] = "Texture Pointer",
[LVT_LUAFUNCTION] = "LuaFunction",
+ [LVT_LUATABLE] = "LuaTable",
[LVT_POINTER] = "Pointer",
+ [LVT_FUNCTION] = "Function",
[LVT_MAX] = "Max",
};
@@ -549,6 +551,14 @@ static int smlua__get_field(lua_State* L) {
return 0;
}
+ // CObject function members
+ if (data->valueType == LVT_FUNCTION) {
+ const char *function = (const char *) data->valueOffset;
+ lua_getglobal(L, function);
+ LUA_STACK_CHECK_END(L);
+ return 1;
+ }
+
u8* p = ((u8*)(intptr_t)pointer) + data->valueOffset;
if (data->count == 1) {
if (smlua_push_field(L, p, data)) {
diff --git a/src/pc/lua/smlua_cobject.h b/src/pc/lua/smlua_cobject.h
index 8976d3670..83cac836d 100644
--- a/src/pc/lua/smlua_cobject.h
+++ b/src/pc/lua/smlua_cobject.h
@@ -1,6 +1,8 @@
#ifndef SMLUA_COBJECT_H
#define SMLUA_COBJECT_H
+#include "lua.h"
+
enum LuaValueType {
LVT_BOOL,
LVT_BOOL_P,
@@ -31,7 +33,9 @@ enum LuaValueType {
LVT_TRAJECTORY_P,
LVT_TEXTURE_P,
LVT_LUAFUNCTION,
+ LVT_LUATABLE,
LVT_POINTER,
+ LVT_FUNCTION,
LVT_MAX,
};
diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c
index ca833cc68..aeec902f6 100644
--- a/src/pc/lua/smlua_cobject_autogen.c
+++ b/src/pc/lua/smlua_cobject_autogen.c
@@ -1607,10 +1607,10 @@ static struct LuaObjectField sModFields[LUA_MOD_FIELD_COUNT] = {
#define LUA_MOD_AUDIO_FIELD_COUNT 4
static struct LuaObjectField sModAudioFields[LUA_MOD_AUDIO_FIELD_COUNT] = {
- { "baseVolume", LVT_F32, offsetof(struct ModAudio, baseVolume), false, LOT_NONE, 1, sizeof(f32) },
- { "file", LVT_COBJECT_P, offsetof(struct ModAudio, file), false, LOT_MODFILE, 1, sizeof(struct ModFile*) },
- { "isStream", LVT_BOOL, offsetof(struct ModAudio, isStream), true, LOT_NONE, 1, sizeof(bool) },
- { "loaded", LVT_BOOL, offsetof(struct ModAudio, loaded), true, LOT_NONE, 1, sizeof(bool) },
+ { "baseVolume", LVT_F32, offsetof(struct ModAudio, baseVolume), false, LOT_NONE, 1, sizeof(f32) },
+ { "filepath", LVT_STRING_P, offsetof(struct ModAudio, filepath), true, LOT_NONE, 1, sizeof(const char*) },
+ { "isStream", LVT_BOOL, offsetof(struct ModAudio, isStream), true, LOT_NONE, 1, sizeof(bool) },
+ { "loaded", LVT_BOOL, offsetof(struct ModAudio, loaded), true, LOT_NONE, 1, sizeof(bool) },
};
#define LUA_MOD_AUDIO_SAMPLE_COPIES_FIELD_COUNT 3
@@ -1634,23 +1634,83 @@ static struct LuaObjectField sModFileFields[LUA_MOD_FILE_FIELD_COUNT] = {
{ "wroteBytes", LVT_U64, offsetof(struct ModFile, wroteBytes), true, LOT_NONE, 1, sizeof(u64) },
};
-#define LUA_MOD_FS_FIELD_COUNT 5
+static const char FUNCTION__mod_fs_clear[] = "mod_fs_clear";
+static const char FUNCTION__mod_fs_copy_file[] = "mod_fs_copy_file";
+static const char FUNCTION__mod_fs_create_file[] = "mod_fs_create_file";
+static const char FUNCTION__mod_fs_delete[] = "mod_fs_delete";
+static const char FUNCTION__mod_fs_delete_file[] = "mod_fs_delete_file";
+static const char FUNCTION__mod_fs_get_file[] = "mod_fs_get_file";
+static const char FUNCTION__mod_fs_get_filename[] = "mod_fs_get_filename";
+static const char FUNCTION__mod_fs_move_file[] = "mod_fs_move_file";
+static const char FUNCTION__mod_fs_save[] = "mod_fs_save";
+static const char FUNCTION__mod_fs_set_public[] = "mod_fs_set_public";
+
+#define LUA_MOD_FS_FIELD_COUNT 15
static struct LuaObjectField sModFsFields[LUA_MOD_FS_FIELD_COUNT] = {
- { "isPublic", LVT_BOOL, offsetof(struct ModFs, isPublic), true, LOT_NONE, 1, sizeof(bool) },
- { "mod", LVT_COBJECT_P, offsetof(struct ModFs, mod), true, LOT_MOD, 1, sizeof(struct Mod*) },
- { "modPath", LVT_STRING, offsetof(struct ModFs, modPath), true, LOT_NONE, 1, sizeof(char) },
- { "numFiles", LVT_U16, offsetof(struct ModFs, numFiles), true, LOT_NONE, 1, sizeof(u16) },
- { "totalSize", LVT_U32, offsetof(struct ModFs, totalSize), true, LOT_NONE, 1, sizeof(u32) },
+ { "clear", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_clear, true, LOT_NONE, 1, sizeof(const char *) },
+ { "copy_file", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_copy_file, true, LOT_NONE, 1, sizeof(const char *) },
+ { "create_file", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_create_file, true, LOT_NONE, 1, sizeof(const char *) },
+ { "delete", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_delete, true, LOT_NONE, 1, sizeof(const char *) },
+ { "delete_file", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_delete_file, true, LOT_NONE, 1, sizeof(const char *) },
+ { "get_file", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_get_file, true, LOT_NONE, 1, sizeof(const char *) },
+ { "get_filename", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_get_filename, true, LOT_NONE, 1, sizeof(const char *) },
+ { "isPublic", LVT_BOOL, offsetof(struct ModFs, isPublic), true, LOT_NONE, 1, sizeof(bool) },
+ { "mod", LVT_COBJECT_P, offsetof(struct ModFs, mod), true, LOT_MOD, 1, sizeof(struct Mod*) },
+ { "modPath", LVT_STRING, offsetof(struct ModFs, modPath), true, LOT_NONE, 1, sizeof(char) },
+ { "move_file", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_move_file, true, LOT_NONE, 1, sizeof(const char *) },
+ { "numFiles", LVT_U16, offsetof(struct ModFs, numFiles), true, LOT_NONE, 1, sizeof(u16) },
+ { "save", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_save, true, LOT_NONE, 1, sizeof(const char *) },
+ { "set_public", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_set_public, true, LOT_NONE, 1, sizeof(const char *) },
+ { "totalSize", LVT_U32, offsetof(struct ModFs, totalSize), true, LOT_NONE, 1, sizeof(u32) },
};
-#define LUA_MOD_FS_FILE_FIELD_COUNT 6
+static const char FUNCTION__mod_fs_file_erase[] = "mod_fs_file_erase";
+static const char FUNCTION__mod_fs_file_fill[] = "mod_fs_file_fill";
+static const char FUNCTION__mod_fs_file_is_eof[] = "mod_fs_file_is_eof";
+static const char FUNCTION__mod_fs_file_read_bool[] = "mod_fs_file_read_bool";
+static const char FUNCTION__mod_fs_file_read_bytes[] = "mod_fs_file_read_bytes";
+static const char FUNCTION__mod_fs_file_read_integer[] = "mod_fs_file_read_integer";
+static const char FUNCTION__mod_fs_file_read_line[] = "mod_fs_file_read_line";
+static const char FUNCTION__mod_fs_file_read_number[] = "mod_fs_file_read_number";
+static const char FUNCTION__mod_fs_file_read_string[] = "mod_fs_file_read_string";
+static const char FUNCTION__mod_fs_file_rewind[] = "mod_fs_file_rewind";
+static const char FUNCTION__mod_fs_file_seek[] = "mod_fs_file_seek";
+static const char FUNCTION__mod_fs_file_set_public[] = "mod_fs_file_set_public";
+static const char FUNCTION__mod_fs_file_set_text_mode[] = "mod_fs_file_set_text_mode";
+static const char FUNCTION__mod_fs_file_write_bool[] = "mod_fs_file_write_bool";
+static const char FUNCTION__mod_fs_file_write_bytes[] = "mod_fs_file_write_bytes";
+static const char FUNCTION__mod_fs_file_write_integer[] = "mod_fs_file_write_integer";
+static const char FUNCTION__mod_fs_file_write_line[] = "mod_fs_file_write_line";
+static const char FUNCTION__mod_fs_file_write_number[] = "mod_fs_file_write_number";
+static const char FUNCTION__mod_fs_file_write_string[] = "mod_fs_file_write_string";
+
+#define LUA_MOD_FS_FILE_FIELD_COUNT 25
static struct LuaObjectField sModFsFileFields[LUA_MOD_FS_FILE_FIELD_COUNT] = {
- { "filepath", LVT_STRING, offsetof(struct ModFsFile, filepath), true, LOT_NONE, 1, sizeof(char) },
- { "isPublic", LVT_BOOL, offsetof(struct ModFsFile, isPublic), true, LOT_NONE, 1, sizeof(bool) },
- { "isText", LVT_BOOL, offsetof(struct ModFsFile, isText), true, LOT_NONE, 1, sizeof(bool) },
- { "modFs", LVT_COBJECT_P, offsetof(struct ModFsFile, modFs), true, LOT_MODFS, 1, sizeof(struct ModFs*) },
- { "offset", LVT_U32, offsetof(struct ModFsFile, offset), true, LOT_NONE, 1, sizeof(u32) },
- { "size", LVT_U32, offsetof(struct ModFsFile, size), true, LOT_NONE, 1, sizeof(u32) },
+ { "erase", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_erase, true, LOT_NONE, 1, sizeof(const char *) },
+ { "filepath", LVT_STRING, offsetof(struct ModFsFile, filepath), true, LOT_NONE, 1, sizeof(char) },
+ { "fill", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_fill, true, LOT_NONE, 1, sizeof(const char *) },
+ { "isPublic", LVT_BOOL, offsetof(struct ModFsFile, isPublic), true, LOT_NONE, 1, sizeof(bool) },
+ { "isText", LVT_BOOL, offsetof(struct ModFsFile, isText), true, LOT_NONE, 1, sizeof(bool) },
+ { "is_eof", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_is_eof, true, LOT_NONE, 1, sizeof(const char *) },
+ { "modFs", LVT_COBJECT_P, offsetof(struct ModFsFile, modFs), true, LOT_MODFS, 1, sizeof(struct ModFs*) },
+ { "offset", LVT_U32, offsetof(struct ModFsFile, offset), true, LOT_NONE, 1, sizeof(u32) },
+ { "read_bool", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_bool, true, LOT_NONE, 1, sizeof(const char *) },
+ { "read_bytes", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_bytes, true, LOT_NONE, 1, sizeof(const char *) },
+ { "read_integer", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_integer, true, LOT_NONE, 1, sizeof(const char *) },
+ { "read_line", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_line, true, LOT_NONE, 1, sizeof(const char *) },
+ { "read_number", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_number, true, LOT_NONE, 1, sizeof(const char *) },
+ { "read_string", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_read_string, true, LOT_NONE, 1, sizeof(const char *) },
+ { "rewind", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_rewind, true, LOT_NONE, 1, sizeof(const char *) },
+ { "seek", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_seek, true, LOT_NONE, 1, sizeof(const char *) },
+ { "set_public", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_set_public, true, LOT_NONE, 1, sizeof(const char *) },
+ { "set_text_mode", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_set_text_mode, true, LOT_NONE, 1, sizeof(const char *) },
+ { "size", LVT_U32, offsetof(struct ModFsFile, size), true, LOT_NONE, 1, sizeof(u32) },
+ { "write_bool", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_bool, true, LOT_NONE, 1, sizeof(const char *) },
+ { "write_bytes", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_bytes, true, LOT_NONE, 1, sizeof(const char *) },
+ { "write_integer", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_integer, true, LOT_NONE, 1, sizeof(const char *) },
+ { "write_line", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_line, true, LOT_NONE, 1, sizeof(const char *) },
+ { "write_number", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_number, true, LOT_NONE, 1, sizeof(const char *) },
+ { "write_string", LVT_FUNCTION, (size_t) FUNCTION__mod_fs_file_write_string, true, LOT_NONE, 1, sizeof(const char *) },
};
#define LUA_MODE_TRANSITION_INFO_FIELD_COUNT 6
diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c
index e916e2a1b..3f2c1b199 100644
--- a/src/pc/lua/smlua_constants_autogen.c
+++ b/src/pc/lua/smlua_constants_autogen.c
@@ -2239,9 +2239,11 @@ char gSmluaConstants[] = ""
"GRAB_POS_LIGHT_OBJ=1\n"
"GRAB_POS_HEAVY_OBJ=2\n"
"GRAB_POS_BOWSER=3\n"
-"MOD_FS_MAX_SIZE=0x1000000\n"
-"MOD_FS_MAX_FILES=0x100\n"
+"MOD_FS_MAX_SIZE=0x2000000\n"
+"MOD_FS_MAX_FILES=0x200\n"
"MOD_FS_MAX_PATH=0x100\n"
+"MOD_FS_URI_PREFIX='modfs:/'\n"
+"MOD_FS_URI_FORMAT='modfs:/%s/%s'\n"
"INT_TYPE_U8=0\n"
"INT_TYPE_U16=1\n"
"INT_TYPE_U32=2\n"
@@ -2978,6 +2980,7 @@ char gSmluaConstants[] = ""
"L_CBUTTONS=CONT_C\n"
"R_CBUTTONS=CONT_F\n"
"D_CBUTTONS=CONT_D\n"
+"PALETTES_DIRECTORY='palettes'\n"
"MAX_PRESET_PALETTES=128\n"
"PANTS=0\n"
"SHIRT=1\n"
@@ -4621,5 +4624,7 @@ char gSmluaConstants[] = ""
"VERSION_TEXT='v'\n"
"VERSION_NUMBER=41\n"
"MINOR_VERSION_NUMBER=0\n"
+"GAME_NAME='sm64coopdx'\n"
+"WINDOW_NAME='Super Mario 64 Coop Deluxe'\n"
"MAX_VERSION_LENGTH=128\n"
;
\ No newline at end of file
diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c
index 50125e3ef..a76b089fb 100644
--- a/src/pc/lua/smlua_functions_autogen.c
+++ b/src/pc/lua/smlua_functions_autogen.c
@@ -22481,53 +22481,6 @@ int smlua_func_mod_fs_create(UNUSED lua_State* L) {
return 1;
}
-int smlua_func_mod_fs_delete(UNUSED lua_State* L) {
- if (L == NULL) { return 0; }
-
- int top = lua_gettop(L);
- if (top != 0) {
- LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_delete", 0, top);
- return 0;
- }
-
-
- lua_pushboolean(L, mod_fs_delete());
-
- return 1;
-}
-
-int smlua_func_mod_fs_save(UNUSED lua_State* L) {
- if (L == NULL) { return 0; }
-
- int top = lua_gettop(L);
- if (top != 0) {
- LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_save", 0, top);
- return 0;
- }
-
-
- lua_pushboolean(L, mod_fs_save());
-
- return 1;
-}
-
-int smlua_func_mod_fs_set_public(lua_State* L) {
- if (L == NULL) { return 0; }
-
- int top = lua_gettop(L);
- if (top != 1) {
- LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_set_public", 1, top);
- return 0;
- }
-
- bool pub = smlua_to_boolean(L, 1);
- if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_set_public"); return 0; }
-
- lua_pushboolean(L, mod_fs_set_public(pub));
-
- return 1;
-}
-
int smlua_func_mod_fs_get_filename(lua_State* L) {
if (L == NULL) { return 0; }
@@ -22669,6 +22622,59 @@ int smlua_func_mod_fs_clear(lua_State* L) {
return 1;
}
+int smlua_func_mod_fs_save(lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 1) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_save", 1, top);
+ return 0;
+ }
+
+ struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_save"); return 0; }
+
+ lua_pushboolean(L, mod_fs_save(modFs));
+
+ return 1;
+}
+
+int smlua_func_mod_fs_delete(lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 1) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_delete", 1, top);
+ return 0;
+ }
+
+ struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_delete"); return 0; }
+
+ lua_pushboolean(L, mod_fs_delete(modFs));
+
+ return 1;
+}
+
+int smlua_func_mod_fs_set_public(lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 2) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_set_public", 2, top);
+ return 0;
+ }
+
+ struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_set_public"); return 0; }
+ bool pub = smlua_to_boolean(L, 2);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_set_public"); return 0; }
+
+ lua_pushboolean(L, mod_fs_set_public(modFs, pub));
+
+ return 1;
+}
+
int smlua_func_mod_fs_file_read_bool(lua_State* L) {
if (L == NULL) { return 0; }
@@ -22916,6 +22922,23 @@ int smlua_func_mod_fs_file_seek(lua_State* L) {
return 1;
}
+int smlua_func_mod_fs_file_rewind(lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 1) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_rewind", 1, top);
+ return 0;
+ }
+
+ struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_rewind"); return 0; }
+
+ lua_pushboolean(L, mod_fs_file_rewind(file));
+
+ return 1;
+}
+
int smlua_func_mod_fs_file_is_eof(lua_State* L) {
if (L == NULL) { return 0; }
@@ -22973,6 +22996,25 @@ int smlua_func_mod_fs_file_erase(lua_State* L) {
return 1;
}
+int smlua_func_mod_fs_file_set_text_mode(lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 2) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_set_text_mode", 2, top);
+ return 0;
+ }
+
+ struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_set_text_mode"); return 0; }
+ bool text = smlua_to_boolean(L, 2);
+ if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_set_text_mode"); return 0; }
+
+ lua_pushboolean(L, mod_fs_file_set_text_mode(file, text));
+
+ return 1;
+}
+
int smlua_func_mod_fs_file_set_public(lua_State* L) {
if (L == NULL) { return 0; }
@@ -23136,6 +23178,21 @@ int smlua_func_mod_storage_load_bool(lua_State* L) {
return 1;
}
+int smlua_func_mod_storage_load_all(UNUSED lua_State* L) {
+ if (L == NULL) { return 0; }
+
+ int top = lua_gettop(L);
+ if (top != 0) {
+ LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_load_all", 0, top);
+ return 0;
+ }
+
+
+ smlua_push_lua_table(L, mod_storage_load_all());
+
+ return 1;
+}
+
int smlua_func_mod_storage_exists(lua_State* L) {
if (L == NULL) { return 0; }
@@ -37904,9 +37961,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "mod_fs_get", smlua_func_mod_fs_get);
smlua_bind_function(L, "mod_fs_reload", smlua_func_mod_fs_reload);
smlua_bind_function(L, "mod_fs_create", smlua_func_mod_fs_create);
- smlua_bind_function(L, "mod_fs_delete", smlua_func_mod_fs_delete);
- smlua_bind_function(L, "mod_fs_save", smlua_func_mod_fs_save);
- smlua_bind_function(L, "mod_fs_set_public", smlua_func_mod_fs_set_public);
smlua_bind_function(L, "mod_fs_get_filename", smlua_func_mod_fs_get_filename);
smlua_bind_function(L, "mod_fs_get_file", smlua_func_mod_fs_get_file);
smlua_bind_function(L, "mod_fs_create_file", smlua_func_mod_fs_create_file);
@@ -37914,6 +37968,9 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "mod_fs_copy_file", smlua_func_mod_fs_copy_file);
smlua_bind_function(L, "mod_fs_delete_file", smlua_func_mod_fs_delete_file);
smlua_bind_function(L, "mod_fs_clear", smlua_func_mod_fs_clear);
+ smlua_bind_function(L, "mod_fs_save", smlua_func_mod_fs_save);
+ smlua_bind_function(L, "mod_fs_delete", smlua_func_mod_fs_delete);
+ smlua_bind_function(L, "mod_fs_set_public", smlua_func_mod_fs_set_public);
smlua_bind_function(L, "mod_fs_file_read_bool", smlua_func_mod_fs_file_read_bool);
smlua_bind_function(L, "mod_fs_file_read_integer", smlua_func_mod_fs_file_read_integer);
smlua_bind_function(L, "mod_fs_file_read_number", smlua_func_mod_fs_file_read_number);
@@ -37927,9 +37984,11 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "mod_fs_file_write_string", smlua_func_mod_fs_file_write_string);
smlua_bind_function(L, "mod_fs_file_write_line", smlua_func_mod_fs_file_write_line);
smlua_bind_function(L, "mod_fs_file_seek", smlua_func_mod_fs_file_seek);
+ smlua_bind_function(L, "mod_fs_file_rewind", smlua_func_mod_fs_file_rewind);
smlua_bind_function(L, "mod_fs_file_is_eof", smlua_func_mod_fs_file_is_eof);
smlua_bind_function(L, "mod_fs_file_fill", smlua_func_mod_fs_file_fill);
smlua_bind_function(L, "mod_fs_file_erase", smlua_func_mod_fs_file_erase);
+ smlua_bind_function(L, "mod_fs_file_set_text_mode", smlua_func_mod_fs_file_set_text_mode);
smlua_bind_function(L, "mod_fs_file_set_public", smlua_func_mod_fs_file_set_public);
smlua_bind_function(L, "mod_fs_hide_errors", smlua_func_mod_fs_hide_errors);
smlua_bind_function(L, "mod_fs_get_last_error", smlua_func_mod_fs_get_last_error);
@@ -37941,6 +38000,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "mod_storage_load", smlua_func_mod_storage_load);
smlua_bind_function(L, "mod_storage_load_number", smlua_func_mod_storage_load_number);
smlua_bind_function(L, "mod_storage_load_bool", smlua_func_mod_storage_load_bool);
+ smlua_bind_function(L, "mod_storage_load_all", smlua_func_mod_storage_load_all);
smlua_bind_function(L, "mod_storage_exists", smlua_func_mod_storage_exists);
smlua_bind_function(L, "mod_storage_remove", smlua_func_mod_storage_remove);
smlua_bind_function(L, "mod_storage_clear", smlua_func_mod_storage_clear);
diff --git a/src/pc/lua/smlua_require.c b/src/pc/lua/smlua_require.c
index b1f1f636a..5852ac54a 100644
--- a/src/pc/lua/smlua_require.c
+++ b/src/pc/lua/smlua_require.c
@@ -96,7 +96,7 @@ static struct ModFile* smlua_find_mod_file(const char* moduleName) {
}
// only consider lua files
- if (!str_ends_with(file->relativePath, ".lua") && !str_ends_with(file->relativePath, ".luac")) {
+ if (!path_ends_with(file->relativePath, ".lua") && !path_ends_with(file->relativePath, ".luac")) {
continue;
}
@@ -118,7 +118,7 @@ static int smlua_custom_require(lua_State* L) {
return 0;
}
- if (str_ends_with(moduleName, "/") || str_ends_with(moduleName, "\\")) {
+ if (path_ends_with(moduleName, "/") || path_ends_with(moduleName, "\\")) {
LOG_LUA_LINE("cannot require a directory");
return 0;
}
diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c
index 138a88e49..496afb87b 100644
--- a/src/pc/lua/smlua_utils.c
+++ b/src/pc/lua/smlua_utils.c
@@ -156,6 +156,22 @@ LuaFunction smlua_to_lua_function(lua_State* L, int index) {
return luaL_ref(L, LUA_REGISTRYINDEX);
}
+LuaTable smlua_to_lua_table(lua_State* L, int index) {
+ if (lua_type(L, index) == LUA_TNIL) {
+ return 0;
+ }
+
+ if (lua_type(L, index) != LUA_TTABLE) {
+ LOG_LUA_LINE("smlua_to_lua_table received improper type '%s'", luaL_typename(L, index));
+ gSmLuaConvertSuccess = false;
+ return 0;
+ }
+
+ gSmLuaConvertSuccess = true;
+ lua_pushvalue(L, index);
+ return luaL_ref(L, LUA_REGISTRYINDEX);
+}
+
bool smlua_is_cobject(lua_State* L, int index, UNUSED u16 lot) {
return lua_isuserdata(L, index);
}
@@ -497,6 +513,14 @@ void smlua_push_table_field(int index, const char* name) {
///////////////////////////////////////////////////////////////////////////////////////////
+void smlua_push_lua_table(lua_State* L, LuaTable table) {
+ if (table != 0) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, table);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
void smlua_push_bytestring(lua_State* L, ByteString bytestring) {
if (bytestring.bytes) {
lua_pushlstring(L, bytestring.bytes, bytestring.length);
diff --git a/src/pc/lua/smlua_utils.h b/src/pc/lua/smlua_utils.h
index a855b0a02..6324fc57f 100644
--- a/src/pc/lua/smlua_utils.h
+++ b/src/pc/lua/smlua_utils.h
@@ -6,6 +6,7 @@
extern u8 gSmLuaConvertSuccess;
typedef int LuaFunction;
+typedef int LuaTable;
typedef struct ByteString {
const char *bytes;
@@ -27,6 +28,7 @@ lua_Number smlua_to_number(lua_State* L, int index);
const char* smlua_to_string(lua_State* L, int index);
ByteString smlua_to_bytestring(lua_State* L, int index);
LuaFunction smlua_to_lua_function(lua_State* L, int index);
+LuaTable smlua_to_lua_table(lua_State* L, int index);
bool smlua_is_cobject(lua_State* L, int index, u16 lot);
void* smlua_to_cobject(lua_State* L, int index, u16 lot);
void* smlua_to_cpointer(lua_State* L, int index, u16 lvt);
@@ -44,6 +46,7 @@ void smlua_push_string_field(int index, const char* name, const char* val);
void smlua_push_nil_field(int index, const char* name);
void smlua_push_table_field(int index, const char* name);
+void smlua_push_lua_table(lua_State* L, LuaTable table);
void smlua_push_bytestring(lua_State* L, ByteString bytestring);
void smlua_push_lnt(struct LSTNetworkType* lnt);
diff --git a/src/pc/lua/utils/smlua_audio_utils.c b/src/pc/lua/utils/smlua_audio_utils.c
index 2345b0878..03d0fa60c 100644
--- a/src/pc/lua/utils/smlua_audio_utils.c
+++ b/src/pc/lua/utils/smlua_audio_utils.c
@@ -10,6 +10,7 @@
#include "game/camera.h"
#include "engine/math_util.h"
#include "pc/mods/mods.h"
+#include "pc/mods/mod_fs.h"
#include "pc/lua/smlua.h"
#include "pc/lua/utils/smlua_audio_utils.h"
#include "pc/mods/mods_utils.h"
@@ -78,27 +79,37 @@ bool smlua_audio_utils_override(u8 sequenceId, s32* bankId, void** seqData) {
return true;
}
- static u8* buffer = NULL;
- static long int length = 0;
+ u8* buffer = NULL;
+ u32 length = 0;
- FILE* fp = f_open_r(override->filename);
- if (!fp) { return false; }
- f_seek(fp, 0L, SEEK_END);
- length = f_tell(fp);
+ if (is_mod_fs_file(override->filename)) {
+ if (!mod_fs_read_file_from_uri(override->filename, (void **) &buffer, &length)) {
+ return false;
+ }
+ } else {
+ FILE* fp = f_open_r(override->filename);
+ if (!fp) { return false; }
+ f_seek(fp, 0L, SEEK_END);
+ length = f_tell(fp);
+
+ buffer = malloc(length+1);
+ if (buffer == NULL) {
+ LOG_ERROR("Failed to malloc m64 sound file");
+ f_close(fp);
+ f_delete(fp);
+ return false;
+ }
+
+ f_seek(fp, 0L, SEEK_SET);
+ f_read(buffer, length, 1, fp);
- buffer = malloc(length+1);
- if (buffer == NULL) {
- LOG_ERROR("Failed to malloc m64 sound file");
f_close(fp);
f_delete(fp);
- return false;
}
- f_seek(fp, 0L, SEEK_SET);
- f_read(buffer, length, 1, fp);
-
- f_close(fp);
- f_delete(fp);
+ if (!buffer || !length) {
+ return false;
+ }
// cache
override->loaded = true;
@@ -110,6 +121,17 @@ bool smlua_audio_utils_override(u8 sequenceId, s32* bankId, void** seqData) {
return true;
}
+static void smlua_audio_utils_create_audio_override(u8 sequenceId, u8 bankId, u8 defaultVolume, const char *filepath) {
+ struct AudioOverride* override = &sAudioOverrides[sequenceId];
+ if (override->enabled) { audio_init(); }
+ smlua_audio_utils_reset(override);
+ LOG_INFO("Loading audio: %s", filepath);
+ override->filename = strdup(filepath);
+ override->enabled = true;
+ override->bank = bankId;
+ sound_set_background_music_default_volume(sequenceId, defaultVolume);
+}
+
void smlua_audio_utils_replace_sequence(u8 sequenceId, u8 bankId, u8 defaultVolume, const char* m64Name) {
if (gLuaActiveMod == NULL) { return; }
if (sequenceId >= MAX_AUDIO_OVERRIDE) {
@@ -122,6 +144,11 @@ void smlua_audio_utils_replace_sequence(u8 sequenceId, u8 bankId, u8 defaultVolu
return;
}
+ if (is_mod_fs_file(m64Name)) {
+ smlua_audio_utils_create_audio_override(sequenceId, bankId, defaultVolume, m64Name);
+ return;
+ }
+
char m64path[SYS_MAX_PATH] = { 0 };
if (snprintf(m64path, SYS_MAX_PATH-1, "sound/%s.m64", m64Name) < 0) {
LOG_LUA_LINE("Could not concat m64path: %s", m64path);
@@ -134,19 +161,8 @@ void smlua_audio_utils_replace_sequence(u8 sequenceId, u8 bankId, u8 defaultVolu
char relPath[SYS_MAX_PATH] = { 0 };
snprintf(relPath, SYS_MAX_PATH-1, "%s", file->relativePath);
normalize_path(relPath);
- if (str_ends_with(relPath, m64path)) {
- struct AudioOverride* override = &sAudioOverrides[sequenceId];
- if (override->enabled) { audio_init(); }
- smlua_audio_utils_reset(override);
- LOG_INFO("Loading audio: %s", file->cachedPath);
- override->filename = strdup(file->cachedPath);
- override->enabled = true;
- override->bank = bankId;
-#ifdef VERSION_EU
- //sBackgroundMusicDefaultVolume[sequenceId] = defaultVolume;
-#else
- sound_set_background_music_default_volume(sequenceId, defaultVolume);
-#endif
+ if (path_ends_with(relPath, m64path)) {
+ smlua_audio_utils_create_audio_override(sequenceId, bankId, defaultVolume, file->cachedPath);
return;
}
}
@@ -174,12 +190,12 @@ static void smlua_audio_custom_init(void) {
}
}
-static struct ModAudio* find_mod_audio(struct ModFile* file) {
+static struct ModAudio* find_mod_audio(const char *filepath) {
struct DynamicPoolNode* node = sModAudioPool->tail;
while (node) {
struct DynamicPoolNode* prev = node->prev;
struct ModAudio* audio = node->ptr;
- if (audio->file == file) { return audio; }
+ if (strcmp(filepath, audio->filepath) == 0) { return audio; }
node = prev;
}
return NULL;
@@ -209,7 +225,7 @@ struct ModAudio* audio_load_internal(const char* filename, bool isStream) {
const char* fileTypes[] = { ".mp3", ".aiff", ".ogg", NULL };
const char** ft = fileTypes;
while (*ft != NULL) {
- if (str_ends_with((char*)filename, (char*)*ft)) {
+ if (path_ends_with(filename, *ft)) {
validFileType = true;
break;
}
@@ -220,25 +236,30 @@ struct ModAudio* audio_load_internal(const char* filename, bool isStream) {
return NULL;
}
- // find mod file in mod list
- bool foundModFile = false;
- struct ModFile* modFile = NULL;
- u16 fileCount = gLuaActiveMod->fileCount;
- for (u16 i = 0; i < fileCount; i++) {
- struct ModFile* file = &gLuaActiveMod->files[i];
- if(str_ends_with(file->relativePath, (char*)filename)) {
- foundModFile = true;
- modFile = file;
- break;
+ const char *filepath = filename;
+ if (!is_mod_fs_file(filename)) {
+
+ // find mod file in mod list
+ bool foundModFile = false;
+ struct ModFile* modFile = NULL;
+ u16 fileCount = gLuaActiveMod->fileCount;
+ for (u16 i = 0; i < fileCount; i++) {
+ struct ModFile* file = &gLuaActiveMod->files[i];
+ if(path_ends_with(file->relativePath, filename)) {
+ foundModFile = true;
+ modFile = file;
+ break;
+ }
}
- }
- if (!foundModFile) {
- LOG_LUA_LINE("Could not find audio file: '%s'", filename);
- return NULL;
+ if (!foundModFile) {
+ LOG_LUA_LINE("Could not find audio file: '%s'", filename);
+ return NULL;
+ }
+ filepath = modFile->cachedPath;
}
// find stream in ModAudio list
- struct ModAudio* audio = find_mod_audio(modFile);
+ struct ModAudio* audio = find_mod_audio(filepath);
if (audio) {
if (isStream == audio->isStream) {
return audio;
@@ -261,36 +282,52 @@ struct ModAudio* audio_load_internal(const char* filename, bool isStream) {
}
// remember file
- audio->file = modFile;
+ audio->filepath = strdup(filepath);
- // load audio
- FILE *f = f_open_r(modFile->cachedPath);
- if (!f) {
- LOG_ERROR("failed to load audio file '%s': file not found", filename);
- return NULL;
- }
+ void *buffer = NULL;
+ u32 size = 0;
- f_seek(f, 0, SEEK_END);
- u32 size = f_tell(f);
- f_rewind(f);
- void *buffer = calloc(size, 1);
- if (!buffer) {
+ if (is_mod_fs_file(filepath)) {
+ if (!mod_fs_read_file_from_uri(filepath, &buffer, &size)) {
+ LOG_ERROR("failed to load audio file '%s': an error occurred with modfs", filename);
+ return NULL;
+ }
+ } else {
+
+ // load audio
+ FILE *f = f_open_r(filepath);
+ if (!f) {
+ LOG_ERROR("failed to load audio file '%s': file not found", filename);
+ return NULL;
+ }
+
+ f_seek(f, 0, SEEK_END);
+ size = f_tell(f);
+ f_rewind(f);
+ buffer = calloc(size, 1);
+ if (!buffer) {
+ f_close(f);
+ f_delete(f);
+ LOG_ERROR("failed to load audio file '%s': cannot allocate buffer of size: %d", filename, size);
+ return NULL;
+ }
+
+ // read the audio buffer
+ if (f_read(buffer, 1, size, f) < size) {
+ free(buffer);
+ f_close(f);
+ f_delete(f);
+ LOG_ERROR("failed to load audio file '%s': cannot read audio buffer of size: %d", filename, size);
+ return NULL;
+ }
f_close(f);
f_delete(f);
- LOG_ERROR("failed to load audio file '%s': cannot allocate buffer of size: %d", filename, size);
- return NULL;
}
- // read the audio buffer
- if (f_read(buffer, 1, size, f) < size) {
- free(buffer);
- f_close(f);
- f_delete(f);
- LOG_ERROR("failed to load audio file '%s': cannot read audio buffer of size: %d", filename, size);
+ if (!buffer || !size) {
+ LOG_ERROR("failed to load audio file '%s': failed to read audio data", filename);
return NULL;
}
- f_close(f);
- f_delete(f);
// decode the audio buffer
ma_result result = ma_decoder_init_memory(buffer, size, NULL, &audio->decoder);
@@ -604,6 +641,7 @@ void audio_custom_shutdown(void) {
audio_sample_destroy_copies(audio);
}
ma_sound_uninit(&audio->sound);
+ free((void *) audio->filepath);
}
dynamic_pool_free(sModAudioPool, audio);
node = prev;
diff --git a/src/pc/lua/utils/smlua_audio_utils.h b/src/pc/lua/utils/smlua_audio_utils.h
index 4fc276548..deca8b0d0 100644
--- a/src/pc/lua/utils/smlua_audio_utils.h
+++ b/src/pc/lua/utils/smlua_audio_utils.h
@@ -22,7 +22,7 @@ struct ModAudioSampleCopies {
};
struct ModAudio {
- struct ModFile* file;
+ const char *filepath;
ma_sound sound;
ma_decoder decoder;
void *buffer;
diff --git a/src/pc/mods/mod.c b/src/pc/mods/mod.c
index 3b163cae6..aca944c85 100644
--- a/src/pc/mods/mod.c
+++ b/src/pc/mods/mod.c
@@ -23,7 +23,7 @@ size_t mod_get_lua_size(struct Mod* mod) {
for (int i = 0; i < mod->fileCount; i++) {
struct ModFile* file = &mod->files[i];
- if (!(str_ends_with(file->relativePath, ".lua") || str_ends_with(file->relativePath, ".luac"))) { continue; }
+ if (!(path_ends_with(file->relativePath, ".lua") || path_ends_with(file->relativePath, ".luac"))) { continue; }
size += file->size;
}
@@ -161,19 +161,19 @@ void mod_activate(struct Mod* mod) {
mod_cache_update(mod, file);
}
- if (str_ends_with(file->relativePath, ".bin")) {
+ if (path_ends_with(file->relativePath, ".bin")) {
mod_activate_bin(mod, file);
}
- if (str_ends_with(file->relativePath, ".col")) {
+ if (path_ends_with(file->relativePath, ".col")) {
mod_activate_col(file);
}
- if (str_ends_with(file->relativePath, ".lvl")) {
+ if (path_ends_with(file->relativePath, ".lvl")) {
mod_activate_lvl(mod, file);
}
- if (str_ends_with(file->relativePath, ".bhv")) {
+ if (path_ends_with(file->relativePath, ".bhv")) {
mod_activate_bhv(mod, file);
}
- if (str_ends_with(file->relativePath, ".tex")) {
+ if (path_ends_with(file->relativePath, ".tex")) {
mod_activate_tex(file);
}
}
@@ -337,7 +337,7 @@ static bool mod_load_files_dir(struct Mod* mod, char* fullPath, const char* subD
bool fileTypeMatch = false;
const char** ft = fileTypes;
while (*ft != NULL) {
- if (str_ends_with(path, (char*)*ft)) {
+ if (path_ends_with(path, (char*)*ft)) {
fileTypeMatch = true;
}
ft++;
@@ -562,7 +562,7 @@ bool mod_load(struct Mods* mods, char* basePath, char* modName) {
bool isDirectory = fs_sys_dir_exists(fullPath);
// make sure mod is valid
- if (str_ends_with(modName, ".lua")) {
+ if (path_ends_with(modName, ".lua")) {
valid = true;
} else if (fs_sys_dir_exists(fullPath)) {
char tmpPath[SYS_MAX_PATH] = { 0 };
diff --git a/src/pc/mods/mod_fs.cpp b/src/pc/mods/mod_fs.cpp
index c141e64e0..1dcfb4305 100644
--- a/src/pc/mods/mod_fs.cpp
+++ b/src/pc/mods/mod_fs.cpp
@@ -2,20 +2,38 @@ extern "C" {
#include "mod_fs.h"
#include "src/pc/fs/fs.h"
#include "src/pc/mods/mods_utils.h"
+#include "pc/utils/miniz/miniz.h"
}
#include
#include
#include
#include