diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py
index aecb692b0..f8ab87000 100644
--- a/autogen/convert_constants.py
+++ b/autogen/convert_constants.py
@@ -1,4 +1,5 @@
import os
+from xml.etree.ElementInclude import include
from common import *
from extract_constants import *
@@ -21,16 +22,16 @@ in_files = [
"src/pc/djui/djui_hud_utils.h",
"include/behavior_table.h",
"src/pc/lua/smlua_model_utils.h",
+ "include/object_constants.h",
]
-exclude_constants = [
- '^MAXCONTROLLERS$',
- '^LEVEL_.*',
- '^AREA_.*',
- '^CONT_ERR.*',
- '^READ_MASK$',
- '^SIGN_RANGE$',
-]
+exclude_constants = {
+ '*': [ '^MAXCONTROLLERS$', '^LEVEL_.*', '^AREA_.*', '^CONT_ERR.*', '^READ_MASK$', '^SIGN_RANGE$', ]
+}
+
+include_constants = {
+ "include/object_constants.h" : [ "^ACTIVE_FLAG_", "^ACTIVE_PARTICLE_", "^HELD_", "^OBJ_FLAG_", "^RESPAWN_INFO_", ],
+}
pretend_find = [
'SOUND_ARG_LOAD'
@@ -64,7 +65,25 @@ def saw_constant(identifier):
seen_constants.append(identifier)
return False
-def process_enum(line):
+def allowed_identifier(filename, ident):
+ exclude_list = exclude_constants['*']
+
+ if filename in exclude_constants:
+ exclude_list.extend(exclude_constants[filename])
+
+ for exclude in exclude_list:
+ if re.search(exclude, ident) != None:
+ return False
+
+ if filename in include_constants:
+ for include in include_constants[filename]:
+ if re.search(include, ident) != None:
+ return True
+ return False
+
+ return True
+
+def process_enum(filename, line):
_, ident, val = line.split(' ', 2)
if '{' not in val or '}' not in val:
@@ -98,12 +117,7 @@ def process_enum(line):
index += 1
continue
- excluded = False
- for exclude in exclude_constants:
- if re.search(exclude, field) != None:
- excluded = True
-
- if not excluded:
+ if allowed_identifier(filename, field):
constants.append([field, str(index)])
if saw_constant(field):
@@ -115,7 +129,7 @@ def process_enum(line):
return ret
-def process_define(line):
+def process_define(filename, line):
_, ident, val = line.split(' ', 2)
val = val.replace('(u8)', '')
@@ -129,9 +143,8 @@ def process_define(line):
print('UNRECOGNIZED DEFINE: ' + line)
return None
- for exclude in exclude_constants:
- if re.search(exclude, ident) != None:
- return None
+ if not allowed_identifier(filename, ident):
+ return None
if saw_constant(ident):
print('>>> ' + line)
@@ -139,11 +152,11 @@ def process_define(line):
return [ident, val]
-def process_line(line):
+def process_line(filename, line):
if line.startswith('enum '):
- return process_enum(line)
+ return process_enum(filename, line)
elif line.startswith('#define '):
- return process_define(line)
+ return process_define(filename, line)
else:
print("UNRECOGNIZED LINE: " + line)
return None
@@ -155,7 +168,7 @@ def process_file(filename):
constants = []
lines = extract_constants(get_path(filename)).splitlines()
for line in lines:
- c = process_line(line)
+ c = process_line(filename, line)
if c != None:
constants.append(c)
diff --git a/autogen/convert_structs.py b/autogen/convert_structs.py
index 15f4647a8..f8014615e 100644
--- a/autogen/convert_structs.py
+++ b/autogen/convert_structs.py
@@ -61,7 +61,7 @@ override_field_immutable = {
"Character": [ "*" ],
"NetworkPlayer": [ "*" ],
"TextureInfo": [ "*" ],
- "Object": ["oSyncID"],
+ "Object": ["oSyncID", "createdThroughNetwork"],
}
sLuaManuallyDefinedStructs = [
@@ -196,7 +196,9 @@ def get_struct_field_info(struct, field):
lvt = translate_type_to_lvt(ftype)
lot = translate_type_to_lot(ftype)
- fimmutable = str(lvt == 'LVT_COBJECT' or lvt.endswith('_P') or 'const ' in ftype).lower()
+ fimmutable = str(lvt == 'LVT_COBJECT' or 'const ' in ftype).lower()
+ if lvt.startswith('LVT_') and lvt.endswith('_P') and 'OBJECT' not in lvt:
+ fimmutable = 'true'
if sid in override_field_immutable:
if fid in override_field_immutable[sid] or '*' in override_field_immutable[sid]:
diff --git a/docs/lua/constants.md b/docs/lua/constants.md
index 7b5608c1c..f9b15126b 100644
--- a/docs/lua/constants.md
+++ b/docs/lua/constants.md
@@ -19,6 +19,7 @@
- [MarioAnimID](#MarioAnimID)
- [network_player.h](#network_player.h)
- [NetworkPlayerType](#NetworkPlayerType)
+- [object_constants.h](#object_constants.h)
- [os_cont.h](#os_cont.h)
- [sm64.h](#sm64.h)
- [smlua_hooks.h](#smlua_hooks.h)
@@ -1625,6 +1626,67 @@
+## [object_constants.h](#object_constants.h)
+- ACTIVE_FLAG_ACTIVE
+- ACTIVE_FLAG_DEACTIVATED
+- ACTIVE_FLAG_DITHERED_ALPHA
+- ACTIVE_FLAG_FAR_AWAY
+- ACTIVE_FLAG_INITIATED_TIME_STOP
+- ACTIVE_FLAG_IN_DIFFERENT_ROOM
+- ACTIVE_FLAG_MOVE_THROUGH_GRATE
+- ACTIVE_FLAG_UNIMPORTANT
+- ACTIVE_FLAG_UNK10
+- ACTIVE_FLAG_UNK2
+- ACTIVE_FLAG_UNK8
+- ACTIVE_FLAG_UNK9
+- ACTIVE_PARTICLE_BREATH
+- ACTIVE_PARTICLE_BUBBLE
+- ACTIVE_PARTICLE_DIRT
+- ACTIVE_PARTICLE_DUST
+- ACTIVE_PARTICLE_FIRE
+- ACTIVE_PARTICLE_H_STAR
+- ACTIVE_PARTICLE_IDLE_WATER_WAVE
+- ACTIVE_PARTICLE_LEAF
+- ACTIVE_PARTICLE_MIST_CIRCLE
+- ACTIVE_PARTICLE_PLUNGE_BUBBLE
+- ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH
+- ACTIVE_PARTICLE_SHALLOW_WATER_WAVE
+- ACTIVE_PARTICLE_SNOW
+- ACTIVE_PARTICLE_SPARKLES
+- ACTIVE_PARTICLE_TRIANGLE
+- ACTIVE_PARTICLE_UNUSED_1
+- ACTIVE_PARTICLE_UNUSED_2
+- ACTIVE_PARTICLE_V_STAR
+- ACTIVE_PARTICLE_WATER_SPLASH
+- ACTIVE_PARTICLE_WAVE_TRAIL
+- HELD_DROPPED
+- HELD_FREE
+- HELD_HELD
+- HELD_THROWN
+- OBJ_FLAG_0020
+- OBJ_FLAG_0100
+- OBJ_FLAG_1000
+- OBJ_FLAG_30
+- OBJ_FLAG_8000
+- OBJ_FLAG_ACTIVE_FROM_AFAR
+- OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO
+- OBJ_FLAG_COMPUTE_DIST_TO_MARIO
+- OBJ_FLAG_HOLDABLE
+- OBJ_FLAG_MOVE_XZ_USING_FVEL
+- OBJ_FLAG_MOVE_Y_WITH_TERMINAL_VEL
+- OBJ_FLAG_PERSISTENT_RESPAWN
+- OBJ_FLAG_SET_FACE_ANGLE_TO_MOVE_ANGLE
+- OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW
+- OBJ_FLAG_SET_THROW_MATRIX_FROM_TRANSFORM
+- OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT
+- OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE
+- RESPAWN_INFO_DONT_RESPAWN
+- RESPAWN_INFO_TYPE_16
+- RESPAWN_INFO_TYPE_32
+- RESPAWN_INFO_TYPE_NULL
+
+
+
## [os_cont.h](#os_cont.h)
- A_BUTTON
- B_BUTTON
diff --git a/docs/lua/structs.md b/docs/lua/structs.md
index 3453c9c31..5e320c102 100644
--- a/docs/lua/structs.md
+++ b/docs/lua/structs.md
@@ -69,11 +69,11 @@
| animID | integer | |
| animTimer | integer | |
| animYTrans | integer | |
-| curAnim | [Animation](#Animation) | read-only |
+| curAnim | [Animation](#Animation) | |
| prevAnimFrame | integer | |
| prevAnimFrameTimestamp | integer | |
| prevAnimID | integer | |
-| prevAnimPtr | [Animation](#Animation) | read-only |
+| prevAnimPtr | [Animation](#Animation) | |
[:arrow_up_small:](#)
@@ -101,19 +101,19 @@
| Field | Type | Access |
| ----- | ---- | ------ |
-| camera | [Camera](#Camera) | read-only |
+| camera | [Camera](#Camera) | |
| flags | integer | |
| index | integer | |
-| instantWarps | [InstantWarp](#InstantWarp) | read-only |
+| instantWarps | [InstantWarp](#InstantWarp) | |
| macroObjects | Pointer | read-only |
| musicParam | integer | |
| musicParam2 | integer | |
-| objectSpawnInfos | [SpawnInfo](#SpawnInfo) | read-only |
-| paintingWarpNodes | [WarpNode](#WarpNode) | read-only |
+| objectSpawnInfos | [SpawnInfo](#SpawnInfo) | |
+| paintingWarpNodes | [WarpNode](#WarpNode) | |
| surfaceRooms | Pointer | read-only |
| terrainData | Pointer | read-only |
| terrainType | integer | |
-| warpNodes | [ObjectWarpNode](#ObjectWarpNode) | read-only |
+| warpNodes | [ObjectWarpNode](#ObjectWarpNode) | |
[:arrow_up_small:](#)
@@ -358,11 +358,11 @@
| Field | Type | Access |
| ----- | ---- | ------ |
-| children | [GraphNode](#GraphNode) | read-only |
+| children | [GraphNode](#GraphNode) | |
| flags | integer | |
-| next | [GraphNode](#GraphNode) | read-only |
-| parent | [GraphNode](#GraphNode) | read-only |
-| prev | [GraphNode](#GraphNode) | read-only |
+| next | [GraphNode](#GraphNode) | |
+| parent | [GraphNode](#GraphNode) | |
+| prev | [GraphNode](#GraphNode) | |
| type | integer | |
[:arrow_up_small:](#)
@@ -389,9 +389,9 @@
| prevThrowMatrixTimestamp | integer | |
| prevTimestamp | integer | |
| scale | [Vec3f](#Vec3f) | read-only |
-| sharedChild | [GraphNode](#GraphNode) | read-only |
+| sharedChild | [GraphNode](#GraphNode) | |
| skipInterpolationTimestamp | integer | |
-| unk4C | [SpawnInfo](#SpawnInfo) | read-only |
+| unk4C | [SpawnInfo](#SpawnInfo) | |
[:arrow_up_small:](#)
@@ -499,7 +499,7 @@
| Field | Type | Access |
| ----- | ---- | ------ |
| currentAnimAddr | Pointer | read-only |
-| targetAnim | [Animation](#Animation) | read-only |
+| targetAnim | [Animation](#Animation) | |
[:arrow_up_small:](#)
@@ -535,22 +535,22 @@
| actionState | integer | |
| actionTimer | integer | |
| angleVel | [Vec3s](#Vec3s) | read-only |
-| animation | [MarioAnimation](#MarioAnimation) | read-only |
-| area | [Area](#Area) | read-only |
-| bubbleObj | [Object](#Object) | read-only |
+| animation | [MarioAnimation](#MarioAnimation) | |
+| area | [Area](#Area) | |
+| bubbleObj | [Object](#Object) | |
| capTimer | integer | |
-| ceil | [Surface](#Surface) | read-only |
+| ceil | [Surface](#Surface) | |
| ceilHeight | number | |
-| character | [Character](#Character) | read-only |
+| character | [Character](#Character) | |
| collidedObjInteractTypes | integer | |
-| controller | [Controller](#Controller) | read-only |
+| controller | [Controller](#Controller) | |
| curAnimOffset | number | |
| currentRoom | integer | |
| doubleJumpTimer | integer | |
| faceAngle | [Vec3s](#Vec3s) | read-only |
| fadeWarpOpacity | integer | |
| flags | integer | |
-| floor | [Surface](#Surface) | read-only |
+| floor | [Surface](#Surface) | |
| floorAngle | integer | |
| floorHeight | number | |
| forwardVel | number | |
@@ -559,17 +559,17 @@
| freeze | integer | |
| healCounter | integer | |
| health | integer | |
-| heldByObj | [Object](#Object) | read-only |
-| heldObj | [Object](#Object) | read-only |
+| heldByObj | [Object](#Object) | |
+| heldObj | [Object](#Object) | |
| hurtCounter | integer | |
| input | integer | |
| intendedMag | number | |
| intendedYaw | integer | |
-| interactObj | [Object](#Object) | read-only |
+| interactObj | [Object](#Object) | |
| invincTimer | integer | |
| isSnoring | integer | |
-| marioBodyState | [MarioBodyState](#MarioBodyState) | read-only |
-| marioObj | [Object](#Object) | read-only |
+| marioBodyState | [MarioBodyState](#MarioBodyState) | |
+| marioObj | [Object](#Object) | |
| minimumBoneY | number | |
| nonInstantWarpPos | [Vec3f](#Vec3f) | read-only |
| numCoins | integer | |
@@ -583,22 +583,22 @@
| prevAction | integer | |
| prevNumStarsForDialog | integer | |
| quicksandDepth | number | |
-| riddenObj | [Object](#Object) | read-only |
+| riddenObj | [Object](#Object) | |
| slideVelX | number | |
| slideVelZ | number | |
| slideYaw | integer | |
-| spawnInfo | [SpawnInfo](#SpawnInfo) | read-only |
+| spawnInfo | [SpawnInfo](#SpawnInfo) | |
| splineKeyframeFraction | number | |
| splineState | integer | |
| squishTimer | integer | |
-| statusForCamera | [PlayerCameraState](#PlayerCameraState) | read-only |
+| statusForCamera | [PlayerCameraState](#PlayerCameraState) | |
| terrainSoundAddend | integer | |
| twirlYaw | integer | |
| unkB0 | integer | |
| unkC4 | number | |
-| usedObj | [Object](#Object) | read-only |
+| usedObj | [Object](#Object) | |
| vel | [Vec3f](#Vec3f) | read-only |
-| wall | [Surface](#Surface) | read-only |
+| wall | [Surface](#Surface) | |
| wallKickTimer | integer | |
| wasNetworkVisible | integer | |
| waterLevel | integer | |
@@ -666,7 +666,7 @@
| bhvDelayTimer | integer | |
| bhvStackIndex | integer | |
| collidedObjInteractTypes | integer | |
-| createdThroughNetwork | integer | |
+| createdThroughNetwork | integer | read-only |
| curBhvCommand | Pointer | read-only |
| globalPlayerIndex | integer | |
| header | [ObjectNode](#ObjectNode) | read-only |
@@ -677,9 +677,9 @@
| hurtboxHeight | number | |
| hurtboxRadius | number | |
| numCollidedObjs | integer | |
-| parentObj | [Object](#Object) | read-only |
-| platform | [Object](#Object) | read-only |
-| prevObj | [Object](#Object) | read-only |
+| parentObj | [Object](#Object) | |
+| platform | [Object](#Object) | |
+| prevObj | [Object](#Object) | |
| respawnInfoType | integer | |
| unused1 | integer | |
@@ -754,14 +754,14 @@
| oFloorType | integer | |
| oFloorRoom | integer | |
| oAngleToHome | integer | |
-| oFloor | [Surface](#Surface) | read-only |
+| oFloor | [Surface](#Surface) | |
| oDeathSound | integer | |
### Object-Dependent Data Fields
| Field | Type | Access |
| ----- | ---- | ------ |
-| oPathedStartWaypoint | [Waypoint](#Waypoint) | read-only |
-| oPathedPrevWaypoint | [Waypoint](#Waypoint) | read-only |
+| oPathedStartWaypoint | [Waypoint](#Waypoint) | |
+| oPathedPrevWaypoint | [Waypoint](#Waypoint) | |
| oPathedPrevWaypointFlags | integer | |
| oPathedTargetPitch | integer | |
| oPathedTargetYaw | integer | |
@@ -808,7 +808,7 @@
| oBirdTargetYaw | integer | |
| oBirdChirpChirpUnkF4 | integer | |
| oEndBirdUnk104 | number | |
-| oHiddenBlueCoinSwitch | [Object](#Object) | read-only |
+| oHiddenBlueCoinSwitch | [Object](#Object) | |
| oBobombBlinkTimer | integer | |
| oBobombFuseLit | integer | |
| oBobombFuseTimer | integer | |
@@ -830,7 +830,7 @@
| oBooOscillationTimer | integer | |
| oBooMoveYawDuringHit | integer | |
| oBooMoveYawBeforeHit | number | |
-| oBooParentBigBoo | [Object](#Object) | read-only |
+| oBooParentBigBoo | [Object](#Object) | |
| oBooNegatedAggressiveness | number | |
| oBooInitialMoveYaw | integer | |
| oBooTurningSpeed | integer | |
@@ -903,7 +903,7 @@
| oCannonPlayerIndex | integer | |
| oCapUnkF4 | integer | |
| oCapUnkF8 | integer | |
-| oChainChompSegments | [ChainSegment](#ChainSegment) | read-only |
+| oChainChompSegments | [ChainSegment](#ChainSegment) | |
| oChainChompMaxDistFromPivotPerChainPart | number | |
| oChainChompMaxDistBetweenChainParts | number | |
| oChainChompDistToPivot | number | |
@@ -998,7 +998,7 @@
| oFlameUnkF4 | number | |
| oFlameUnkF8 | integer | |
| oFlameUnkFC | number | |
-| oFlameUnk100 | [Object](#Object) | read-only |
+| oFlameUnk100 | [Object](#Object) | |
| oBlueFlameUnkF8 | number | |
| oSmallPiranhaFlameStartSpeed | number | |
| oSmallPiranhaFlameEndSpeed | number | |
@@ -1042,7 +1042,7 @@
| oHauntedChairUnk104 | integer | |
| oHeaveHoUnk88 | integer | |
| oHeaveHoUnkF4 | number | |
-| oHiddenObjectUnkF4 | [Object](#Object) | read-only |
+| oHiddenObjectUnkF4 | [Object](#Object) | |
| oHootAvailability | integer | |
| oHootMarioReleaseTime | integer | |
| oHorizontalMovementUnkF4 | integer | |
@@ -1106,7 +1106,7 @@
| oIntroLakituUnk108 | number | |
| oIntroLakituUnk10C | number | |
| oIntroLakituUnk110 | number | |
-| oIntroLakituCloud | [Object](#Object) | read-only |
+| oIntroLakituCloud | [Object](#Object) | |
| oMenuButtonState | integer | |
| oMenuButtonTimer | integer | |
| oMenuButtonOrigPosX | number | |
@@ -1127,14 +1127,14 @@
| oMipsStartWaypointIndex | integer | |
| oMipsForwardVelocity | number | |
| oMoneybagJumpState | integer | |
-| oMontyMoleCurrentHole | [Object](#Object) | read-only |
+| oMontyMoleCurrentHole | [Object](#Object) | |
| oMontyMoleHeightRelativeToFloor | number | |
| oMontyMoleHoleX | number | |
| oMontyMoleHoleY | number | |
| oMontyMoleHoleZ | number | |
| oMontyMoleHoleCooldown | integer | |
| oMrBlizzardScale | number | |
-| oMrBlizzardHeldObj | [Object](#Object) | read-only |
+| oMrBlizzardHeldObj | [Object](#Object) | |
| oMrBlizzardGraphYVel | number | |
| oMrBlizzardTimer | integer | |
| oMrBlizzardDizziness | number | |
@@ -1152,7 +1152,7 @@
| oRespawnerModelToRespawn | integer | |
| oRespawnerMinSpawnDist | number | |
| oOpenableGrillUnk88 | integer | |
-| oOpenableGrillUnkF4 | [Object](#Object) | read-only |
+| oOpenableGrillUnkF4 | [Object](#Object) | |
| oIntroPeachYawFromFocus | number | |
| oIntroPeachPitchFromFocus | number | |
| oIntroPeachDistToCamera | number | |
@@ -1182,15 +1182,15 @@
| oPitouneUnkF8 | number | |
| oPitouneUnkFC | number | |
| oPlatformTimer | integer | |
-| oPlatformUnkF8 | [Object](#Object) | read-only |
+| oPlatformUnkF8 | [Object](#Object) | |
| oPlatformUnkFC | integer | |
| oPlatformUnk10C | number | |
| oPlatformUnk110 | number | |
| oPlatformOnTrackBaseBallIndex | integer | |
| oPlatformOnTrackDistMovedSinceLastBall | number | |
| oPlatformOnTrackSkiLiftRollVel | number | |
-| oPlatformOnTrackStartWaypoint | [Waypoint](#Waypoint) | read-only |
-| oPlatformOnTrackPrevWaypoint | [Waypoint](#Waypoint) | read-only |
+| oPlatformOnTrackStartWaypoint | [Waypoint](#Waypoint) | |
+| oPlatformOnTrackPrevWaypoint | [Waypoint](#Waypoint) | |
| oPlatformOnTrackPrevWaypointFlags | integer | |
| oPlatformOnTrackPitch | integer | |
| oPlatformOnTrackYaw | integer | |
@@ -1239,7 +1239,7 @@
| oSkeeterWaitTime | integer | |
| oSkeeterLastWaterY | number | |
| oSkeeterUnk1AC | integer | |
-| oJrbSlidingBoxUnkF4 | [Object](#Object) | read-only |
+| oJrbSlidingBoxUnkF4 | [Object](#Object) | |
| oJrbSlidingBoxUnkF8 | integer | |
| oJrbSlidingBoxUnkFC | number | |
| oWFSlidBrickPtfmMovVel | number | |
@@ -1393,10 +1393,10 @@
| oWhitePuffUnkF4 | number | |
| oWhitePuffUnkF8 | integer | |
| oWhitePuffUnkFC | integer | |
-| oStrongWindParticlePenguinObj | [Object](#Object) | read-only |
+| oStrongWindParticlePenguinObj | [Object](#Object) | |
| oWhompShakeVal | integer | |
| oWigglerFallThroughFloorsHeight | number | |
-| oWigglerSegments | [ChainSegment](#ChainSegment) | read-only |
+| oWigglerSegments | [ChainSegment](#ChainSegment) | |
| oWigglerWalkAnimSpeed | number | |
| oWigglerSquishSpeed | number | |
| oWigglerTimeUntilRandomTurn | integer | |
@@ -1442,8 +1442,8 @@
| Field | Type | Access |
| ----- | ---- | ------ |
| gfx | [GraphNodeObject](#GraphNodeObject) | read-only |
-| next | [ObjectNode](#ObjectNode) | read-only |
-| prev | [ObjectNode](#ObjectNode) | read-only |
+| next | [ObjectNode](#ObjectNode) | |
+| prev | [ObjectNode](#ObjectNode) | |
[:arrow_up_small:](#)
@@ -1453,9 +1453,9 @@
| Field | Type | Access |
| ----- | ---- | ------ |
-| next | [ObjectWarpNode](#ObjectWarpNode) | read-only |
+| next | [ObjectWarpNode](#ObjectWarpNode) | |
| node | [WarpNode](#WarpNode) | read-only |
-| object | [Object](#Object) | read-only |
+| object | [Object](#Object) | |
[:arrow_up_small:](#)
@@ -1495,7 +1495,7 @@
| headRotation | [Vec3s](#Vec3s) | read-only |
| pos | [Vec3f](#Vec3f) | read-only |
| unused | integer | |
-| usedObj | [Object](#Object) | read-only |
+| usedObj | [Object](#Object) | |
[:arrow_up_small:](#)
@@ -1505,16 +1505,16 @@
| Field | Type | Access |
| ----- | ---- | ------ |
-| currCeil | [Surface](#Surface) | read-only |
+| currCeil | [Surface](#Surface) | |
| currCeilHeight | number | |
| currCeilType | integer | |
-| currFloor | [Surface](#Surface) | read-only |
+| currFloor | [Surface](#Surface) | |
| currFloorHeight | number | |
| currFloorType | integer | |
-| prevCeil | [Surface](#Surface) | read-only |
+| prevCeil | [Surface](#Surface) | |
| prevCeilHeight | number | |
| prevCeilType | integer | |
-| prevFloor | [Surface](#Surface) | read-only |
+| prevFloor | [Surface](#Surface) | |
| prevFloorHeight | number | |
| prevFloorType | integer | |
| waterHeight | number | |
@@ -1530,10 +1530,10 @@
| activeAreaIndex | integer | |
| areaIndex | integer | |
| behaviorArg | integer | |
-| next | [SpawnInfo](#SpawnInfo) | read-only |
+| next | [SpawnInfo](#SpawnInfo) | |
| startAngle | [Vec3s](#Vec3s) | read-only |
| startPos | [Vec3s](#Vec3s) | read-only |
-| unk18 | [GraphNode](#GraphNode) | read-only |
+| unk18 | [GraphNode](#GraphNode) | |
[:arrow_up_small:](#)
@@ -1580,7 +1580,7 @@
| lowerY | integer | |
| modifiedTimestamp | integer | |
| normal | [Vec3f](#Vec3f) | read-only |
-| object | [Object](#Object) | read-only |
+| object | [Object](#Object) | |
| originOffset | number | |
| prevVertex1 | [Vec3s](#Vec3s) | read-only |
| prevVertex2 | [Vec3s](#Vec3s) | read-only |
diff --git a/src/game/behaviors/bobomb.inc.c b/src/game/behaviors/bobomb.inc.c
index 92edd3cba..bf60f4ced 100644
--- a/src/game/behaviors/bobomb.inc.c
+++ b/src/game/behaviors/bobomb.inc.c
@@ -41,7 +41,9 @@ void bobomb_act_explode(void) {
}
bobomb_spawn_coin();
- create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ }
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
}
}
@@ -131,13 +133,15 @@ void generic_bobomb_free_loop(void) {
break;
case BOBOMB_ACT_LAVA_DEATH:
- if (obj_lava_death() == 1)
+ if (obj_lava_death() == 1 && !o->createdThroughNetwork)
create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
break;
case BOBOMB_ACT_DEATH_PLANE_DEATH:
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
- create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ }
break;
}
@@ -158,13 +162,15 @@ void stationary_bobomb_free_loop(void) {
break;
case BOBOMB_ACT_LAVA_DEATH:
- if (obj_lava_death() == 1)
+ if (obj_lava_death() == 1 && !o->createdThroughNetwork)
create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
break;
case BOBOMB_ACT_DEATH_PLANE_DEATH:
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
- create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
+ }
break;
}
diff --git a/src/game/behaviors/breakable_box_small.inc.c b/src/game/behaviors/breakable_box_small.inc.c
index 7bfff612e..bcdab9c9a 100644
--- a/src/game/behaviors/breakable_box_small.inc.c
+++ b/src/game/behaviors/breakable_box_small.inc.c
@@ -71,7 +71,9 @@ void breakable_box_small_released_loop(void) {
// Despawn, and create a corkbox respawner
if (o->oBreakableBoxSmallFramesSinceReleased > 900) {
- create_respawner(MODEL_BREAKABLE_BOX_SMALL, bhvBreakableBoxSmall, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_BREAKABLE_BOX_SMALL, bhvBreakableBoxSmall, 3000);
+ }
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
}
}
@@ -88,7 +90,9 @@ void breakable_box_small_idle_loop(void) {
case 101:
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
- create_respawner(MODEL_BREAKABLE_BOX_SMALL, bhvBreakableBoxSmall, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_BREAKABLE_BOX_SMALL, bhvBreakableBoxSmall, 3000);
+ }
break;
}
diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c
index ec6e55b26..e5f1d54fc 100644
--- a/src/game/behaviors/snowman.inc.c
+++ b/src/game/behaviors/snowman.inc.c
@@ -104,7 +104,9 @@ void snowmans_bottom_act_2(void) {
}
if (o->oTimer == 200) {
- create_respawner(MODEL_CCM_SNOWMAN_BASE, bhvSnowmansBottom, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_CCM_SNOWMAN_BASE, bhvSnowmansBottom, 3000);
+ }
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
}
}
diff --git a/src/game/behaviors/yoshi.inc.c b/src/game/behaviors/yoshi.inc.c
index 2a2937a09..0317c7647 100644
--- a/src/game/behaviors/yoshi.inc.c
+++ b/src/game/behaviors/yoshi.inc.c
@@ -50,7 +50,9 @@ void yoshi_walk_loop(void) {
}
if (o->oPosY < 2100.0f) {
- create_respawner(MODEL_YOSHI, bhvYoshi, 3000);
+ if (!o->createdThroughNetwork) {
+ create_respawner(MODEL_YOSHI, bhvYoshi, 3000);
+ }
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
}
}
diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c
index b29d3f30a..77b99a1bc 100644
--- a/src/pc/lua/smlua_cobject.c
+++ b/src/pc/lua/smlua_cobject.c
@@ -181,6 +181,7 @@ static int smlua__set_field(lua_State* L) {
return 0;
}
+ void* valuePointer = NULL;
u8* p = ((u8*)(intptr_t)pointer) + data->valueOffset;
switch (data->valueType) {
case LVT_BOOL:*(u8*) p = smlua_to_boolean(L, -1); break;
@@ -191,6 +192,14 @@ static int smlua__set_field(lua_State* L) {
case LVT_S16: *(s16*)p = smlua_to_integer(L, -1); break;
case LVT_S32: *(s32*)p = smlua_to_integer(L, -1); break;
case LVT_F32: *(f32*)p = smlua_to_number(L, -1); break;
+
+ case LVT_COBJECT_P:
+ valuePointer = smlua_to_cobject(L, -1, data->lot);
+ if (gSmLuaConvertSuccess) {
+ *(u8**)p = valuePointer;
+ }
+ break;
+
default:
LOG_LUA("_set_field on unimplemented type '%d', key '%s'", data->valueType, key);
smlua_logline();
diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c
index 6c21d1d03..7e7dc029e 100644
--- a/src/pc/lua/smlua_cobject_autogen.c
+++ b/src/pc/lua/smlua_cobject_autogen.c
@@ -20,11 +20,11 @@ static struct LuaObjectField sAnimInfoFields[LUA_ANIM_INFO_FIELD_COUNT] = {
{ "animID", LVT_S16, offsetof(struct AnimInfo, animID), false, LOT_NONE },
{ "animTimer", LVT_U16, offsetof(struct AnimInfo, animTimer), false, LOT_NONE },
{ "animYTrans", LVT_S16, offsetof(struct AnimInfo, animYTrans), false, LOT_NONE },
- { "curAnim", LVT_COBJECT_P, offsetof(struct AnimInfo, curAnim), true, LOT_ANIMATION },
+ { "curAnim", LVT_COBJECT_P, offsetof(struct AnimInfo, curAnim), false, LOT_ANIMATION },
{ "prevAnimFrame", LVT_S16, offsetof(struct AnimInfo, prevAnimFrame), false, LOT_NONE },
{ "prevAnimFrameTimestamp", LVT_U32, offsetof(struct AnimInfo, prevAnimFrameTimestamp), false, LOT_NONE },
{ "prevAnimID", LVT_S16, offsetof(struct AnimInfo, prevAnimID), false, LOT_NONE },
- { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct AnimInfo, prevAnimPtr), true, LOT_ANIMATION },
+ { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct AnimInfo, prevAnimPtr), false, LOT_ANIMATION },
};
#define LUA_ANIMATION_FIELD_COUNT 9
@@ -44,22 +44,22 @@ static struct LuaObjectField sAnimationFields[LUA_ANIMATION_FIELD_COUNT] = {
static struct LuaObjectField sAreaFields[LUA_AREA_FIELD_COUNT] = {
// { "cachedBehaviors", LOT_???, offsetof(struct Area, cachedBehaviors), false, LOT_??? }, <--- UNIMPLEMENTED
// { "cachedPositions", LOT_???, offsetof(struct Area, cachedPositions), false, LOT_??? }, <--- UNIMPLEMENTED
- { "camera", LVT_COBJECT_P, offsetof(struct Area, camera), true, LOT_CAMERA },
+ { "camera", LVT_COBJECT_P, offsetof(struct Area, camera), false, LOT_CAMERA },
// { "dialog", LOT_???, offsetof(struct Area, dialog), false, LOT_??? }, <--- UNIMPLEMENTED
{ "flags", LVT_S8, offsetof(struct Area, flags), false, LOT_NONE },
{ "index", LVT_S8, offsetof(struct Area, index), false, LOT_NONE },
- { "instantWarps", LVT_COBJECT_P, offsetof(struct Area, instantWarps), true, LOT_INSTANTWARP },
+ { "instantWarps", LVT_COBJECT_P, offsetof(struct Area, instantWarps), false, LOT_INSTANTWARP },
{ "macroObjects", LVT_S16_P, offsetof(struct Area, macroObjects), true, LOT_POINTER },
{ "musicParam", LVT_U16, offsetof(struct Area, musicParam), false, LOT_NONE },
{ "musicParam2", LVT_U16, offsetof(struct Area, musicParam2), false, LOT_NONE },
- { "objectSpawnInfos", LVT_COBJECT_P, offsetof(struct Area, objectSpawnInfos), true, LOT_SPAWNINFO },
- { "paintingWarpNodes", LVT_COBJECT_P, offsetof(struct Area, paintingWarpNodes), true, LOT_WARPNODE },
+ { "objectSpawnInfos", LVT_COBJECT_P, offsetof(struct Area, objectSpawnInfos), false, LOT_SPAWNINFO },
+ { "paintingWarpNodes", LVT_COBJECT_P, offsetof(struct Area, paintingWarpNodes), false, LOT_WARPNODE },
{ "surfaceRooms", LVT_S8_P, offsetof(struct Area, surfaceRooms), true, LOT_POINTER },
{ "terrainData", LVT_S16_P, offsetof(struct Area, terrainData), true, LOT_POINTER },
{ "terrainType", LVT_U16, offsetof(struct Area, terrainType), false, LOT_NONE },
-// { "unk04", LVT_COBJECT_P, offsetof(struct Area, unk04), true, LOT_??? }, <--- UNIMPLEMENTED
-// { "unused28", LVT_COBJECT_P, offsetof(struct Area, unused28), true, LOT_??? }, <--- UNIMPLEMENTED
- { "warpNodes", LVT_COBJECT_P, offsetof(struct Area, warpNodes), true, LOT_OBJECTWARPNODE },
+// { "unk04", LVT_COBJECT_P, offsetof(struct Area, unk04), false, LOT_??? }, <--- UNIMPLEMENTED
+// { "unused28", LVT_COBJECT_P, offsetof(struct Area, unused28), false, LOT_??? }, <--- UNIMPLEMENTED
+ { "warpNodes", LVT_COBJECT_P, offsetof(struct Area, warpNodes), false, LOT_OBJECTWARPNODE },
// { "whirlpools", LOT_???, offsetof(struct Area, whirlpools), false, LOT_??? }, <--- UNIMPLEMENTED
};
@@ -249,11 +249,11 @@ static struct LuaObjectField sGlobalTexturesFields[LUA_GLOBAL_TEXTURES_FIELD_COU
#define LUA_GRAPH_NODE_FIELD_COUNT 6
static struct LuaObjectField sGraphNodeFields[LUA_GRAPH_NODE_FIELD_COUNT] = {
- { "children", LVT_COBJECT_P, offsetof(struct GraphNode, children), true, LOT_GRAPHNODE },
+ { "children", LVT_COBJECT_P, offsetof(struct GraphNode, children), false, LOT_GRAPHNODE },
{ "flags", LVT_S16, offsetof(struct GraphNode, flags), false, LOT_NONE },
- { "next", LVT_COBJECT_P, offsetof(struct GraphNode, next), true, LOT_GRAPHNODE },
- { "parent", LVT_COBJECT_P, offsetof(struct GraphNode, parent), true, LOT_GRAPHNODE },
- { "prev", LVT_COBJECT_P, offsetof(struct GraphNode, prev), true, LOT_GRAPHNODE },
+ { "next", LVT_COBJECT_P, offsetof(struct GraphNode, next), false, LOT_GRAPHNODE },
+ { "parent", LVT_COBJECT_P, offsetof(struct GraphNode, parent), false, LOT_GRAPHNODE },
+ { "prev", LVT_COBJECT_P, offsetof(struct GraphNode, prev), false, LOT_GRAPHNODE },
{ "type", LVT_S16, offsetof(struct GraphNode, type), false, LOT_NONE },
};
@@ -276,11 +276,11 @@ static struct LuaObjectField sGraphNodeObjectFields[LUA_GRAPH_NODE_OBJECT_FIELD_
{ "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), false, LOT_NONE },
{ "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), false, LOT_NONE },
{ "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F },
- { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), true, LOT_GRAPHNODE },
+ { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), false, LOT_GRAPHNODE },
{ "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), false, LOT_NONE },
// { "throwMatrix", LVT_???, offsetof(struct GraphNodeObject, throwMatrix), false, LOT_??? }, <--- UNIMPLEMENTED
// { "throwMatrixInterpolated", LVT_???, offsetof(struct GraphNodeObject, throwMatrixInterpolated), false, LOT_??? }, <--- UNIMPLEMENTED
- { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), true, LOT_SPAWNINFO },
+ { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), false, LOT_SPAWNINFO },
};
#define LUA_GRAPH_NODE_802_A45_E4_FIELD_COUNT 6
@@ -361,10 +361,10 @@ static struct LuaObjectField sLinearTransitionPointFields[LUA_LINEAR_TRANSITION_
#define LUA_MARIO_ANIMATION_FIELD_COUNT 2
static struct LuaObjectField sMarioAnimationFields[LUA_MARIO_ANIMATION_FIELD_COUNT] = {
-// { "animDmaTable", LVT_COBJECT_P, offsetof(struct MarioAnimation, animDmaTable), true, LOT_??? }, <--- UNIMPLEMENTED
+// { "animDmaTable", LVT_COBJECT_P, offsetof(struct MarioAnimation, animDmaTable), false, LOT_??? }, <--- UNIMPLEMENTED
{ "currentAnimAddr", LVT_U8_P, offsetof(struct MarioAnimation, currentAnimAddr), true, LOT_POINTER },
// { "padding", LOT_???, offsetof(struct MarioAnimation, padding), false, LOT_??? }, <--- UNIMPLEMENTED
- { "targetAnim", LVT_COBJECT_P, offsetof(struct MarioAnimation, targetAnim), true, LOT_ANIMATION },
+ { "targetAnim", LVT_COBJECT_P, offsetof(struct MarioAnimation, targetAnim), false, LOT_ANIMATION },
};
#define LUA_MARIO_BODY_STATE_FIELD_COUNT 12
@@ -391,22 +391,22 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "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), true, LOT_MARIOANIMATION },
- { "area", LVT_COBJECT_P, offsetof(struct MarioState, area), true, LOT_AREA },
- { "bubbleObj", LVT_COBJECT_P, offsetof(struct MarioState, bubbleObj), true, LOT_OBJECT },
+ { "animation", LVT_COBJECT_P, offsetof(struct MarioState, animation), false, LOT_MARIOANIMATION },
+ { "area", LVT_COBJECT_P, offsetof(struct MarioState, area), false, LOT_AREA },
+ { "bubbleObj", LVT_COBJECT_P, offsetof(struct MarioState, bubbleObj), false, LOT_OBJECT },
{ "capTimer", LVT_U16, offsetof(struct MarioState, capTimer), false, LOT_NONE },
- { "ceil", LVT_COBJECT_P, offsetof(struct MarioState, ceil), true, LOT_SURFACE },
+ { "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), true, LOT_CHARACTER },
+ { "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 },
+ { "controller", LVT_COBJECT_P, offsetof(struct MarioState, controller), false, 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), true, LOT_SURFACE },
+ { "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 },
@@ -415,17 +415,17 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "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), true, LOT_OBJECT },
- { "heldObj", LVT_COBJECT_P, offsetof(struct MarioState, heldObj), true, LOT_OBJECT },
+ { "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), true, LOT_OBJECT },
+ { "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 },
- { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), true, LOT_MARIOBODYSTATE },
- { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), true, LOT_OBJECT },
+ { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), false, LOT_MARIOBODYSTATE },
+ { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), false, 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 },
@@ -439,23 +439,23 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "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), true, LOT_OBJECT },
+ { "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), true, LOT_SPAWNINFO },
+ { "spawnInfo", LVT_COBJECT_P, offsetof(struct MarioState, spawnInfo), false, LOT_SPAWNINFO },
// { "splineKeyframe", LVT_???, offsetof(struct MarioState, splineKeyframe), false, LOT_??? }, <--- UNIMPLEMENTED
{ "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 },
+ { "statusForCamera", LVT_COBJECT_P, offsetof(struct MarioState, statusForCamera), false, 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), true, LOT_OBJECT },
+ { "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), true, LOT_SURFACE },
+ { "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE },
{ "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE },
{ "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE },
{ "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE },
@@ -514,7 +514,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "collidedObjInteractTypes", LVT_U32, offsetof(struct Object, collidedObjInteractTypes), false, LOT_NONE },
// { "collidedObjs", LOT_???, offsetof(struct Object, collidedObjs), false, LOT_??? }, <--- UNIMPLEMENTED
// { "collisionData", LVT_???, offsetof(struct Object, collisionData), false, LOT_??? }, <--- UNIMPLEMENTED
- { "createdThroughNetwork", LVT_U8, offsetof(struct Object, createdThroughNetwork), false, LOT_NONE },
+ { "createdThroughNetwork", LVT_U8, offsetof(struct Object, createdThroughNetwork), true, LOT_NONE },
{ "curBhvCommand", LVT_BEHAVIORSCRIPT_P, offsetof(struct Object, curBhvCommand), true, LOT_POINTER },
{ "globalPlayerIndex", LVT_U8, offsetof(struct Object, globalPlayerIndex), false, LOT_NONE },
{ "header", LVT_COBJECT, offsetof(struct Object, header), true, LOT_OBJECTNODE },
@@ -588,7 +588,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oBooMoveYawDuringHit", LVT_S32, offsetof(struct Object, oBooMoveYawDuringHit), false, LOT_NONE },
{ "oBooNegatedAggressiveness", LVT_F32, offsetof(struct Object, oBooNegatedAggressiveness), false, LOT_NONE },
{ "oBooOscillationTimer", LVT_S32, offsetof(struct Object, oBooOscillationTimer), false, LOT_NONE },
- { "oBooParentBigBoo", LVT_COBJECT_P, offsetof(struct Object, oBooParentBigBoo), true, LOT_OBJECT },
+ { "oBooParentBigBoo", LVT_COBJECT_P, offsetof(struct Object, oBooParentBigBoo), false, LOT_OBJECT },
{ "oBooTargetOpacity", LVT_S32, offsetof(struct Object, oBooTargetOpacity), false, LOT_NONE },
{ "oBooTurningSpeed", LVT_S16, offsetof(struct Object, oBooTurningSpeed), false, LOT_NONE },
{ "oBookSwitchManagerUnkF4", LVT_S32, offsetof(struct Object, oBookSwitchManagerUnkF4), false, LOT_NONE },
@@ -669,7 +669,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oChainChompNumLunges", LVT_S32, offsetof(struct Object, oChainChompNumLunges), false, LOT_NONE },
{ "oChainChompReleaseStatus", LVT_S32, offsetof(struct Object, oChainChompReleaseStatus), false, LOT_NONE },
{ "oChainChompRestrictedByChain", LVT_S32, offsetof(struct Object, oChainChompRestrictedByChain), false, LOT_NONE },
- { "oChainChompSegments", LVT_COBJECT_P, offsetof(struct Object, oChainChompSegments), true, LOT_CHAINSEGMENT },
+ { "oChainChompSegments", LVT_COBJECT_P, offsetof(struct Object, oChainChompSegments), false, LOT_CHAINSEGMENT },
{ "oChainChompTargetPitch", LVT_S32, offsetof(struct Object, oChainChompTargetPitch), false, LOT_NONE },
{ "oChainChompUnk104", LVT_F32, offsetof(struct Object, oChainChompUnk104), false, LOT_NONE },
{ "oCheckerBoardPlatformUnk1AC", LVT_F32, offsetof(struct Object, oCheckerBoardPlatformUnk1AC), false, LOT_NONE },
@@ -772,7 +772,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oFlags", LVT_U32, offsetof(struct Object, oFlags), false, LOT_NONE },
{ "oFlameThowerFlameUnk110", LVT_S32, offsetof(struct Object, oFlameThowerFlameUnk110), false, LOT_NONE },
{ "oFlameThowerUnk110", LVT_S32, offsetof(struct Object, oFlameThowerUnk110), false, LOT_NONE },
- { "oFlameUnk100", LVT_COBJECT_P, offsetof(struct Object, oFlameUnk100), true, LOT_OBJECT },
+ { "oFlameUnk100", LVT_COBJECT_P, offsetof(struct Object, oFlameUnk100), false, LOT_OBJECT },
{ "oFlameUnkF4", LVT_F32, offsetof(struct Object, oFlameUnkF4), false, LOT_NONE },
{ "oFlameUnkF8", LVT_S32, offsetof(struct Object, oFlameUnkF8), false, LOT_NONE },
{ "oFlameUnkFC", LVT_F32, offsetof(struct Object, oFlameUnkFC), false, LOT_NONE },
@@ -780,7 +780,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oFloatingPlatformUnkF4", LVT_S32, offsetof(struct Object, oFloatingPlatformUnkF4), false, LOT_NONE },
{ "oFloatingPlatformUnkF8", LVT_F32, offsetof(struct Object, oFloatingPlatformUnkF8), false, LOT_NONE },
{ "oFloatingPlatformUnkFC", LVT_F32, offsetof(struct Object, oFloatingPlatformUnkFC), false, LOT_NONE },
- { "oFloor", LVT_COBJECT_P, offsetof(struct Object, oFloor), true, LOT_SURFACE },
+ { "oFloor", LVT_COBJECT_P, offsetof(struct Object, oFloor), false, LOT_SURFACE },
{ "oFloorHeight", LVT_F32, offsetof(struct Object, oFloorHeight), false, LOT_NONE },
{ "oFloorRoom", LVT_S16, offsetof(struct Object, oFloorRoom), false, LOT_NONE },
{ "oFloorSwitchPressAnimationUnk100", LVT_S32, offsetof(struct Object, oFloorSwitchPressAnimationUnk100), false, LOT_NONE },
@@ -819,8 +819,8 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oHeaveHoUnk88", LVT_S32, offsetof(struct Object, oHeaveHoUnk88), false, LOT_NONE },
{ "oHeaveHoUnkF4", LVT_F32, offsetof(struct Object, oHeaveHoUnkF4), false, LOT_NONE },
{ "oHeldState", LVT_U32, offsetof(struct Object, oHeldState), false, LOT_NONE },
- { "oHiddenBlueCoinSwitch", LVT_COBJECT_P, offsetof(struct Object, oHiddenBlueCoinSwitch), true, LOT_OBJECT },
- { "oHiddenObjectUnkF4", LVT_COBJECT_P, offsetof(struct Object, oHiddenObjectUnkF4), true, LOT_OBJECT },
+ { "oHiddenBlueCoinSwitch", LVT_COBJECT_P, offsetof(struct Object, oHiddenBlueCoinSwitch), false, LOT_OBJECT },
+ { "oHiddenObjectUnkF4", LVT_COBJECT_P, offsetof(struct Object, oHiddenObjectUnkF4), false, LOT_OBJECT },
{ "oHiddenStarTriggerCounter", LVT_S32, offsetof(struct Object, oHiddenStarTriggerCounter), false, LOT_NONE },
{ "oHomeX", LVT_F32, offsetof(struct Object, oHomeX), false, LOT_NONE },
{ "oHomeY", LVT_F32, offsetof(struct Object, oHomeY), false, LOT_NONE },
@@ -841,7 +841,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oInteractStatus", LVT_S32, offsetof(struct Object, oInteractStatus), false, LOT_NONE },
{ "oInteractType", LVT_U32, offsetof(struct Object, oInteractType), false, LOT_NONE },
{ "oInteractionSubtype", LVT_U32, offsetof(struct Object, oInteractionSubtype), false, LOT_NONE },
- { "oIntroLakituCloud", LVT_COBJECT_P, offsetof(struct Object, oIntroLakituCloud), true, LOT_OBJECT },
+ { "oIntroLakituCloud", LVT_COBJECT_P, offsetof(struct Object, oIntroLakituCloud), false, LOT_OBJECT },
{ "oIntroLakituSplineSegment", LVT_F32, offsetof(struct Object, oIntroLakituSplineSegment), false, LOT_NONE },
{ "oIntroLakituSplineSegmentProgress", LVT_F32, offsetof(struct Object, oIntroLakituSplineSegmentProgress), false, LOT_NONE },
{ "oIntroLakituUnk100", LVT_F32, offsetof(struct Object, oIntroLakituUnk100), false, LOT_NONE },
@@ -852,7 +852,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oIntroPeachDistToCamera", LVT_F32, offsetof(struct Object, oIntroPeachDistToCamera), false, LOT_NONE },
{ "oIntroPeachPitchFromFocus", LVT_F32, offsetof(struct Object, oIntroPeachPitchFromFocus), false, LOT_NONE },
{ "oIntroPeachYawFromFocus", LVT_F32, offsetof(struct Object, oIntroPeachYawFromFocus), false, LOT_NONE },
- { "oJrbSlidingBoxUnkF4", LVT_COBJECT_P, offsetof(struct Object, oJrbSlidingBoxUnkF4), true, LOT_OBJECT },
+ { "oJrbSlidingBoxUnkF4", LVT_COBJECT_P, offsetof(struct Object, oJrbSlidingBoxUnkF4), false, LOT_OBJECT },
{ "oJrbSlidingBoxUnkF8", LVT_S32, offsetof(struct Object, oJrbSlidingBoxUnkF8), false, LOT_NONE },
{ "oJrbSlidingBoxUnkFC", LVT_F32, offsetof(struct Object, oJrbSlidingBoxUnkFC), false, LOT_NONE },
{ "oJumpingBoxUnkF4", LVT_S32, offsetof(struct Object, oJumpingBoxUnkF4), false, LOT_NONE },
@@ -938,7 +938,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oMipsStarStatus", LVT_S32, offsetof(struct Object, oMipsStarStatus), false, LOT_NONE },
{ "oMipsStartWaypointIndex", LVT_S32, offsetof(struct Object, oMipsStartWaypointIndex), false, LOT_NONE },
{ "oMoneybagJumpState", LVT_S32, offsetof(struct Object, oMoneybagJumpState), false, LOT_NONE },
- { "oMontyMoleCurrentHole", LVT_COBJECT_P, offsetof(struct Object, oMontyMoleCurrentHole), true, LOT_OBJECT },
+ { "oMontyMoleCurrentHole", LVT_COBJECT_P, offsetof(struct Object, oMontyMoleCurrentHole), false, LOT_OBJECT },
{ "oMontyMoleHeightRelativeToFloor", LVT_F32, offsetof(struct Object, oMontyMoleHeightRelativeToFloor), false, LOT_NONE },
{ "oMontyMoleHoleCooldown", LVT_S32, offsetof(struct Object, oMontyMoleHoleCooldown), false, LOT_NONE },
{ "oMontyMoleHoleX", LVT_F32, offsetof(struct Object, oMontyMoleHoleX), false, LOT_NONE },
@@ -954,7 +954,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oMrBlizzardDizziness", LVT_F32, offsetof(struct Object, oMrBlizzardDizziness), false, LOT_NONE },
{ "oMrBlizzardGraphYOffset", LVT_F32, offsetof(struct Object, oMrBlizzardGraphYOffset), false, LOT_NONE },
{ "oMrBlizzardGraphYVel", LVT_F32, offsetof(struct Object, oMrBlizzardGraphYVel), false, LOT_NONE },
- { "oMrBlizzardHeldObj", LVT_COBJECT_P, offsetof(struct Object, oMrBlizzardHeldObj), true, LOT_OBJECT },
+ { "oMrBlizzardHeldObj", LVT_COBJECT_P, offsetof(struct Object, oMrBlizzardHeldObj), false, LOT_OBJECT },
{ "oMrBlizzardScale", LVT_F32, offsetof(struct Object, oMrBlizzardScale), false, LOT_NONE },
{ "oMrBlizzardTargetMoveYaw", LVT_S32, offsetof(struct Object, oMrBlizzardTargetMoveYaw), false, LOT_NONE },
{ "oMrBlizzardTimer", LVT_S32, offsetof(struct Object, oMrBlizzardTimer), false, LOT_NONE },
@@ -968,13 +968,13 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oNumLootCoins", LVT_S32, offsetof(struct Object, oNumLootCoins), false, LOT_NONE },
{ "oOpacity", LVT_S32, offsetof(struct Object, oOpacity), false, LOT_NONE },
{ "oOpenableGrillUnk88", LVT_S32, offsetof(struct Object, oOpenableGrillUnk88), false, LOT_NONE },
- { "oOpenableGrillUnkF4", LVT_COBJECT_P, offsetof(struct Object, oOpenableGrillUnkF4), true, LOT_OBJECT },
+ { "oOpenableGrillUnkF4", LVT_COBJECT_P, offsetof(struct Object, oOpenableGrillUnkF4), false, LOT_OBJECT },
{ "oParentRelativePosX", LVT_F32, offsetof(struct Object, oParentRelativePosX), false, LOT_NONE },
{ "oParentRelativePosY", LVT_F32, offsetof(struct Object, oParentRelativePosY), false, LOT_NONE },
{ "oParentRelativePosZ", LVT_F32, offsetof(struct Object, oParentRelativePosZ), false, LOT_NONE },
- { "oPathedPrevWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPathedPrevWaypoint), true, LOT_WAYPOINT },
+ { "oPathedPrevWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPathedPrevWaypoint), false, LOT_WAYPOINT },
{ "oPathedPrevWaypointFlags", LVT_S32, offsetof(struct Object, oPathedPrevWaypointFlags), false, LOT_NONE },
- { "oPathedStartWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPathedStartWaypoint), true, LOT_WAYPOINT },
+ { "oPathedStartWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPathedStartWaypoint), false, LOT_WAYPOINT },
{ "oPathedTargetPitch", LVT_S32, offsetof(struct Object, oPathedTargetPitch), false, LOT_NONE },
{ "oPathedTargetYaw", LVT_S32, offsetof(struct Object, oPathedTargetYaw), false, LOT_NONE },
{ "oPiranhaPlantScale", LVT_F32, offsetof(struct Object, oPiranhaPlantScale), false, LOT_NONE },
@@ -988,10 +988,10 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oPlatformOnTrackIsNotSkiLift", LVT_S16, offsetof(struct Object, oPlatformOnTrackIsNotSkiLift), false, LOT_NONE },
{ "oPlatformOnTrackOffsetY", LVT_F32, offsetof(struct Object, oPlatformOnTrackOffsetY), false, LOT_NONE },
{ "oPlatformOnTrackPitch", LVT_S32, offsetof(struct Object, oPlatformOnTrackPitch), false, LOT_NONE },
- { "oPlatformOnTrackPrevWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPlatformOnTrackPrevWaypoint), true, LOT_WAYPOINT },
+ { "oPlatformOnTrackPrevWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPlatformOnTrackPrevWaypoint), false, LOT_WAYPOINT },
{ "oPlatformOnTrackPrevWaypointFlags", LVT_S32, offsetof(struct Object, oPlatformOnTrackPrevWaypointFlags), false, LOT_NONE },
{ "oPlatformOnTrackSkiLiftRollVel", LVT_F32, offsetof(struct Object, oPlatformOnTrackSkiLiftRollVel), false, LOT_NONE },
- { "oPlatformOnTrackStartWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPlatformOnTrackStartWaypoint), true, LOT_WAYPOINT },
+ { "oPlatformOnTrackStartWaypoint", LVT_COBJECT_P, offsetof(struct Object, oPlatformOnTrackStartWaypoint), false, LOT_WAYPOINT },
{ "oPlatformOnTrackType", LVT_S16, offsetof(struct Object, oPlatformOnTrackType), false, LOT_NONE },
{ "oPlatformOnTrackWasStoodOn", LVT_S16, offsetof(struct Object, oPlatformOnTrackWasStoodOn), false, LOT_NONE },
{ "oPlatformOnTrackYaw", LVT_S32, offsetof(struct Object, oPlatformOnTrackYaw), false, LOT_NONE },
@@ -1004,7 +1004,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oPlatformTimer", LVT_S32, offsetof(struct Object, oPlatformTimer), false, LOT_NONE },
{ "oPlatformUnk10C", LVT_F32, offsetof(struct Object, oPlatformUnk10C), false, LOT_NONE },
{ "oPlatformUnk110", LVT_F32, offsetof(struct Object, oPlatformUnk110), false, LOT_NONE },
- { "oPlatformUnkF8", LVT_COBJECT_P, offsetof(struct Object, oPlatformUnkF8), true, LOT_OBJECT },
+ { "oPlatformUnkF8", LVT_COBJECT_P, offsetof(struct Object, oPlatformUnkF8), false, LOT_OBJECT },
{ "oPlatformUnkFC", LVT_S32, offsetof(struct Object, oPlatformUnkFC), false, LOT_NONE },
{ "oPokeyAliveBodyPartFlags", LVT_U32, offsetof(struct Object, oPokeyAliveBodyPartFlags), false, LOT_NONE },
{ "oPokeyBodyPartBlinkTimer", LVT_S32, offsetof(struct Object, oPokeyBodyPartBlinkTimer), false, LOT_NONE },
@@ -1096,7 +1096,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oStarSelectorType", LVT_S32, offsetof(struct Object, oStarSelectorType), false, LOT_NONE },
{ "oStarSpawnDisFromHome", LVT_F32, offsetof(struct Object, oStarSpawnDisFromHome), false, LOT_NONE },
{ "oStarSpawnUnkFC", LVT_F32, offsetof(struct Object, oStarSpawnUnkFC), false, LOT_NONE },
- { "oStrongWindParticlePenguinObj", LVT_COBJECT_P, offsetof(struct Object, oStrongWindParticlePenguinObj), true, LOT_OBJECT },
+ { "oStrongWindParticlePenguinObj", LVT_COBJECT_P, offsetof(struct Object, oStrongWindParticlePenguinObj), false, LOT_OBJECT },
{ "oSubAction", LVT_S32, offsetof(struct Object, oSubAction), false, LOT_NONE },
{ "oSushiSharkUnkF4", LVT_S32, offsetof(struct Object, oSushiSharkUnkF4), false, LOT_NONE },
{ "oSwingPlatformAngle", LVT_F32, offsetof(struct Object, oSwingPlatformAngle), false, LOT_NONE },
@@ -1238,7 +1238,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oWhitePuffUnkFC", LVT_S32, offsetof(struct Object, oWhitePuffUnkFC), false, LOT_NONE },
{ "oWhompShakeVal", LVT_S32, offsetof(struct Object, oWhompShakeVal), false, LOT_NONE },
{ "oWigglerFallThroughFloorsHeight", LVT_F32, offsetof(struct Object, oWigglerFallThroughFloorsHeight), false, LOT_NONE },
- { "oWigglerSegments", LVT_COBJECT_P, offsetof(struct Object, oWigglerSegments), true, LOT_CHAINSEGMENT },
+ { "oWigglerSegments", LVT_COBJECT_P, offsetof(struct Object, oWigglerSegments), false, LOT_CHAINSEGMENT },
{ "oWigglerSquishSpeed", LVT_F32, offsetof(struct Object, oWigglerSquishSpeed), false, LOT_NONE },
{ "oWigglerTargetYaw", LVT_S32, offsetof(struct Object, oWigglerTargetYaw), false, LOT_NONE },
{ "oWigglerTextStatus", LVT_S16, offsetof(struct Object, oWigglerTextStatus), false, LOT_NONE },
@@ -1254,9 +1254,9 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oYoshiBlinkTimer", LVT_S32, offsetof(struct Object, oYoshiBlinkTimer), false, LOT_NONE },
{ "oYoshiChosenHome", LVT_S32, offsetof(struct Object, oYoshiChosenHome), false, LOT_NONE },
{ "oYoshiTargetYaw", LVT_S32, offsetof(struct Object, oYoshiTargetYaw), false, LOT_NONE },
- { "parentObj", LVT_COBJECT_P, offsetof(struct Object, parentObj), true, LOT_OBJECT },
- { "platform", LVT_COBJECT_P, offsetof(struct Object, platform), true, LOT_OBJECT },
- { "prevObj", LVT_COBJECT_P, offsetof(struct Object, prevObj), true, LOT_OBJECT },
+ { "parentObj", LVT_COBJECT_P, offsetof(struct Object, parentObj), false, LOT_OBJECT },
+ { "platform", LVT_COBJECT_P, offsetof(struct Object, platform), false, LOT_OBJECT },
+ { "prevObj", LVT_COBJECT_P, offsetof(struct Object, prevObj), false, LOT_OBJECT },
// { "ptrData", LOT_???, offsetof(struct Object, ptrData), false, LOT_??? }, <--- UNIMPLEMENTED
// { "rawData", LOT_???, offsetof(struct Object, rawData), false, LOT_??? }, <--- UNIMPLEMENTED
// { "respawnInfo", LVT_???, offsetof(struct Object, respawnInfo), false, LOT_??? }, <--- UNIMPLEMENTED
@@ -1280,16 +1280,16 @@ static struct LuaObjectField sObjectHitboxFields[LUA_OBJECT_HITBOX_FIELD_COUNT]
#define LUA_OBJECT_NODE_FIELD_COUNT 3
static struct LuaObjectField sObjectNodeFields[LUA_OBJECT_NODE_FIELD_COUNT] = {
- { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT },
- { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), true, LOT_OBJECTNODE },
- { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), true, LOT_OBJECTNODE },
+ { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT },
+ { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), false, LOT_OBJECTNODE },
+ { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), false, LOT_OBJECTNODE },
};
#define LUA_OBJECT_WARP_NODE_FIELD_COUNT 3
static struct LuaObjectField sObjectWarpNodeFields[LUA_OBJECT_WARP_NODE_FIELD_COUNT] = {
- { "next", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, next), true, LOT_OBJECTWARPNODE },
- { "node", LVT_COBJECT, offsetof(struct ObjectWarpNode, node), true, LOT_WARPNODE },
- { "object", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, object), true, LOT_OBJECT },
+ { "next", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, next), false, LOT_OBJECTWARPNODE },
+ { "node", LVT_COBJECT, offsetof(struct ObjectWarpNode, node), true, LOT_WARPNODE },
+ { "object", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, object), false, LOT_OBJECT },
};
#define LUA_OFFSET_SIZE_PAIR_FIELD_COUNT 2
@@ -1314,21 +1314,21 @@ static struct LuaObjectField sPlayerCameraStateFields[LUA_PLAYER_CAMERA_STATE_FI
{ "headRotation", LVT_COBJECT, offsetof(struct PlayerCameraState, headRotation), true, LOT_VEC3S },
{ "pos", LVT_COBJECT, offsetof(struct PlayerCameraState, pos), true, LOT_VEC3F },
{ "unused", LVT_S16, offsetof(struct PlayerCameraState, unused), false, LOT_NONE },
- { "usedObj", LVT_COBJECT_P, offsetof(struct PlayerCameraState, usedObj), true, LOT_OBJECT },
+ { "usedObj", LVT_COBJECT_P, offsetof(struct PlayerCameraState, usedObj), false, LOT_OBJECT },
};
#define LUA_PLAYER_GEOMETRY_FIELD_COUNT 13
static struct LuaObjectField sPlayerGeometryFields[LUA_PLAYER_GEOMETRY_FIELD_COUNT] = {
- { "currCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currCeil), true, LOT_SURFACE },
+ { "currCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currCeil), false, LOT_SURFACE },
{ "currCeilHeight", LVT_F32, offsetof(struct PlayerGeometry, currCeilHeight), false, LOT_NONE },
{ "currCeilType", LVT_S16, offsetof(struct PlayerGeometry, currCeilType), false, LOT_NONE },
- { "currFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currFloor), true, LOT_SURFACE },
+ { "currFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currFloor), false, LOT_SURFACE },
{ "currFloorHeight", LVT_F32, offsetof(struct PlayerGeometry, currFloorHeight), false, LOT_NONE },
{ "currFloorType", LVT_S16, offsetof(struct PlayerGeometry, currFloorType), false, LOT_NONE },
- { "prevCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevCeil), true, LOT_SURFACE },
+ { "prevCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevCeil), false, LOT_SURFACE },
{ "prevCeilHeight", LVT_F32, offsetof(struct PlayerGeometry, prevCeilHeight), false, LOT_NONE },
{ "prevCeilType", LVT_S16, offsetof(struct PlayerGeometry, prevCeilType), false, LOT_NONE },
- { "prevFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevFloor), true, LOT_SURFACE },
+ { "prevFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevFloor), false, LOT_SURFACE },
{ "prevFloorHeight", LVT_F32, offsetof(struct PlayerGeometry, prevFloorHeight), false, LOT_NONE },
{ "prevFloorType", LVT_S16, offsetof(struct PlayerGeometry, prevFloorType), false, LOT_NONE },
{ "waterHeight", LVT_F32, offsetof(struct PlayerGeometry, waterHeight), false, LOT_NONE },
@@ -1340,10 +1340,10 @@ static struct LuaObjectField sSpawnInfoFields[LUA_SPAWN_INFO_FIELD_COUNT] = {
{ "areaIndex", LVT_S8, offsetof(struct SpawnInfo, areaIndex), false, LOT_NONE },
{ "behaviorArg", LVT_U32, offsetof(struct SpawnInfo, behaviorArg), false, LOT_NONE },
// { "behaviorScript", LVT_???, offsetof(struct SpawnInfo, behaviorScript), false, LOT_??? }, <--- UNIMPLEMENTED
- { "next", LVT_COBJECT_P, offsetof(struct SpawnInfo, next), true, LOT_SPAWNINFO },
+ { "next", LVT_COBJECT_P, offsetof(struct SpawnInfo, next), false, LOT_SPAWNINFO },
{ "startAngle", LVT_COBJECT, offsetof(struct SpawnInfo, startAngle), true, LOT_VEC3S },
{ "startPos", LVT_COBJECT, offsetof(struct SpawnInfo, startPos), true, LOT_VEC3S },
- { "unk18", LVT_COBJECT_P, offsetof(struct SpawnInfo, unk18), true, LOT_GRAPHNODE },
+ { "unk18", LVT_COBJECT_P, offsetof(struct SpawnInfo, unk18), false, LOT_GRAPHNODE },
};
#define LUA_SPAWN_PARTICLES_INFO_FIELD_COUNT 12
@@ -1375,7 +1375,7 @@ static struct LuaObjectField sSurfaceFields[LUA_SURFACE_FIELD_COUNT] = {
{ "lowerY", LVT_S16, offsetof(struct Surface, lowerY), false, LOT_NONE },
{ "modifiedTimestamp", LVT_U32, offsetof(struct Surface, modifiedTimestamp), false, LOT_NONE },
{ "normal", LVT_COBJECT, offsetof(struct Surface, normal), true, LOT_VEC3F },
- { "object", LVT_COBJECT_P, offsetof(struct Surface, object), true, LOT_OBJECT },
+ { "object", LVT_COBJECT_P, offsetof(struct Surface, object), false, LOT_OBJECT },
{ "originOffset", LVT_F32, offsetof(struct Surface, originOffset), false, LOT_NONE },
{ "prevVertex1", LVT_COBJECT, offsetof(struct Surface, prevVertex1), true, LOT_VEC3S },
{ "prevVertex2", LVT_COBJECT, offsetof(struct Surface, prevVertex2), true, LOT_VEC3S },
diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c
index cc0a882c3..29ac099e1 100644
--- a/src/pc/lua/smlua_constants_autogen.c
+++ b/src/pc/lua/smlua_constants_autogen.c
@@ -1667,6 +1667,63 @@ char gSmluaConstants[] = ""
"NPT_LOCAL = 1\n"
"NPT_SERVER = 2\n"
"NPT_CLIENT = 3\n"
+"ACTIVE_FLAG_DEACTIVATED = 0\n"
+"ACTIVE_FLAG_ACTIVE = (1 << 0)\n"
+"ACTIVE_FLAG_FAR_AWAY = (1 << 1)\n"
+"ACTIVE_FLAG_UNK2 = (1 << 2)\n"
+"ACTIVE_FLAG_IN_DIFFERENT_ROOM = (1 << 3)\n"
+"ACTIVE_FLAG_UNIMPORTANT = (1 << 4)\n"
+"ACTIVE_FLAG_INITIATED_TIME_STOP = (1 << 5)\n"
+"ACTIVE_FLAG_MOVE_THROUGH_GRATE = (1 << 6)\n"
+"ACTIVE_FLAG_DITHERED_ALPHA = (1 << 7)\n"
+"ACTIVE_FLAG_UNK8 = (1 << 8)\n"
+"ACTIVE_FLAG_UNK9 = (1 << 9)\n"
+"ACTIVE_FLAG_UNK10 = (1 << 10)\n"
+"RESPAWN_INFO_TYPE_NULL = 0\n"
+"RESPAWN_INFO_TYPE_32 = 1\n"
+"RESPAWN_INFO_TYPE_16 = 2\n"
+"RESPAWN_INFO_DONT_RESPAWN = 0xFF\n"
+"OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE = (1 << 0)\n"
+"OBJ_FLAG_MOVE_XZ_USING_FVEL = (1 << 1)\n"
+"OBJ_FLAG_MOVE_Y_WITH_TERMINAL_VEL = (1 << 2)\n"
+"OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW = (1 << 3)\n"
+"OBJ_FLAG_SET_FACE_ANGLE_TO_MOVE_ANGLE = (1 << 4)\n"
+"OBJ_FLAG_0020 = (1 << 5)\n"
+"OBJ_FLAG_COMPUTE_DIST_TO_MARIO = (1 << 6)\n"
+"OBJ_FLAG_ACTIVE_FROM_AFAR = (1 << 7)\n"
+"OBJ_FLAG_0100 = (1 << 8)\n"
+"OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT = (1 << 9)\n"
+"OBJ_FLAG_HOLDABLE = (1 << 10)\n"
+"OBJ_FLAG_SET_THROW_MATRIX_FROM_TRANSFORM = (1 << 11)\n"
+"OBJ_FLAG_1000 = (1 << 12)\n"
+"OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO = (1 << 13)\n"
+"OBJ_FLAG_PERSISTENT_RESPAWN = (1 << 14)\n"
+"OBJ_FLAG_8000 = (1 << 15)\n"
+"OBJ_FLAG_30 = (1 << 30)\n"
+"HELD_FREE = 0\n"
+"HELD_HELD = 1\n"
+"HELD_THROWN = 2\n"
+"HELD_DROPPED = 3\n"
+"ACTIVE_PARTICLE_DUST = (1 << 0)\n"
+"ACTIVE_PARTICLE_UNUSED_1 = (1 << 1)\n"
+"ACTIVE_PARTICLE_UNUSED_2 = (1 << 2)\n"
+"ACTIVE_PARTICLE_SPARKLES = (1 << 3)\n"
+"ACTIVE_PARTICLE_H_STAR = (1 << 4)\n"
+"ACTIVE_PARTICLE_BUBBLE = (1 << 5)\n"
+"ACTIVE_PARTICLE_WATER_SPLASH = (1 << 6)\n"
+"ACTIVE_PARTICLE_IDLE_WATER_WAVE = (1 << 7)\n"
+"ACTIVE_PARTICLE_SHALLOW_WATER_WAVE = (1 << 8)\n"
+"ACTIVE_PARTICLE_PLUNGE_BUBBLE = (1 << 9)\n"
+"ACTIVE_PARTICLE_WAVE_TRAIL = (1 << 10)\n"
+"ACTIVE_PARTICLE_FIRE = (1 << 11)\n"
+"ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH = (1 << 12)\n"
+"ACTIVE_PARTICLE_LEAF = (1 << 13)\n"
+"ACTIVE_PARTICLE_DIRT = (1 << 14)\n"
+"ACTIVE_PARTICLE_MIST_CIRCLE = (1 << 15)\n"
+"ACTIVE_PARTICLE_SNOW = (1 << 16)\n"
+"ACTIVE_PARTICLE_BREATH = (1 << 17)\n"
+"ACTIVE_PARTICLE_V_STAR = (1 << 18)\n"
+"ACTIVE_PARTICLE_TRIANGLE = (1 << 19)\n"
"CONT_NO_RESPONSE_ERROR = 0x8\n"
"CONT_OVERRUN_ERROR = 0x4\n"
"CONT_FRAME_ERROR = 0x2\n"
diff --git a/src/pc/lua/smlua_obj_utils.c b/src/pc/lua/smlua_obj_utils.c
index 09dd0238a..387709417 100644
--- a/src/pc/lua/smlua_obj_utils.c
+++ b/src/pc/lua/smlua_obj_utils.c
@@ -43,6 +43,8 @@ static struct Object* spawn_object_internal(enum BehaviorId behaviorId, enum Mod
obj->oHomeY = y;
obj->oHomeZ = z;
+ obj->createdThroughNetwork = true;
+
if (objSetupFunction != 0) {
lua_State* L = gLuaState;
lua_rawgeti(L, LUA_REGISTRYINDEX, objSetupFunction);