From f7f10b98812d35047f490cf664f410a8999a187c Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 26 Oct 2023 17:15:01 -0700 Subject: [PATCH] Ran autogen --- autogen/lua_definitions/functions.lua | 5 + autogen/lua_definitions/structs.lua | 1 + docs/lua/functions-2.md | 18 +++ docs/lua/functions.md | 1 + docs/lua/structs.md | 1 + src/pc/lua/smlua_cobject_autogen.c | 159 +++++++++++++------------- src/pc/lua/smlua_functions_autogen.c | 17 +++ 7 files changed, 123 insertions(+), 79 deletions(-) diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 8ae4e10c..b29c3063 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -78,6 +78,11 @@ function bhv_1up_sliding_loop() -- ... end +--- @return nil +function bhv_1up_trigger_init() + -- ... +end + --- @return nil function bhv_1up_walking_loop() -- ... diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 6cc77df4..59caa8ff 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -785,6 +785,7 @@ --- @field public prevNumStarsForDialog integer --- @field public quicksandDepth number --- @field public riddenObj Object +--- @field public skipWarpInteractionsTimer integer --- @field public slideVelX number --- @field public slideVelZ number --- @field public slideYaw integer diff --git a/docs/lua/functions-2.md b/docs/lua/functions-2.md index cac33819..12016f61 100644 --- a/docs/lua/functions-2.md +++ b/docs/lua/functions-2.md @@ -232,6 +232,24 @@
+## [bhv_1up_trigger_init](#bhv_1up_trigger_init) + +### Lua Example +`bhv_1up_trigger_init()` + +### Parameters +- None + +### Returns +- None + +### C Prototype +`void bhv_1up_trigger_init(void);` + +[:arrow_up_small:](#) + +
+ ## [bhv_1up_walking_loop](#bhv_1up_walking_loop) ### Lua Example diff --git a/docs/lua/functions.md b/docs/lua/functions.md index a45471db..9fc15ad1 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -39,6 +39,7 @@ - [bhv_1up_loop](functions-2.md#bhv_1up_loop) - [bhv_1up_running_away_loop](functions-2.md#bhv_1up_running_away_loop) - [bhv_1up_sliding_loop](functions-2.md#bhv_1up_sliding_loop) + - [bhv_1up_trigger_init](functions-2.md#bhv_1up_trigger_init) - [bhv_1up_walking_loop](functions-2.md#bhv_1up_walking_loop) - [bhv_act_selector_init](functions-2.md#bhv_act_selector_init) - [bhv_act_selector_loop](functions-2.md#bhv_act_selector_loop) diff --git a/docs/lua/structs.md b/docs/lua/structs.md index 619e6593..243f10aa 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -1131,6 +1131,7 @@ | prevNumStarsForDialog | `integer` | | | quicksandDepth | `number` | | | riddenObj | [Object](structs.md#Object) | | +| skipWarpInteractionsTimer | `integer` | | | slideVelX | `number` | | | slideVelZ | `number` | | | slideYaw | `integer` | | diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index be72ec4f..a2e2be6e 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -837,86 +837,87 @@ static struct LuaObjectField sMarioBodyStateFields[LUA_MARIO_BODY_STATE_FIELD_CO { "wingFlutter", LVT_S8, offsetof(struct MarioBodyState, wingFlutter), false, LOT_NONE }, }; -#define LUA_MARIO_STATE_FIELD_COUNT 78 +#define LUA_MARIO_STATE_FIELD_COUNT 79 static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = { - { "action", LVT_U32, offsetof(struct MarioState, action), false, LOT_NONE }, - { "actionArg", LVT_U32, offsetof(struct MarioState, actionArg), false, LOT_NONE }, - { "actionState", LVT_U16, offsetof(struct MarioState, actionState), false, LOT_NONE }, - { "actionTimer", LVT_U16, offsetof(struct MarioState, actionTimer), false, LOT_NONE }, - { "angleVel", LVT_COBJECT, offsetof(struct MarioState, angleVel), true, LOT_VEC3S }, - { "animation", LVT_COBJECT_P, offsetof(struct MarioState, animation), false, LOT_MARIOANIMATION }, - { "area", LVT_COBJECT_P, offsetof(struct MarioState, area), true, LOT_AREA }, - { "bounceSquishTimer", LVT_U8, offsetof(struct MarioState, bounceSquishTimer), false, LOT_NONE }, - { "bubbleObj", LVT_COBJECT_P, offsetof(struct MarioState, bubbleObj), false, LOT_OBJECT }, - { "cap", LVT_U32, offsetof(struct MarioState, cap), false, LOT_NONE }, - { "capTimer", LVT_U16, offsetof(struct MarioState, capTimer), false, LOT_NONE }, - { "ceil", LVT_COBJECT_P, offsetof(struct MarioState, ceil), false, LOT_SURFACE }, - { "ceilHeight", LVT_F32, offsetof(struct MarioState, ceilHeight), false, LOT_NONE }, - { "character", LVT_COBJECT_P, offsetof(struct MarioState, character), false, LOT_CHARACTER }, - { "collidedObjInteractTypes", LVT_U32, offsetof(struct MarioState, collidedObjInteractTypes), false, LOT_NONE }, - { "controller", LVT_COBJECT_P, offsetof(struct MarioState, controller), true, LOT_CONTROLLER }, - { "curAnimOffset", LVT_F32, offsetof(struct MarioState, curAnimOffset), false, LOT_NONE }, - { "currentRoom", LVT_S16, offsetof(struct MarioState, currentRoom), false, LOT_NONE }, - { "doubleJumpTimer", LVT_U8, offsetof(struct MarioState, doubleJumpTimer), false, LOT_NONE }, - { "faceAngle", LVT_COBJECT, offsetof(struct MarioState, faceAngle), true, LOT_VEC3S }, - { "fadeWarpOpacity", LVT_U8, offsetof(struct MarioState, fadeWarpOpacity), false, LOT_NONE }, - { "flags", LVT_U32, offsetof(struct MarioState, flags), false, LOT_NONE }, - { "floor", LVT_COBJECT_P, offsetof(struct MarioState, floor), false, LOT_SURFACE }, - { "floorAngle", LVT_S16, offsetof(struct MarioState, floorAngle), false, LOT_NONE }, - { "floorHeight", LVT_F32, offsetof(struct MarioState, floorHeight), false, LOT_NONE }, - { "forwardVel", LVT_F32, offsetof(struct MarioState, forwardVel), false, LOT_NONE }, - { "framesSinceA", LVT_U8, offsetof(struct MarioState, framesSinceA), false, LOT_NONE }, - { "framesSinceB", LVT_U8, offsetof(struct MarioState, framesSinceB), false, LOT_NONE }, - { "freeze", LVT_U8, offsetof(struct MarioState, freeze), false, LOT_NONE }, - { "healCounter", LVT_U8, offsetof(struct MarioState, healCounter), false, LOT_NONE }, - { "health", LVT_S16, offsetof(struct MarioState, health), false, LOT_NONE }, - { "heldByObj", LVT_COBJECT_P, offsetof(struct MarioState, heldByObj), false, LOT_OBJECT }, - { "heldObj", LVT_COBJECT_P, offsetof(struct MarioState, heldObj), false, LOT_OBJECT }, - { "hurtCounter", LVT_U8, offsetof(struct MarioState, hurtCounter), false, LOT_NONE }, - { "input", LVT_U16, offsetof(struct MarioState, input), false, LOT_NONE }, - { "intendedMag", LVT_F32, offsetof(struct MarioState, intendedMag), false, LOT_NONE }, - { "intendedYaw", LVT_S16, offsetof(struct MarioState, intendedYaw), false, LOT_NONE }, - { "interactObj", LVT_COBJECT_P, offsetof(struct MarioState, interactObj), false, LOT_OBJECT }, - { "invincTimer", LVT_S16, offsetof(struct MarioState, invincTimer), false, LOT_NONE }, - { "isSnoring", LVT_U8, offsetof(struct MarioState, isSnoring), false, LOT_NONE }, - { "knockbackTimer", LVT_U8, offsetof(struct MarioState, knockbackTimer), false, LOT_NONE }, - { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), true, LOT_MARIOBODYSTATE }, - { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), true, LOT_OBJECT }, - { "minimumBoneY", LVT_F32, offsetof(struct MarioState, minimumBoneY), false, LOT_NONE }, - { "nonInstantWarpPos", LVT_COBJECT, offsetof(struct MarioState, nonInstantWarpPos), true, LOT_VEC3F }, - { "numCoins", LVT_S16, offsetof(struct MarioState, numCoins), false, LOT_NONE }, - { "numKeys", LVT_S8, offsetof(struct MarioState, numKeys), false, LOT_NONE }, - { "numLives", LVT_S8, offsetof(struct MarioState, numLives), false, LOT_NONE }, - { "numStars", LVT_S16, offsetof(struct MarioState, numStars), false, LOT_NONE }, - { "particleFlags", LVT_U32, offsetof(struct MarioState, particleFlags), false, LOT_NONE }, - { "peakHeight", LVT_F32, offsetof(struct MarioState, peakHeight), false, LOT_NONE }, - { "playerIndex", LVT_U16, offsetof(struct MarioState, playerIndex), true, LOT_NONE }, - { "pos", LVT_COBJECT, offsetof(struct MarioState, pos), true, LOT_VEC3F }, - { "prevAction", LVT_U32, offsetof(struct MarioState, prevAction), false, LOT_NONE }, - { "prevNumStarsForDialog", LVT_S16, offsetof(struct MarioState, prevNumStarsForDialog), false, LOT_NONE }, - { "quicksandDepth", LVT_F32, offsetof(struct MarioState, quicksandDepth), false, LOT_NONE }, - { "riddenObj", LVT_COBJECT_P, offsetof(struct MarioState, riddenObj), false, LOT_OBJECT }, - { "slideVelX", LVT_F32, offsetof(struct MarioState, slideVelX), false, LOT_NONE }, - { "slideVelZ", LVT_F32, offsetof(struct MarioState, slideVelZ), false, LOT_NONE }, - { "slideYaw", LVT_S16, offsetof(struct MarioState, slideYaw), false, LOT_NONE }, - { "spawnInfo", LVT_COBJECT_P, offsetof(struct MarioState, spawnInfo), false, LOT_SPAWNINFO }, - { "specialTripleJump", LVT_U8, offsetof(struct MarioState, specialTripleJump), false, LOT_NONE }, - { "splineKeyframe", LVT_COBJECT_P, offsetof(struct MarioState, splineKeyframe), false, LOT_POINTER }, - { "splineKeyframeFraction", LVT_F32, offsetof(struct MarioState, splineKeyframeFraction), false, LOT_NONE }, - { "splineState", LVT_S32, offsetof(struct MarioState, splineState), false, LOT_NONE }, - { "squishTimer", LVT_U8, offsetof(struct MarioState, squishTimer), false, LOT_NONE }, - { "statusForCamera", LVT_COBJECT_P, offsetof(struct MarioState, statusForCamera), true, LOT_PLAYERCAMERASTATE }, - { "terrainSoundAddend", LVT_U32, offsetof(struct MarioState, terrainSoundAddend), false, LOT_NONE }, - { "twirlYaw", LVT_S16, offsetof(struct MarioState, twirlYaw), false, LOT_NONE }, - { "unkB0", LVT_S16, offsetof(struct MarioState, unkB0), false, LOT_NONE }, - { "unkC4", LVT_F32, offsetof(struct MarioState, unkC4), false, LOT_NONE }, - { "usedObj", LVT_COBJECT_P, offsetof(struct MarioState, usedObj), false, LOT_OBJECT }, - { "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F }, - { "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE }, - { "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE }, - { "wallNormal", LVT_COBJECT, offsetof(struct MarioState, wallNormal), true, LOT_VEC3F }, - { "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE }, - { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, + { "action", LVT_U32, offsetof(struct MarioState, action), false, LOT_NONE }, + { "actionArg", LVT_U32, offsetof(struct MarioState, actionArg), false, LOT_NONE }, + { "actionState", LVT_U16, offsetof(struct MarioState, actionState), false, LOT_NONE }, + { "actionTimer", LVT_U16, offsetof(struct MarioState, actionTimer), false, LOT_NONE }, + { "angleVel", LVT_COBJECT, offsetof(struct MarioState, angleVel), true, LOT_VEC3S }, + { "animation", LVT_COBJECT_P, offsetof(struct MarioState, animation), false, LOT_MARIOANIMATION }, + { "area", LVT_COBJECT_P, offsetof(struct MarioState, area), true, LOT_AREA }, + { "bounceSquishTimer", LVT_U8, offsetof(struct MarioState, bounceSquishTimer), false, LOT_NONE }, + { "bubbleObj", LVT_COBJECT_P, offsetof(struct MarioState, bubbleObj), false, LOT_OBJECT }, + { "cap", LVT_U32, offsetof(struct MarioState, cap), false, LOT_NONE }, + { "capTimer", LVT_U16, offsetof(struct MarioState, capTimer), false, LOT_NONE }, + { "ceil", LVT_COBJECT_P, offsetof(struct MarioState, ceil), false, LOT_SURFACE }, + { "ceilHeight", LVT_F32, offsetof(struct MarioState, ceilHeight), false, LOT_NONE }, + { "character", LVT_COBJECT_P, offsetof(struct MarioState, character), false, LOT_CHARACTER }, + { "collidedObjInteractTypes", LVT_U32, offsetof(struct MarioState, collidedObjInteractTypes), false, LOT_NONE }, + { "controller", LVT_COBJECT_P, offsetof(struct MarioState, controller), true, LOT_CONTROLLER }, + { "curAnimOffset", LVT_F32, offsetof(struct MarioState, curAnimOffset), false, LOT_NONE }, + { "currentRoom", LVT_S16, offsetof(struct MarioState, currentRoom), false, LOT_NONE }, + { "doubleJumpTimer", LVT_U8, offsetof(struct MarioState, doubleJumpTimer), false, LOT_NONE }, + { "faceAngle", LVT_COBJECT, offsetof(struct MarioState, faceAngle), true, LOT_VEC3S }, + { "fadeWarpOpacity", LVT_U8, offsetof(struct MarioState, fadeWarpOpacity), false, LOT_NONE }, + { "flags", LVT_U32, offsetof(struct MarioState, flags), false, LOT_NONE }, + { "floor", LVT_COBJECT_P, offsetof(struct MarioState, floor), false, LOT_SURFACE }, + { "floorAngle", LVT_S16, offsetof(struct MarioState, floorAngle), false, LOT_NONE }, + { "floorHeight", LVT_F32, offsetof(struct MarioState, floorHeight), false, LOT_NONE }, + { "forwardVel", LVT_F32, offsetof(struct MarioState, forwardVel), false, LOT_NONE }, + { "framesSinceA", LVT_U8, offsetof(struct MarioState, framesSinceA), false, LOT_NONE }, + { "framesSinceB", LVT_U8, offsetof(struct MarioState, framesSinceB), false, LOT_NONE }, + { "freeze", LVT_U8, offsetof(struct MarioState, freeze), false, LOT_NONE }, + { "healCounter", LVT_U8, offsetof(struct MarioState, healCounter), false, LOT_NONE }, + { "health", LVT_S16, offsetof(struct MarioState, health), false, LOT_NONE }, + { "heldByObj", LVT_COBJECT_P, offsetof(struct MarioState, heldByObj), false, LOT_OBJECT }, + { "heldObj", LVT_COBJECT_P, offsetof(struct MarioState, heldObj), false, LOT_OBJECT }, + { "hurtCounter", LVT_U8, offsetof(struct MarioState, hurtCounter), false, LOT_NONE }, + { "input", LVT_U16, offsetof(struct MarioState, input), false, LOT_NONE }, + { "intendedMag", LVT_F32, offsetof(struct MarioState, intendedMag), false, LOT_NONE }, + { "intendedYaw", LVT_S16, offsetof(struct MarioState, intendedYaw), false, LOT_NONE }, + { "interactObj", LVT_COBJECT_P, offsetof(struct MarioState, interactObj), false, LOT_OBJECT }, + { "invincTimer", LVT_S16, offsetof(struct MarioState, invincTimer), false, LOT_NONE }, + { "isSnoring", LVT_U8, offsetof(struct MarioState, isSnoring), false, LOT_NONE }, + { "knockbackTimer", LVT_U8, offsetof(struct MarioState, knockbackTimer), false, LOT_NONE }, + { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), true, LOT_MARIOBODYSTATE }, + { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), true, LOT_OBJECT }, + { "minimumBoneY", LVT_F32, offsetof(struct MarioState, minimumBoneY), false, LOT_NONE }, + { "nonInstantWarpPos", LVT_COBJECT, offsetof(struct MarioState, nonInstantWarpPos), true, LOT_VEC3F }, + { "numCoins", LVT_S16, offsetof(struct MarioState, numCoins), false, LOT_NONE }, + { "numKeys", LVT_S8, offsetof(struct MarioState, numKeys), false, LOT_NONE }, + { "numLives", LVT_S8, offsetof(struct MarioState, numLives), false, LOT_NONE }, + { "numStars", LVT_S16, offsetof(struct MarioState, numStars), false, LOT_NONE }, + { "particleFlags", LVT_U32, offsetof(struct MarioState, particleFlags), false, LOT_NONE }, + { "peakHeight", LVT_F32, offsetof(struct MarioState, peakHeight), false, LOT_NONE }, + { "playerIndex", LVT_U16, offsetof(struct MarioState, playerIndex), true, LOT_NONE }, + { "pos", LVT_COBJECT, offsetof(struct MarioState, pos), true, LOT_VEC3F }, + { "prevAction", LVT_U32, offsetof(struct MarioState, prevAction), false, LOT_NONE }, + { "prevNumStarsForDialog", LVT_S16, offsetof(struct MarioState, prevNumStarsForDialog), false, LOT_NONE }, + { "quicksandDepth", LVT_F32, offsetof(struct MarioState, quicksandDepth), false, LOT_NONE }, + { "riddenObj", LVT_COBJECT_P, offsetof(struct MarioState, riddenObj), false, LOT_OBJECT }, + { "skipWarpInteractionsTimer", LVT_U8, offsetof(struct MarioState, skipWarpInteractionsTimer), false, LOT_NONE }, + { "slideVelX", LVT_F32, offsetof(struct MarioState, slideVelX), false, LOT_NONE }, + { "slideVelZ", LVT_F32, offsetof(struct MarioState, slideVelZ), false, LOT_NONE }, + { "slideYaw", LVT_S16, offsetof(struct MarioState, slideYaw), false, LOT_NONE }, + { "spawnInfo", LVT_COBJECT_P, offsetof(struct MarioState, spawnInfo), false, LOT_SPAWNINFO }, + { "specialTripleJump", LVT_U8, offsetof(struct MarioState, specialTripleJump), false, LOT_NONE }, + { "splineKeyframe", LVT_COBJECT_P, offsetof(struct MarioState, splineKeyframe), false, LOT_POINTER }, + { "splineKeyframeFraction", LVT_F32, offsetof(struct MarioState, splineKeyframeFraction), false, LOT_NONE }, + { "splineState", LVT_S32, offsetof(struct MarioState, splineState), false, LOT_NONE }, + { "squishTimer", LVT_U8, offsetof(struct MarioState, squishTimer), false, LOT_NONE }, + { "statusForCamera", LVT_COBJECT_P, offsetof(struct MarioState, statusForCamera), true, LOT_PLAYERCAMERASTATE }, + { "terrainSoundAddend", LVT_U32, offsetof(struct MarioState, terrainSoundAddend), false, LOT_NONE }, + { "twirlYaw", LVT_S16, offsetof(struct MarioState, twirlYaw), false, LOT_NONE }, + { "unkB0", LVT_S16, offsetof(struct MarioState, unkB0), false, LOT_NONE }, + { "unkC4", LVT_F32, offsetof(struct MarioState, unkC4), false, LOT_NONE }, + { "usedObj", LVT_COBJECT_P, offsetof(struct MarioState, usedObj), false, LOT_OBJECT }, + { "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F }, + { "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE }, + { "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE }, + { "wallNormal", LVT_COBJECT, offsetof(struct MarioState, wallNormal), true, LOT_VEC3F }, + { "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE }, + { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, }; #define LUA_MOD_FIELD_COUNT 11 diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index ef5c0031..aa388fe3 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -300,6 +300,22 @@ int smlua_func_bhv_1up_sliding_loop(UNUSED lua_State* L) { return 1; } +int smlua_func_bhv_1up_trigger_init(UNUSED lua_State* L) { + if (!gCurrentObject) { return 0; } + 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", "bhv_1up_trigger_init", 0, top); + return 0; + } + + + bhv_1up_trigger_init(); + + return 1; +} + int smlua_func_bhv_1up_walking_loop(UNUSED lua_State* L) { if (!gCurrentObject) { return 0; } if (L == NULL) { return 0; } @@ -30618,6 +30634,7 @@ void smlua_bind_functions_autogen(void) { smlua_bind_function(L, "bhv_1up_loop", smlua_func_bhv_1up_loop); smlua_bind_function(L, "bhv_1up_running_away_loop", smlua_func_bhv_1up_running_away_loop); smlua_bind_function(L, "bhv_1up_sliding_loop", smlua_func_bhv_1up_sliding_loop); + smlua_bind_function(L, "bhv_1up_trigger_init", smlua_func_bhv_1up_trigger_init); smlua_bind_function(L, "bhv_1up_walking_loop", smlua_func_bhv_1up_walking_loop); smlua_bind_function(L, "bhv_act_selector_init", smlua_func_bhv_act_selector_init); smlua_bind_function(L, "bhv_act_selector_loop", smlua_func_bhv_act_selector_loop);