Bring back ChainSegment and PlayerPalette

This commit is contained in:
PeachyPeachSM64 2025-11-05 23:12:14 +01:00
parent c2a6110223
commit c15748d995
11 changed files with 1221 additions and 1153 deletions

View file

@ -26,7 +26,6 @@ exclude_structs = [
'CameraFOVStatus',
'CameraStoredInfo',
'CameraTrigger',
'ChainSegment',
'Cutscene',
'CutsceneSplinePoint',
'CutsceneVariable',
@ -42,7 +41,6 @@ exclude_structs = [
'PaintingMeshVertex',
'ParallelTrackingPoint',
'PlayerGeometry',
'PlayerPalette',
'SPTask',
'SoundState',
'TransitionInfo',

View file

@ -89,9 +89,10 @@ override_field_invisible = {
"Mod": [ "files", "showedScriptWarning" ],
"Camera": [ "paletteEditorCapState" ],
"MarioState": [ "visibleToEnemies" ],
"NetworkPlayer": [ "gag", "moderator", "discordId" ],
"NetworkPlayer": [ "gag", "moderator", "discordId", "rxPacketHash", "rxSeqIds" ],
"GraphNode": [ "_guard1", "_guard2", "padding" ],
"GraphNodeRoot": ["unk15", "views"],
"GraphNodeMasterList": [ "listHeads", "listTails" ],
"FnGraphNode": [ "luaTokenIndex" ],
"Object": [ "firstSurface" ],
"Animation": [ "unusedBoneCount" ],
@ -113,7 +114,7 @@ override_field_immutable = {
"Character": [ "*" ],
"NetworkPlayer": [ "*" ],
"TextureInfo": [ "*" ],
"Object": ["oSyncID", "coopFlags", "oChainChompSegments", "oWigglerSegments", "oHauntedChairUnk100", "oTTCTreadmillBigSurface", "oTTCTreadmillSmallSurface", "bhvStackIndex", "respawnInfoType", "numSurfaces" ],
"Object": ["oSyncID", "coopFlags", "oChainChompSegments", "oWigglerSegments", "oHauntedChairUnk100", "oTTCTreadmillBigSurface", "oTTCTreadmillSmallSurface", "bhvStackIndex", "respawnInfoType", "numSurfaces", "bhvStack" ],
"GlobalObjectAnimations": [ "*"],
"SpawnParticlesInfo": [ "model" ],
"WaterDropletParams": [ "model" ],
@ -506,6 +507,8 @@ def get_struct_field_info(struct, field):
size = int(array_size)
elif array_size.startswith("0x") and all(c in "0123456789abcdef" for c in array_size[2:]):
size = int(array_size, 16)
elif array_size != "":
size = array_size
else:
lvt, lot = 'LVT_???', "LOT_???" # array size not provided, so not supported
@ -698,6 +701,8 @@ def doc_struct_index(structs):
s = '# Supported Structs\n'
for struct in structs:
sid = struct['identifier']
if sid in exclude_structs:
continue
s += '- [%s](#%s)\n' % (sid, sid)
global total_structs
total_structs += 1

View file

@ -9426,6 +9426,11 @@ function cur_obj_follow_path(unusedArg)
-- ...
end
--- @param segment ChainSegment
function chain_segment_init(segment)
-- ...
end
--- @param diameter number
--- @return number
function random_f32_around_zero(diameter)

View file

@ -217,6 +217,14 @@
--- @field public areaCenY number
--- @field public mtx Mat4
--- @class ChainSegment
--- @field public posX number
--- @field public posY number
--- @field public posZ number
--- @field public pitch integer
--- @field public yaw integer
--- @field public roll integer
--- @class Character
--- @field public type CharacterType
--- @field public name string
@ -445,6 +453,7 @@
--- @field public animReturnFromStarDance integer
--- @field public animForwardSpinningFlip integer
--- @field public animTripleJumpFly integer
--- @field public anims integer[]
--- @field public soundFreqScale number
--- @field public soundYahWahHoo integer
--- @field public soundHoohoo integer
@ -490,6 +499,7 @@
--- @field public soundImaTired integer
--- @field public soundLetsAGo integer
--- @field public soundOkeyDokey integer
--- @field public sounds integer[]
--- @class Controller
--- @field public port integer
@ -1074,6 +1084,7 @@
--- @field public headPos Vec3f
--- @field public torsoPos Vec3f
--- @field public heldObjLastPosition Vec3f
--- @field public animPartsPos Vec3f[]
--- @field public currAnimPart integer
--- @field public updateTorsoTime integer
--- @field public updateHeadPosTime integer
@ -1263,6 +1274,7 @@
--- @field public onRxSeqId integer
--- @field public modelIndex integer
--- @field public ping integer
--- @field public palette PlayerPalette
--- @field public name string
--- @field public description string
--- @field public descriptionR integer
@ -1271,6 +1283,7 @@
--- @field public descriptionA integer
--- @field public overrideLocation string
--- @field public overrideModelIndex integer
--- @field public overridePalette PlayerPalette
--- @field public paletteIndex integer
--- @field public overridePaletteIndex integer
--- @field public overridePaletteIndexLp integer
@ -1285,6 +1298,7 @@
--- @field public collisionData Pointer_Collision
--- @field public behavior Pointer_BehaviorScript
--- @field public curBhvCommand Pointer_BehaviorScript
--- @field public bhvStack integer[]
--- @field public bhvStackIndex integer
--- @field public bhvDelayTimer integer
--- @field public activeFlags integer
@ -1525,6 +1539,7 @@
--- @field public oCannonPlayerIndex integer
--- @field public oCapUnkF4 integer
--- @field public oCapUnkF8 integer
--- @field public oChainChompSegments ChainSegment
--- @field public oChainChompMaxDistFromPivotPerChainPart number
--- @field public oChainChompMaxDistBetweenChainParts number
--- @field public oChainChompDistToPivot number
@ -2018,6 +2033,7 @@
--- @field public oStrongWindParticlePenguinObj Object
--- @field public oWhompShakeVal integer
--- @field public oWigglerFallThroughFloorsHeight number
--- @field public oWigglerSegments ChainSegment
--- @field public oWigglerWalkAnimSpeed number
--- @field public oWigglerSquishSpeed number
--- @field public oWigglerTimeUntilRandomTurn integer
@ -2123,6 +2139,9 @@
--- @field public cameraEvent integer
--- @field public usedObj Object
--- @class PlayerPalette
--- @field public parts Color[]
--- @class RayIntersectionInfo
--- @field public surface Surface
--- @field public hitPos Vec3f

View file

@ -3192,6 +3192,26 @@ Transforms the vector at `localTranslateIndex` into the object's local coordinat
<br />
## [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:](#)
<br />
## [random_f32_around_zero](#random_f32_around_zero)
### Lua Example

View file

@ -1674,6 +1674,7 @@
- [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)

View file

@ -3,24 +3,16 @@
# Supported Structs
- [AnimInfo](#AnimInfo)
- [Animation](#Animation)
- [AnimationTable](#AnimationTable)
- [Area](#Area)
- [BehaviorDialogs](#BehaviorDialogs)
- [BehaviorTrajectories](#BehaviorTrajectories)
- [BehaviorValues](#BehaviorValues)
- [BullyCollisionData](#BullyCollisionData)
- [Camera](#Camera)
- [CameraFOVStatus](#CameraFOVStatus)
- [CameraStoredInfo](#CameraStoredInfo)
- [CameraTrigger](#CameraTrigger)
- [ChainSegment](#ChainSegment)
- [Character](#Character)
- [Color](#Color)
- [Controller](#Controller)
- [CustomLevelInfo](#CustomLevelInfo)
- [Cutscene](#Cutscene)
- [CutsceneSplinePoint](#CutsceneSplinePoint)
- [CutsceneVariable](#CutsceneVariable)
- [DateTime](#DateTime)
- [DialogEntry](#DialogEntry)
- [DisplayListNode](#DisplayListNode)
@ -31,7 +23,6 @@
- [DjuiThreePanelTheme](#DjuiThreePanelTheme)
- [ExclamationBoxContent](#ExclamationBoxContent)
- [FirstPersonCamera](#FirstPersonCamera)
- [FloorGeometry](#FloorGeometry)
- [FnGraphNode](#FnGraphNode)
- [Gfx](#Gfx)
- [GlobalObjectAnimations](#GlobalObjectAnimations)
@ -62,44 +53,31 @@
- [GraphNodeSwitchCase](#GraphNodeSwitchCase)
- [GraphNodeTranslation](#GraphNodeTranslation)
- [GraphNodeTranslationRotation](#GraphNodeTranslationRotation)
- [GraphNode_802A45E4](#GraphNode_802A45E4)
- [HandheldShakePoint](#HandheldShakePoint)
- [HudUtilsRotation](#HudUtilsRotation)
- [InstantWarp](#InstantWarp)
- [LakituState](#LakituState)
- [LevelValues](#LevelValues)
- [LinearTransitionPoint](#LinearTransitionPoint)
- [MarioAnimDmaRelatedThing](#MarioAnimDmaRelatedThing)
- [MarioAnimation](#MarioAnimation)
- [MarioBodyState](#MarioBodyState)
- [MarioState](#MarioState)
- [Mat4](#Mat4)
- [Mod](#Mod)
- [ModAudio](#ModAudio)
- [ModAudioSampleCopies](#ModAudioSampleCopies)
- [ModFile](#ModFile)
- [ModFs](#ModFs)
- [ModFsFile](#ModFsFile)
- [ModeTransitionInfo](#ModeTransitionInfo)
- [NametagsSettings](#NametagsSettings)
- [NetworkPlayer](#NetworkPlayer)
- [Object](#Object)
- [ObjectHitbox](#ObjectHitbox)
- [ObjectNode](#ObjectNode)
- [ObjectWarpNode](#ObjectWarpNode)
- [OffsetSizePair](#OffsetSizePair)
- [Painting](#Painting)
- [PaintingMeshVertex](#PaintingMeshVertex)
- [PaintingValues](#PaintingValues)
- [ParallelTrackingPoint](#ParallelTrackingPoint)
- [PlayerCameraState](#PlayerCameraState)
- [PlayerGeometry](#PlayerGeometry)
- [PlayerPalette](#PlayerPalette)
- [RayIntersectionInfo](#RayIntersectionInfo)
- [RomhackCameraSettings](#RomhackCameraSettings)
- [SPTask](#SPTask)
- [ServerSettings](#ServerSettings)
- [SoundState](#SoundState)
- [SpawnInfo](#SpawnInfo)
- [SpawnParticlesInfo](#SpawnParticlesInfo)
- [StarPositions](#StarPositions)
@ -107,9 +85,6 @@
- [StaticObjectCollision](#StaticObjectCollision)
- [Surface](#Surface)
- [TextureInfo](#TextureInfo)
- [TransitionInfo](#TransitionInfo)
- [UnusedArea28](#UnusedArea28)
- [VblankHandler](#VblankHandler)
- [Vec2f](#Vec2f)
- [Vec2i](#Vec2i)
- [Vec2s](#Vec2s)
@ -120,11 +95,8 @@
- [Vec4i](#Vec4i)
- [Vec4s](#Vec4s)
- [Vtx](#Vtx)
- [Vtx_Interp](#Vtx_Interp)
- [WallCollisionData](#WallCollisionData)
- [WarpNode](#WarpNode)
- [WarpTransition](#WarpTransition)
- [WarpTransitionData](#WarpTransitionData)
- [WaterDropletParams](#WaterDropletParams)
- [Waypoint](#Waypoint)
- [Whirlpool](#Whirlpool)
@ -397,6 +369,21 @@
<br />
## [ChainSegment](#ChainSegment)
| Field | Type | Access |
| ----- | ---- | ------ |
| posX | `number` | |
| posY | `number` | |
| posZ | `number` | |
| pitch | `integer` | |
| yaw | `integer` | |
| roll | `integer` | |
[:arrow_up_small:](#)
<br />
## [Character](#Character)
| Field | Type | Access |
@ -628,6 +615,7 @@
| animReturnFromStarDance | `integer` | read-only |
| animForwardSpinningFlip | `integer` | read-only |
| animTripleJumpFly | `integer` | read-only |
| anims | `Array` <`integer`> | read-only |
| soundFreqScale | `number` | read-only |
| soundYahWahHoo | `integer` | read-only |
| soundHoohoo | `integer` | read-only |
@ -673,6 +661,7 @@
| soundImaTired | `integer` | read-only |
| soundLetsAGo | `integer` | read-only |
| soundOkeyDokey | `integer` | read-only |
| sounds | `Array` <`integer`> | read-only |
[:arrow_up_small:](#)
@ -1605,6 +1594,7 @@
| headPos | [Vec3f](structs.md#Vec3f) | read-only |
| torsoPos | [Vec3f](structs.md#Vec3f) | read-only |
| heldObjLastPosition | [Vec3f](structs.md#Vec3f) | read-only |
| animPartsPos | `Array` <`Vec3f`> | read-only |
| currAnimPart | `integer` | read-only |
| updateTorsoTime | `integer` | read-only |
| updateHeadPosTime | `integer` | read-only |
@ -1878,6 +1868,7 @@
| onRxSeqId | `integer` | read-only |
| modelIndex | `integer` | read-only |
| ping | `integer` | read-only |
| palette | [PlayerPalette](structs.md#PlayerPalette) | read-only |
| name | `string` | read-only |
| description | `string` | read-only |
| descriptionR | `integer` | read-only |
@ -1886,6 +1877,7 @@
| descriptionA | `integer` | read-only |
| overrideLocation | `string` | read-only |
| overrideModelIndex | `integer` | |
| overridePalette | [PlayerPalette](structs.md#PlayerPalette) | |
[:arrow_up_small:](#)
@ -1904,6 +1896,7 @@
| collisionData | `Pointer` <`Collision`> | |
| behavior | `Pointer` <`BehaviorScript`> | read-only |
| curBhvCommand | `Pointer` <`BehaviorScript`> | read-only |
| bhvStack | `Array` <`integer`> | read-only |
| bhvStackIndex | `integer` | read-only |
| bhvDelayTimer | `integer` | |
| activeFlags | `integer` | |
@ -2152,6 +2145,7 @@
| oCannonPlayerIndex | `integer` | |
| oCapUnkF4 | `integer` | |
| oCapUnkF8 | `integer` | |
| oChainChompSegments | [ChainSegment](structs.md#ChainSegment) | read-only |
| oChainChompMaxDistFromPivotPerChainPart | `number` | |
| oChainChompMaxDistBetweenChainParts | `number` | |
| oChainChompDistToPivot | `number` | |
@ -2645,6 +2639,7 @@
| oStrongWindParticlePenguinObj | [Object](structs.md#Object) | |
| oWhompShakeVal | `integer` | |
| oWigglerFallThroughFloorsHeight | `number` | |
| oWigglerSegments | [ChainSegment](structs.md#ChainSegment) | read-only |
| oWigglerWalkAnimSpeed | `number` | |
| oWigglerSquishSpeed | `number` | |
| oWigglerTimeUntilRandomTurn | `integer` | |
@ -2796,6 +2791,16 @@
<br />
## [PlayerPalette](#PlayerPalette)
| Field | Type | Access |
| ----- | ---- | ------ |
| parts | `Array` <`Color`> | read-only |
[:arrow_up_small:](#)
<br />
## [RayIntersectionInfo](#RayIntersectionInfo)
| Field | Type | Access |

View file

@ -13,7 +13,7 @@ enum PlayerPart {
#pragma pack(1)
struct PlayerPalette {
//rgb
u8 parts[PLAYER_PART_MAX][3];
Color parts[PLAYER_PART_MAX];
};
#pragma pack()

View file

@ -395,7 +395,17 @@ static struct LuaObjectField sCameraFields[LUA_CAMERA_FIELD_COUNT] = {
{ "yaw", LVT_S16, offsetof(struct Camera, yaw), false, LOT_NONE, 1, sizeof(s16) },
};
#define LUA_CHARACTER_FIELD_COUNT 272
#define LUA_CHAIN_SEGMENT_FIELD_COUNT 6
static struct LuaObjectField sChainSegmentFields[LUA_CHAIN_SEGMENT_FIELD_COUNT] = {
{ "pitch", LVT_S16, offsetof(struct ChainSegment, pitch), false, LOT_NONE, 1, sizeof(s16) },
{ "posX", LVT_F32, offsetof(struct ChainSegment, posX), false, LOT_NONE, 1, sizeof(f32) },
{ "posY", LVT_F32, offsetof(struct ChainSegment, posY), false, LOT_NONE, 1, sizeof(f32) },
{ "posZ", LVT_F32, offsetof(struct ChainSegment, posZ), false, LOT_NONE, 1, sizeof(f32) },
{ "roll", LVT_S16, offsetof(struct ChainSegment, roll), false, LOT_NONE, 1, sizeof(s16) },
{ "yaw", LVT_S16, offsetof(struct ChainSegment, yaw), false, LOT_NONE, 1, sizeof(s16) },
};
#define LUA_CHARACTER_FIELD_COUNT 274
static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = {
{ "animAPose", LVT_S32, offsetof(struct Character, animAPose), true, LOT_NONE, 1, sizeof(s32) },
{ "animAirForwardKb", LVT_S32, offsetof(struct Character, animAirForwardKb), true, LOT_NONE, 1, sizeof(s32) },
@ -610,7 +620,7 @@ static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = {
{ "animWaterStarDance", LVT_S32, offsetof(struct Character, animWaterStarDance), true, LOT_NONE, 1, sizeof(s32) },
{ "animWaterThrowObj", LVT_S32, offsetof(struct Character, animWaterThrowObj), true, LOT_NONE, 1, sizeof(s32) },
{ "animWingCapFly", LVT_S32, offsetof(struct Character, animWingCapFly), true, LOT_NONE, 1, sizeof(s32) },
// { "anims", LVT_???, offsetof(struct Character, anims), true, LOT_???, 1, sizeof(s32) }, <--- UNIMPLEMENTED
{ "anims", LVT_S32, offsetof(struct Character, anims), true, LOT_NONE, CHAR_ANIM_MAX, sizeof(s32) },
{ "cameraHudHead", LVT_U32, offsetof(struct Character, cameraHudHead), true, LOT_NONE, 1, sizeof(u32) },
{ "capEnemyDecalGfx", LVT_COBJECT_P, offsetof(struct Character, capEnemyDecalGfx), true, LOT_GFX, 1, sizeof(Gfx*) },
{ "capEnemyGfx", LVT_COBJECT_P, offsetof(struct Character, capEnemyGfx), true, LOT_GFX, 1, sizeof(Gfx*) },
@ -668,7 +678,7 @@ static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = {
{ "soundYahoo", LVT_S32, offsetof(struct Character, soundYahoo), true, LOT_NONE, 1, sizeof(s32) },
{ "soundYahooWahaYippee", LVT_S32, offsetof(struct Character, soundYahooWahaYippee), true, LOT_NONE, 1, sizeof(s32) },
{ "soundYawning", LVT_S32, offsetof(struct Character, soundYawning), true, LOT_NONE, 1, sizeof(s32) },
// { "sounds", LVT_???, offsetof(struct Character, sounds), true, LOT_???, 1, sizeof(s32) }, <--- UNIMPLEMENTED
{ "sounds", LVT_S32, offsetof(struct Character, sounds), true, LOT_NONE, CHAR_SOUND_MAX, sizeof(s32) },
{ "torsoRotMult", LVT_F32, offsetof(struct Character, torsoRotMult), true, LOT_NONE, 1, sizeof(f32) },
{ "type", LVT_S32, offsetof(struct Character, type), true, LOT_NONE, 1, sizeof(enum CharacterType) },
};
@ -1091,8 +1101,6 @@ static struct LuaObjectField sGraphNodeLevelOfDetailFields[LUA_GRAPH_NODE_LEVEL_
#define LUA_GRAPH_NODE_MASTER_LIST_FIELD_COUNT 1
static struct LuaObjectField sGraphNodeMasterListFields[LUA_GRAPH_NODE_MASTER_LIST_FIELD_COUNT] = {
// { "listHeads", LVT_???, offsetof(struct GraphNodeMasterList, listHeads), false, LOT_???, 1, sizeof(struct DisplayListNode*) }, <--- UNIMPLEMENTED
// { "listTails", LVT_???, offsetof(struct GraphNodeMasterList, listTails), false, LOT_???, 1, sizeof(struct DisplayListNode*) }, <--- UNIMPLEMENTED
{ "node", LVT_COBJECT, offsetof(struct GraphNodeMasterList, node), true, LOT_GRAPHNODE, 1, sizeof(struct GraphNode) },
};
@ -1345,11 +1353,11 @@ static struct LuaObjectField sMarioAnimationFields[LUA_MARIO_ANIMATION_FIELD_COU
{ "targetAnim", LVT_COBJECT_P, offsetof(struct MarioAnimation, targetAnim), false, LOT_ANIMATION, 1, sizeof(struct Animation*) },
};
#define LUA_MARIO_BODY_STATE_FIELD_COUNT 27
#define LUA_MARIO_BODY_STATE_FIELD_COUNT 28
static struct LuaObjectField sMarioBodyStateFields[LUA_MARIO_BODY_STATE_FIELD_COUNT] = {
{ "action", LVT_U32, offsetof(struct MarioBodyState, action), false, LOT_NONE, 1, sizeof(u32) },
{ "allowPartRotation", LVT_U8, offsetof(struct MarioBodyState, allowPartRotation), false, LOT_NONE, 1, sizeof(u8) },
// { "animPartsPos", LVT_???, offsetof(struct MarioBodyState, animPartsPos), true, LOT_???, 1, sizeof(Vec3f) }, <--- UNIMPLEMENTED
{ "animPartsPos", LVT_COBJECT, offsetof(struct MarioBodyState, animPartsPos), true, LOT_VEC3F, MARIO_ANIM_PART_MAX, sizeof(Vec3f) },
{ "capState", LVT_S8, offsetof(struct MarioBodyState, capState), false, LOT_NONE, 1, sizeof(s8) },
{ "currAnimPart", LVT_U32, offsetof(struct MarioBodyState, currAnimPart), true, LOT_NONE, 1, sizeof(u32) },
{ "eyeState", LVT_S8, offsetof(struct MarioBodyState, eyeState), false, LOT_NONE, 1, sizeof(s8) },
@ -1575,7 +1583,7 @@ static struct LuaObjectField sNametagsSettingsFields[LUA_NAMETAGS_SETTINGS_FIELD
{ "showSelfTag", LVT_BOOL, offsetof(struct NametagsSettings, showSelfTag), false, LOT_NONE, 1, sizeof(bool) },
};
#define LUA_NETWORK_PLAYER_FIELD_COUNT 30
#define LUA_NETWORK_PLAYER_FIELD_COUNT 32
static struct LuaObjectField sNetworkPlayerFields[LUA_NETWORK_PLAYER_FIELD_COUNT] = {
{ "connected", LVT_BOOL, offsetof(struct NetworkPlayer, connected), true, LOT_NONE, 1, sizeof(bool) },
{ "currActNum", LVT_S16, offsetof(struct NetworkPlayer, currActNum), true, LOT_NONE, 1, sizeof(s16) },
@ -1602,18 +1610,16 @@ static struct LuaObjectField sNetworkPlayerFields[LUA_NETWORK_PLAYER_FIELD_COUNT
{ "onRxSeqId", LVT_U8, offsetof(struct NetworkPlayer, onRxSeqId), true, LOT_NONE, 1, sizeof(u8) },
{ "overrideLocation", LVT_STRING, offsetof(struct NetworkPlayer, overrideLocation), true, LOT_NONE, 1, sizeof(char) },
{ "overrideModelIndex", LVT_U8, offsetof(struct NetworkPlayer, overrideModelIndex), false, LOT_NONE, 1, sizeof(u8) },
// { "overridePalette", LVT_COBJECT, offsetof(struct NetworkPlayer, overridePalette), false, LOT_???, 1, sizeof(struct PlayerPalette) }, <--- UNIMPLEMENTED
{ "overridePalette", LVT_COBJECT, offsetof(struct NetworkPlayer, overridePalette), false, LOT_PLAYERPALETTE, 1, sizeof(struct PlayerPalette) },
{ "overridePaletteIndex", LVT_U8, offsetof(struct NetworkPlayer, overridePaletteIndex), false, LOT_NONE, 1, sizeof(u8) },
{ "overridePaletteIndexLp", LVT_U8, offsetof(struct NetworkPlayer, overridePaletteIndexLp), true, LOT_NONE, 1, sizeof(u8) },
// { "palette", LVT_COBJECT, offsetof(struct NetworkPlayer, palette), true, LOT_???, 1, sizeof(struct PlayerPalette) }, <--- UNIMPLEMENTED
{ "palette", LVT_COBJECT, offsetof(struct NetworkPlayer, palette), true, LOT_PLAYERPALETTE, 1, sizeof(struct PlayerPalette) },
{ "paletteIndex", LVT_U8, offsetof(struct NetworkPlayer, paletteIndex), true, LOT_NONE, 1, sizeof(u8) },
{ "ping", LVT_U32, offsetof(struct NetworkPlayer, ping), true, LOT_NONE, 1, sizeof(u32) },
// { "rxPacketHash", LVT_???, offsetof(struct NetworkPlayer, rxPacketHash), true, LOT_???, 1, sizeof(u32) }, <--- UNIMPLEMENTED
// { "rxSeqIds", LVT_???, offsetof(struct NetworkPlayer, rxSeqIds), true, LOT_???, 1, sizeof(u16) }, <--- UNIMPLEMENTED
{ "type", LVT_U8, offsetof(struct NetworkPlayer, type), true, LOT_NONE, 1, sizeof(u8) },
};
#define LUA_OBJECT_FIELD_COUNT 760
#define LUA_OBJECT_FIELD_COUNT 763
static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "activeFlags", LVT_S16, offsetof(struct Object, activeFlags), false, LOT_NONE, 1, sizeof(s16) },
{ "allowRemoteInteractions", LVT_U8, offsetof(struct Object, allowRemoteInteractions), false, LOT_NONE, 1, sizeof(u8) },
@ -1623,7 +1629,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "areaTimerType", LVT_S32, offsetof(struct Object, areaTimerType), false, LOT_NONE, 1, sizeof(enum AreaTimerType) },
{ "behavior", LVT_BEHAVIORSCRIPT_P, offsetof(struct Object, behavior), true, LOT_POINTER, 1, sizeof(const BehaviorScript*) },
{ "bhvDelayTimer", LVT_S16, offsetof(struct Object, bhvDelayTimer), false, LOT_NONE, 1, sizeof(s16) },
// { "bhvStack", LVT_???, offsetof(struct Object, bhvStack), false, LOT_???, 1, sizeof(uintptr_t) }, <--- UNIMPLEMENTED
{ "bhvStack", LVT_U64, offsetof(struct Object, bhvStack), true, LOT_NONE, OBJECT_MAX_BHV_STACK, sizeof(uintptr_t) },
{ "bhvStackIndex", LVT_U32, offsetof(struct Object, bhvStackIndex), true, LOT_NONE, 1, sizeof(u32) },
{ "collidedObjInteractTypes", LVT_U32, offsetof(struct Object, collidedObjInteractTypes), false, LOT_NONE, 1, sizeof(u32) },
{ "collidedObjs", LVT_COBJECT_P, offsetof(struct Object, collidedObjs), false, LOT_OBJECT, 4, sizeof(struct Object*) },
@ -1789,7 +1795,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oChainChompNumLunges", LVT_S32, offsetof(struct Object, oChainChompNumLunges), false, LOT_NONE, 1, sizeof(s32) },
{ "oChainChompReleaseStatus", LVT_S32, offsetof(struct Object, oChainChompReleaseStatus), false, LOT_NONE, 1, sizeof(s32) },
{ "oChainChompRestrictedByChain", LVT_S32, offsetof(struct Object, oChainChompRestrictedByChain), false, LOT_NONE, 1, sizeof(s32) },
// { "oChainChompSegments", LVT_COBJECT_P, offsetof(struct Object, oChainChompSegments), true, LOT_???, 1, sizeof(struct ChainSegment*) }, <--- UNIMPLEMENTED
{ "oChainChompSegments", LVT_COBJECT_P, offsetof(struct Object, oChainChompSegments), true, LOT_CHAINSEGMENT, 1, sizeof(struct ChainSegment*) },
{ "oChainChompTargetPitch", LVT_S32, offsetof(struct Object, oChainChompTargetPitch), false, LOT_NONE, 1, sizeof(s32) },
{ "oChainChompUnk104", LVT_F32, offsetof(struct Object, oChainChompUnk104), false, LOT_NONE, 1, sizeof(f32) },
{ "oCheckerBoardPlatformUnk1AC", LVT_F32, offsetof(struct Object, oCheckerBoardPlatformUnk1AC), false, LOT_NONE, 1, sizeof(f32) },
@ -2365,7 +2371,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oWhitePuffUnkFC", LVT_S32, offsetof(struct Object, oWhitePuffUnkFC), false, LOT_NONE, 1, sizeof(s32) },
{ "oWhompShakeVal", LVT_S32, offsetof(struct Object, oWhompShakeVal), false, LOT_NONE, 1, sizeof(s32) },
{ "oWigglerFallThroughFloorsHeight", LVT_F32, offsetof(struct Object, oWigglerFallThroughFloorsHeight), false, LOT_NONE, 1, sizeof(f32) },
// { "oWigglerSegments", LVT_COBJECT_P, offsetof(struct Object, oWigglerSegments), true, LOT_???, 1, sizeof(struct ChainSegment*) }, <--- UNIMPLEMENTED
{ "oWigglerSegments", LVT_COBJECT_P, offsetof(struct Object, oWigglerSegments), true, LOT_CHAINSEGMENT, 1, sizeof(struct ChainSegment*) },
{ "oWigglerSquishSpeed", LVT_F32, offsetof(struct Object, oWigglerSquishSpeed), false, LOT_NONE, 1, sizeof(f32) },
{ "oWigglerTargetYaw", LVT_S32, offsetof(struct Object, oWigglerTargetYaw), false, LOT_NONE, 1, sizeof(s32) },
{ "oWigglerTextStatus", LVT_S16, offsetof(struct Object, oWigglerTextStatus), false, LOT_NONE, 1, sizeof(s16) },
@ -2492,6 +2498,11 @@ static struct LuaObjectField sPlayerCameraStateFields[LUA_PLAYER_CAMERA_STATE_FI
{ "usedObj", LVT_COBJECT_P, offsetof(struct PlayerCameraState, usedObj), false, LOT_OBJECT, 1, sizeof(struct Object*) },
};
#define LUA_PLAYER_PALETTE_FIELD_COUNT 1
static struct LuaObjectField sPlayerPaletteFields[LUA_PLAYER_PALETTE_FIELD_COUNT] = {
{ "parts", LVT_COBJECT, offsetof(struct PlayerPalette, parts), true, LOT_COLOR, PLAYER_PART_MAX, sizeof(Color) },
};
#define LUA_RAY_INTERSECTION_INFO_FIELD_COUNT 2
static struct LuaObjectField sRayIntersectionInfoFields[LUA_RAY_INTERSECTION_INFO_FIELD_COUNT] = {
{ "hitPos", LVT_COBJECT, offsetof(struct RayIntersectionInfo, hitPos), true, LOT_VEC3F, 1, sizeof(Vec3f) },
@ -2707,6 +2718,7 @@ struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN]
{ LOT_BEHAVIORTRAJECTORIES, sBehaviorTrajectoriesFields, LUA_BEHAVIOR_TRAJECTORIES_FIELD_COUNT },
{ LOT_BEHAVIORVALUES, sBehaviorValuesFields, LUA_BEHAVIOR_VALUES_FIELD_COUNT },
{ LOT_CAMERA, sCameraFields, LUA_CAMERA_FIELD_COUNT },
{ LOT_CHAINSEGMENT, sChainSegmentFields, LUA_CHAIN_SEGMENT_FIELD_COUNT },
{ LOT_CHARACTER, sCharacterFields, LUA_CHARACTER_FIELD_COUNT },
{ LOT_CONTROLLER, sControllerFields, LUA_CONTROLLER_FIELD_COUNT },
{ LOT_CUSTOMLEVELINFO, sCustomLevelInfoFields, LUA_CUSTOM_LEVEL_INFO_FIELD_COUNT },
@ -2770,6 +2782,7 @@ struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN]
{ LOT_PAINTING, sPaintingFields, LUA_PAINTING_FIELD_COUNT },
{ LOT_PAINTINGVALUES, sPaintingValuesFields, LUA_PAINTING_VALUES_FIELD_COUNT },
{ LOT_PLAYERCAMERASTATE, sPlayerCameraStateFields, LUA_PLAYER_CAMERA_STATE_FIELD_COUNT },
{ LOT_PLAYERPALETTE, sPlayerPaletteFields, LUA_PLAYER_PALETTE_FIELD_COUNT },
{ LOT_RAYINTERSECTIONINFO, sRayIntersectionInfoFields, LUA_RAY_INTERSECTION_INFO_FIELD_COUNT },
{ LOT_ROMHACKCAMERASETTINGS, sRomhackCameraSettingsFields, LUA_ROMHACK_CAMERA_SETTINGS_FIELD_COUNT },
{ LOT_SERVERSETTINGS, sServerSettingsFields, LUA_SERVER_SETTINGS_FIELD_COUNT },
@ -2811,6 +2824,7 @@ const char *sLuaLotNames[] = {
[LOT_BEHAVIORTRAJECTORIES] = "BehaviorTrajectories",
[LOT_BEHAVIORVALUES] = "BehaviorValues",
[LOT_CAMERA] = "Camera",
[LOT_CHAINSEGMENT] = "ChainSegment",
[LOT_CHARACTER] = "Character",
[LOT_CONTROLLER] = "Controller",
[LOT_CUSTOMLEVELINFO] = "CustomLevelInfo",
@ -2874,6 +2888,7 @@ const char *sLuaLotNames[] = {
[LOT_PAINTING] = "Painting",
[LOT_PAINTINGVALUES] = "PaintingValues",
[LOT_PLAYERCAMERASTATE] = "PlayerCameraState",
[LOT_PLAYERPALETTE] = "PlayerPalette",
[LOT_RAYINTERSECTIONINFO] = "RayIntersectionInfo",
[LOT_ROMHACKCAMERASETTINGS] = "RomhackCameraSettings",
[LOT_SERVERSETTINGS] = "ServerSettings",

View file

@ -30,6 +30,7 @@ enum LuaObjectAutogenType {
LOT_BEHAVIORTRAJECTORIES,
LOT_BEHAVIORVALUES,
LOT_CAMERA,
LOT_CHAINSEGMENT,
LOT_CHARACTER,
LOT_CONTROLLER,
LOT_CUSTOMLEVELINFO,
@ -93,6 +94,7 @@ enum LuaObjectAutogenType {
LOT_PAINTING,
LOT_PAINTINGVALUES,
LOT_PLAYERCAMERASTATE,
LOT_PLAYERPALETTE,
LOT_RAYINTERSECTIONINFO,
LOT_ROMHACKCAMERASETTINGS,
LOT_SERVERSETTINGS,

View file

@ -28500,7 +28500,6 @@ int smlua_func_cur_obj_follow_path(lua_State* L) {
return 1;
}
/*
int smlua_func_chain_segment_init(lua_State* L) {
if (L == NULL) { return 0; }
@ -28510,7 +28509,7 @@ int smlua_func_chain_segment_init(lua_State* L) {
return 0;
}
// struct ChainSegment* segment = (struct ChainSegment*)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED
struct ChainSegment* segment = (struct ChainSegment*)smlua_to_cobject(L, 1, LOT_CHAINSEGMENT);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "chain_segment_init"); return 0; }
extern void chain_segment_init(struct ChainSegment *segment);
@ -28518,7 +28517,6 @@ int smlua_func_chain_segment_init(lua_State* L) {
return 1;
}
*/
int smlua_func_random_f32_around_zero(lua_State* L) {
if (L == NULL) { return 0; }
@ -38322,7 +38320,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "cur_obj_rotate_face_angle_using_vel", smlua_func_cur_obj_rotate_face_angle_using_vel);
smlua_bind_function(L, "cur_obj_set_face_angle_to_move_angle", smlua_func_cur_obj_set_face_angle_to_move_angle);
smlua_bind_function(L, "cur_obj_follow_path", smlua_func_cur_obj_follow_path);
//smlua_bind_function(L, "chain_segment_init", smlua_func_chain_segment_init); <--- UNIMPLEMENTED
smlua_bind_function(L, "chain_segment_init", smlua_func_chain_segment_init);
smlua_bind_function(L, "random_f32_around_zero", smlua_func_random_f32_around_zero);
smlua_bind_function(L, "obj_scale_random", smlua_func_obj_scale_random);
smlua_bind_function(L, "obj_translate_xyz_random", smlua_func_obj_translate_xyz_random);