diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py index 39bbeed4..aecb692b 100644 --- a/autogen/convert_constants.py +++ b/autogen/convert_constants.py @@ -19,6 +19,8 @@ in_files = [ "src/game/interaction.c", "src/game/interaction.h", "src/pc/djui/djui_hud_utils.h", + "include/behavior_table.h", + "src/pc/lua/smlua_model_utils.h", ] exclude_constants = [ @@ -66,7 +68,7 @@ def process_enum(line): _, ident, val = line.split(' ', 2) if '{' not in val or '}' not in val: - print('UNRECOGNIZED ENUM: ' + line) + #print('UNRECOGNIZED ENUM: ' + line) return None # grab inside body diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py index 7426fcac..254c3430 100644 --- a/autogen/convert_functions.py +++ b/autogen/convert_functions.py @@ -34,6 +34,8 @@ in_files = [ "src/game/sound_init.h", "src/pc/djui/djui_hud_utils.h", "src/pc/network/network_player.h", + "include/behavior_table.h", + "src/pc/lua/smlua_obj_utils.h", ] override_allowed_functions = { diff --git a/docs/lua/constants.md b/docs/lua/constants.md index 9dc02b82..2098035c 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -2,6 +2,8 @@ # Supported Constants - [audio_defines.h](#audio_defines.h) +- [behavior_table.h](#behavior_table.h) + - [BehaviorId](#BehaviorId) - [camera.h](#camera.h) - [characters.h](#characters.h) - [CharacterSound](#CharacterSound) @@ -21,6 +23,8 @@ - [sm64.h](#sm64.h) - [smlua_hooks.h](#smlua_hooks.h) - [LuaHookedEventType](#LuaHookedEventType) +- [smlua_model_utils.h](#smlua_model_utils.h) + - [ModelExtendedId](#ModelExtendedId) - [types.h](#types.h) - [AreaTimerType](#AreaTimerType) - [SpTaskState](#SpTaskState) @@ -504,6 +508,529 @@
+## [behavior_table.h](#behavior_table.h) + +### [enum BehaviorId](#BehaviorId) +| Identifier | Value | +| :--------- | :---- | +| id_bhvStarDoor | 0 | +| id_bhvMrI | 1 | +| id_bhvMrIBody | 2 | +| id_bhvMrIParticle | 3 | +| id_bhvPurpleParticle | 4 | +| id_bhvGiantPole | 5 | +| id_bhvPoleGrabbing | 6 | +| id_bhvThiHugeIslandTop | 7 | +| id_bhvThiTinyIslandTop | 8 | +| id_bhvCapSwitchBase | 9 | +| id_bhvCapSwitch | 10 | +| id_bhvKingBobomb | 11 | +| id_bhvBobombAnchorMario | 12 | +| id_bhvBetaChestBottom | 13 | +| id_bhvBetaChestLid | 14 | +| id_bhvBubbleParticleSpawner | 15 | +| id_bhvBubbleMaybe | 16 | +| id_bhvBubblePlayer | 17 | +| id_bhvSmallWaterWave | 18 | +| id_bhvWaterAirBubble | 19 | +| id_bhvSmallParticle | 20 | +| id_bhvPlungeBubble | 21 | +| id_bhvSmallParticleSnow | 22 | +| id_bhvSmallParticleBubbles | 23 | +| id_bhvFishGroup | 24 | +| id_bhvCannon | 25 | +| id_bhvCannonBarrel | 26 | +| id_bhvCannonBaseUnused | 27 | +| id_bhvChuckya | 28 | +| id_bhvChuckyaAnchorMario | 29 | +| id_bhvUnused05A8 | 30 | +| id_bhvRotatingPlatform | 31 | +| id_bhvTower | 32 | +| id_bhvBulletBillCannon | 33 | +| id_bhvWfBreakableWallRight | 34 | +| id_bhvWfBreakableWallLeft | 35 | +| id_bhvKickableBoard | 36 | +| id_bhvTowerDoor | 37 | +| id_bhvRotatingCounterClockwise | 38 | +| id_bhvWfRotatingWoodenPlatform | 39 | +| id_bhvKoopaShellUnderwater | 40 | +| id_bhvExitPodiumWarp | 41 | +| id_bhvFadingWarp | 42 | +| id_bhvWarp | 43 | +| id_bhvWarpPipe | 44 | +| id_bhvWhitePuffExplosion | 45 | +| id_bhvSpawnedStar | 46 | +| id_bhvSpawnedStarNoLevelExit | 47 | +| id_bhvMrIBlueCoin | 48 | +| id_bhvCoinInsideBoo | 49 | +| id_bhvCoinFormationSpawn | 50 | +| id_bhvCoinFormation | 51 | +| id_bhvOneCoin | 52 | +| id_bhvYellowCoin | 53 | +| id_bhvTemporaryYellowCoin | 54 | +| id_bhvThreeCoinsSpawn | 55 | +| id_bhvTenCoinsSpawn | 56 | +| id_bhvSingleCoinGetsSpawned | 57 | +| id_bhvCoinSparkles | 58 | +| id_bhvGoldenCoinSparkles | 59 | +| id_bhvWallTinyStarParticle | 60 | +| id_bhvVertStarParticleSpawner | 61 | +| id_bhvPoundTinyStarParticle | 62 | +| id_bhvHorStarParticleSpawner | 63 | +| id_bhvPunchTinyTriangle | 64 | +| id_bhvTriangleParticleSpawner | 65 | +| id_bhvDoorWarp | 66 | +| id_bhvDoor | 67 | +| id_bhvGrindel | 68 | +| id_bhvThwomp2 | 69 | +| id_bhvThwomp | 70 | +| id_bhvTumblingBridgePlatform | 71 | +| id_bhvWfTumblingBridge | 72 | +| id_bhvBbhTumblingBridge | 73 | +| id_bhvLllTumblingBridge | 74 | +| id_bhvFlame | 75 | +| id_bhvAnotherElavator | 76 | +| id_bhvRrElevatorPlatform | 77 | +| id_bhvHmcElevatorPlatform | 78 | +| id_bhvWaterMist | 79 | +| id_bhvBreathParticleSpawner | 80 | +| id_bhvBreakBoxTriangle | 81 | +| id_bhvWaterMist2 | 82 | +| id_bhvUnused0DFC | 83 | +| id_bhvMistCircParticleSpawner | 84 | +| id_bhvDirtParticleSpawner | 85 | +| id_bhvSnowParticleSpawner | 86 | +| id_bhvWind | 87 | +| id_bhvEndToad | 88 | +| id_bhvEndPeach | 89 | +| id_bhvUnusedParticleSpawn | 90 | +| id_bhvUkiki | 91 | +| id_bhvUkikiCageChild | 92 | +| id_bhvUkikiCageStar | 93 | +| id_bhvUkikiCage | 94 | +| id_bhvBitfsSinkingPlatforms | 95 | +| id_bhvBitfsSinkingCagePlatform | 96 | +| id_bhvDddMovingPole | 97 | +| id_bhvBitfsTiltingInvertedPyramid | 98 | +| id_bhvSquishablePlatform | 99 | +| id_bhvCutOutObject | 100 | +| id_bhvBetaMovingFlames | 101 | +| id_bhvRrRotatingBridgePlatform | 102 | +| id_bhvFlamethrower | 103 | +| id_bhvFlamethrowerFlame | 104 | +| id_bhvBouncingFireball | 105 | +| id_bhvBouncingFireballFlame | 106 | +| id_bhvBowserShockWave | 107 | +| id_bhvFireParticleSpawner | 108 | +| id_bhvBlackSmokeMario | 109 | +| id_bhvBlackSmokeBowser | 110 | +| id_bhvBlackSmokeUpward | 111 | +| id_bhvBetaFishSplashSpawner | 112 | +| id_bhvSpindrift | 113 | +| id_bhvTowerPlatformGroup | 114 | +| id_bhvWfSlidingTowerPlatform | 115 | +| id_bhvWfElevatorTowerPlatform | 116 | +| id_bhvWfSolidTowerPlatform | 117 | +| id_bhvLeafParticleSpawner | 118 | +| id_bhvTreeSnow | 119 | +| id_bhvTreeLeaf | 120 | +| id_bhvAnotherTiltingPlatform | 121 | +| id_bhvSquarishPathMoving | 122 | +| id_bhvSquarishPathParent | 123 | +| id_bhvPiranhaPlantBubble | 124 | +| id_bhvPiranhaPlantWakingBubbles | 125 | +| id_bhvFloorSwitchAnimatesObject | 126 | +| id_bhvFloorSwitchGrills | 127 | +| id_bhvFloorSwitchHardcodedModel | 128 | +| id_bhvFloorSwitchHiddenObjects | 129 | +| id_bhvHiddenObject | 130 | +| id_bhvBreakableBox | 131 | +| id_bhvPushableMetalBox | 132 | +| id_bhvHeaveHo | 133 | +| id_bhvHeaveHoThrowMario | 134 | +| id_bhvCcmTouchedStarSpawn | 135 | +| id_bhvUnusedPoundablePlatform | 136 | +| id_bhvBetaTrampolineTop | 137 | +| id_bhvBetaTrampolineSpring | 138 | +| id_bhvJumpingBox | 139 | +| id_bhvBooCage | 140 | +| id_bhvStub | 141 | +| id_bhvIgloo | 142 | +| id_bhvBowserKey | 143 | +| id_bhvGrandStar | 144 | +| id_bhvBetaBooKey | 145 | +| id_bhvAlphaBooKey | 146 | +| id_bhvBulletBill | 147 | +| id_bhvWhitePuffSmoke | 148 | +| id_bhvUnused1820 | 149 | +| id_bhvBowserTailAnchor | 150 | +| id_bhvBowser | 151 | +| id_bhvBowserBodyAnchor | 152 | +| id_bhvBowserFlameSpawn | 153 | +| id_bhvTiltingBowserLavaPlatform | 154 | +| id_bhvFallingBowserPlatform | 155 | +| id_bhvBlueBowserFlame | 156 | +| id_bhvFlameFloatingLanding | 157 | +| id_bhvBlueFlamesGroup | 158 | +| id_bhvFlameBouncing | 159 | +| id_bhvFlameMovingForwardGrowing | 160 | +| id_bhvFlameBowser | 161 | +| id_bhvFlameLargeBurningOut | 162 | +| id_bhvBlueFish | 163 | +| id_bhvTankFishGroup | 164 | +| id_bhvCheckerboardElevatorGroup | 165 | +| id_bhvCheckerboardPlatformSub | 166 | +| id_bhvBowserKeyUnlockDoor | 167 | +| id_bhvBowserKeyCourseExit | 168 | +| id_bhvInvisibleObjectsUnderBridge | 169 | +| id_bhvWaterLevelPillar | 170 | +| id_bhvDddWarp | 171 | +| id_bhvMoatGrills | 172 | +| id_bhvClockMinuteHand | 173 | +| id_bhvClockHourHand | 174 | +| id_bhvMacroUkiki | 175 | +| id_bhvStub1D0C | 176 | +| id_bhvLllRotatingHexagonalPlatform | 177 | +| id_bhvLllSinkingRockBlock | 178 | +| id_bhvStub1D70 | 179 | +| id_bhvLllMovingOctagonalMeshPlatform | 180 | +| id_bhvLllRotatingBlockWithFireBars | 181 | +| id_bhvLllRotatingHexFlame | 182 | +| id_bhvLllWoodPiece | 183 | +| id_bhvLllFloatingWoodBridge | 184 | +| id_bhvVolcanoFlames | 185 | +| id_bhvLllRotatingHexagonalRing | 186 | +| id_bhvLllSinkingRectangularPlatform | 187 | +| id_bhvLllSinkingSquarePlatforms | 188 | +| id_bhvLllTiltingInvertedPyramid | 189 | +| id_bhvUnused1F30 | 190 | +| id_bhvKoopaShell | 191 | +| id_bhvKoopaShellFlame | 192 | +| id_bhvToxBox | 193 | +| id_bhvPiranhaPlant | 194 | +| id_bhvLllHexagonalMesh | 195 | +| id_bhvLllBowserPuzzlePiece | 196 | +| id_bhvLllBowserPuzzle | 197 | +| id_bhvTuxiesMother | 198 | +| id_bhvPenguinBaby | 199 | +| id_bhvUnused20E0 | 200 | +| id_bhvSmallPenguin | 201 | +| id_bhvFish2 | 202 | +| id_bhvFish3 | 203 | +| id_bhvLargeFishGroup | 204 | +| id_bhvFish | 205 | +| id_bhvWdwExpressElevator | 206 | +| id_bhvWdwExpressElevatorPlatform | 207 | +| id_bhvChirpChirp | 208 | +| id_bhvBub | 209 | +| id_bhvExclamationBox | 210 | +| id_bhvRotatingExclamationMark | 211 | +| id_bhvSoundSpawner | 212 | +| id_bhvRockSolid | 213 | +| id_bhvBowserSubDoor | 214 | +| id_bhvBowsersSub | 215 | +| id_bhvSushiShark | 216 | +| id_bhvSushiSharkCollisionChild | 217 | +| id_bhvJrbSlidingBox | 218 | +| id_bhvShipPart3 | 219 | +| id_bhvInSunkenShip3 | 220 | +| id_bhvSunkenShipPart | 221 | +| id_bhvSunkenShipPart2 | 222 | +| id_bhvInSunkenShip | 223 | +| id_bhvInSunkenShip2 | 224 | +| id_bhvMistParticleSpawner | 225 | +| id_bhvWhitePuff1 | 226 | +| id_bhvWhitePuff2 | 227 | +| id_bhvWhitePuffSmoke2 | 228 | +| id_bhvPurpleSwitchHiddenBoxes | 229 | +| id_bhvBlueCoinSwitch | 230 | +| id_bhvHiddenBlueCoin | 231 | +| id_bhvOpenableCageDoor | 232 | +| id_bhvOpenableGrill | 233 | +| id_bhvWaterLevelDiamond | 234 | +| id_bhvInitializeChangingWaterLevel | 235 | +| id_bhvTweesterSandParticle | 236 | +| id_bhvTweester | 237 | +| id_bhvMerryGoRoundBooManager | 238 | +| id_bhvAnimatedTexture | 239 | +| id_bhvBooInCastle | 240 | +| id_bhvBooWithCage | 241 | +| id_bhvBalconyBigBoo | 242 | +| id_bhvMerryGoRoundBigBoo | 243 | +| id_bhvGhostHuntBigBoo | 244 | +| id_bhvCourtyardBooTriplet | 245 | +| id_bhvBoo | 246 | +| id_bhvMerryGoRoundBoo | 247 | +| id_bhvGhostHuntBoo | 248 | +| id_bhvHiddenStaircaseStep | 249 | +| id_bhvBooBossSpawnedBridge | 250 | +| id_bhvBbhTiltingTrapPlatform | 251 | +| id_bhvHauntedBookshelf | 252 | +| id_bhvMeshElevator | 253 | +| id_bhvMerryGoRound | 254 | +| id_bhvPlaysMusicTrackWhenTouched | 255 | +| id_bhvBetaBowserAnchor | 256 | +| id_bhvStaticCheckeredPlatform | 257 | +| id_bhvUnused2A10 | 258 | +| id_bhvUnusedFakeStar | 259 | +| id_bhvStaticObject | 260 | +| id_bhvUnused2A54 | 261 | +| id_bhvCastleFloorTrap | 262 | +| id_bhvFloorTrapInCastle | 263 | +| id_bhvTree | 264 | +| id_bhvSparkle | 265 | +| id_bhvSparkleSpawn | 266 | +| id_bhvSparkleParticleSpawner | 267 | +| id_bhvScuttlebug | 268 | +| id_bhvScuttlebugSpawn | 269 | +| id_bhvWhompKingBoss | 270 | +| id_bhvSmallWhomp | 271 | +| id_bhvWaterSplash | 272 | +| id_bhvWaterDroplet | 273 | +| id_bhvWaterDropletSplash | 274 | +| id_bhvBubbleSplash | 275 | +| id_bhvIdleWaterWave | 276 | +| id_bhvObjectWaterSplash | 277 | +| id_bhvShallowWaterWave | 278 | +| id_bhvShallowWaterSplash | 279 | +| id_bhvObjectWaveTrail | 280 | +| id_bhvWaveTrail | 281 | +| id_bhvTinyStrongWindParticle | 282 | +| id_bhvStrongWindParticle | 283 | +| id_bhvSLSnowmanWind | 284 | +| id_bhvSLWalkingPenguin | 285 | +| id_bhvYellowBall | 286 | +| id_bhvMario | 287 | +| id_bhvToadMessage | 288 | +| id_bhvUnlockDoorStar | 289 | +| id_bhvRandomAnimatedTexture | 290 | +| id_bhvYellowBackgroundInMenu | 291 | +| id_bhvMenuButton | 292 | +| id_bhvMenuButtonManager | 293 | +| id_bhvActSelectorStarType | 294 | +| id_bhvActSelector | 295 | +| id_bhvMovingYellowCoin | 296 | +| id_bhvMovingBlueCoin | 297 | +| id_bhvBlueCoinSliding | 298 | +| id_bhvBlueCoinJumping | 299 | +| id_bhvSeaweed | 300 | +| id_bhvSeaweedBundle | 301 | +| id_bhvBobomb | 302 | +| id_bhvBobombFuseSmoke | 303 | +| id_bhvBobombBuddy | 304 | +| id_bhvBobombBuddyOpensCannon | 305 | +| id_bhvCannonClosed | 306 | +| id_bhvWhirlpool | 307 | +| id_bhvJetStream | 308 | +| id_bhvMessagePanel | 309 | +| id_bhvSignOnWall | 310 | +| id_bhvHomingAmp | 311 | +| id_bhvCirclingAmp | 312 | +| id_bhvButterfly | 313 | +| id_bhvHoot | 314 | +| id_bhvBetaHoldableObject | 315 | +| id_bhvCarrySomething1 | 316 | +| id_bhvCarrySomething2 | 317 | +| id_bhvCarrySomething3 | 318 | +| id_bhvCarrySomething4 | 319 | +| id_bhvCarrySomething5 | 320 | +| id_bhvCarrySomething6 | 321 | +| id_bhvObjectBubble | 322 | +| id_bhvObjectWaterWave | 323 | +| id_bhvExplosion | 324 | +| id_bhvBobombBullyDeathSmoke | 325 | +| id_bhvSmoke | 326 | +| id_bhvBobombExplosionBubble | 327 | +| id_bhvRespawner | 328 | +| id_bhvSmallBully | 329 | +| id_bhvBigBully | 330 | +| id_bhvBigBullyWithMinions | 331 | +| id_bhvSmallChillBully | 332 | +| id_bhvBigChillBully | 333 | +| id_bhvJetStreamRingSpawner | 334 | +| id_bhvJetStreamWaterRing | 335 | +| id_bhvMantaRayWaterRing | 336 | +| id_bhvMantaRayRingManager | 337 | +| id_bhvBowserBomb | 338 | +| id_bhvBowserBombExplosion | 339 | +| id_bhvBowserBombSmoke | 340 | +| id_bhvCelebrationStar | 341 | +| id_bhvCelebrationStarSparkle | 342 | +| id_bhvStarKeyCollectionPuffSpawner | 343 | +| id_bhvLllDrawbridgeSpawner | 344 | +| id_bhvLllDrawbridge | 345 | +| id_bhvSmallBomp | 346 | +| id_bhvLargeBomp | 347 | +| id_bhvWfSlidingPlatform | 348 | +| id_bhvMoneybag | 349 | +| id_bhvMoneybagHidden | 350 | +| id_bhvPitBowlingBall | 351 | +| id_bhvFreeBowlingBall | 352 | +| id_bhvBowlingBall | 353 | +| id_bhvTtmBowlingBallSpawner | 354 | +| id_bhvBobBowlingBallSpawner | 355 | +| id_bhvThiBowlingBallSpawner | 356 | +| id_bhvRrCruiserWing | 357 | +| id_bhvSpindel | 358 | +| id_bhvSslMovingPyramidWall | 359 | +| id_bhvPyramidElevator | 360 | +| id_bhvPyramidElevatorTrajectoryMarkerBall | 361 | +| id_bhvPyramidTop | 362 | +| id_bhvPyramidTopFragment | 363 | +| id_bhvPyramidPillarTouchDetector | 364 | +| id_bhvWaterfallSoundLoop | 365 | +| id_bhvVolcanoSoundLoop | 366 | +| id_bhvCastleFlagWaving | 367 | +| id_bhvBirdsSoundLoop | 368 | +| id_bhvAmbientSounds | 369 | +| id_bhvSandSoundLoop | 370 | +| id_bhvHiddenAt120Stars | 371 | +| id_bhvSnowmansBottom | 372 | +| id_bhvSnowmansHead | 373 | +| id_bhvSnowmansBodyCheckpoint | 374 | +| id_bhvBigSnowmanWhole | 375 | +| id_bhvBigBoulder | 376 | +| id_bhvBigBoulderGenerator | 377 | +| id_bhvWingCap | 378 | +| id_bhvMetalCap | 379 | +| id_bhvNormalCap | 380 | +| id_bhvVanishCap | 381 | +| id_bhvStar | 382 | +| id_bhvStarSpawnCoordinates | 383 | +| id_bhvHiddenRedCoinStar | 384 | +| id_bhvRedCoin | 385 | +| id_bhvBowserCourseRedCoinStar | 386 | +| id_bhvHiddenStar | 387 | +| id_bhvHiddenStarTrigger | 388 | +| id_bhvTtmRollingLog | 389 | +| id_bhvLllVolcanoFallingTrap | 390 | +| id_bhvLllRollingLog | 391 | +| id_bhv1upWalking | 392 | +| id_bhv1upRunningAway | 393 | +| id_bhv1upSliding | 394 | +| id_bhv1Up | 395 | +| id_bhv1upJumpOnApproach | 396 | +| id_bhvHidden1up | 397 | +| id_bhvHidden1upTrigger | 398 | +| id_bhvHidden1upInPole | 399 | +| id_bhvHidden1upInPoleTrigger | 400 | +| id_bhvHidden1upInPoleSpawner | 401 | +| id_bhvControllablePlatform | 402 | +| id_bhvControllablePlatformSub | 403 | +| id_bhvBreakableBoxSmall | 404 | +| id_bhvSlidingSnowMound | 405 | +| id_bhvSnowMoundSpawn | 406 | +| id_bhvWdwSquareFloatingPlatform | 407 | +| id_bhvWdwRectangularFloatingPlatform | 408 | +| id_bhvJrbFloatingPlatform | 409 | +| id_bhvArrowLift | 410 | +| id_bhvOrangeNumber | 411 | +| id_bhvMantaRay | 412 | +| id_bhvFallingPillar | 413 | +| id_bhvFallingPillarHitbox | 414 | +| id_bhvPillarBase | 415 | +| id_bhvJrbFloatingBox | 416 | +| id_bhvDecorativePendulum | 417 | +| id_bhvTreasureChestsShip | 418 | +| id_bhvTreasureChestsJrb | 419 | +| id_bhvTreasureChests | 420 | +| id_bhvTreasureChestBottom | 421 | +| id_bhvTreasureChestTop | 422 | +| id_bhvMips | 423 | +| id_bhvYoshi | 424 | +| id_bhvKoopa | 425 | +| id_bhvKoopaRaceEndpoint | 426 | +| id_bhvKoopaFlag | 427 | +| id_bhvPokey | 428 | +| id_bhvPokeyBodyPart | 429 | +| id_bhvSwoop | 430 | +| id_bhvFlyGuy | 431 | +| id_bhvGoomba | 432 | +| id_bhvGoombaTripletSpawner | 433 | +| id_bhvChainChomp | 434 | +| id_bhvChainChompChainPart | 435 | +| id_bhvWoodenPost | 436 | +| id_bhvChainChompGate | 437 | +| id_bhvWigglerHead | 438 | +| id_bhvWigglerBody | 439 | +| id_bhvEnemyLakitu | 440 | +| id_bhvCameraLakitu | 441 | +| id_bhvCloud | 442 | +| id_bhvCloudPart | 443 | +| id_bhvSpiny | 444 | +| id_bhvMontyMole | 445 | +| id_bhvMontyMoleHole | 446 | +| id_bhvMontyMoleRock | 447 | +| id_bhvPlatformOnTrack | 448 | +| id_bhvTrackBall | 449 | +| id_bhvSeesawPlatform | 450 | +| id_bhvFerrisWheelAxle | 451 | +| id_bhvFerrisWheelPlatform | 452 | +| id_bhvWaterBombSpawner | 453 | +| id_bhvWaterBomb | 454 | +| id_bhvWaterBombShadow | 455 | +| id_bhvTTCRotatingSolid | 456 | +| id_bhvTTCPendulum | 457 | +| id_bhvTTCTreadmill | 458 | +| id_bhvTTCMovingBar | 459 | +| id_bhvTTCCog | 460 | +| id_bhvTTCPitBlock | 461 | +| id_bhvTTCElevator | 462 | +| id_bhvTTC2DRotator | 463 | +| id_bhvTTCSpinner | 464 | +| id_bhvMrBlizzard | 465 | +| id_bhvMrBlizzardSnowball | 466 | +| id_bhvSlidingPlatform2 | 467 | +| id_bhvOctagonalPlatformRotating | 468 | +| id_bhvAnimatesOnFloorSwitchPress | 469 | +| id_bhvActivatedBackAndForthPlatform | 470 | +| id_bhvRecoveryHeart | 471 | +| id_bhvWaterBombCannon | 472 | +| id_bhvCannonBarrelBubbles | 473 | +| id_bhvUnagi | 474 | +| id_bhvUnagiSubobject | 475 | +| id_bhvDorrie | 476 | +| id_bhvHauntedChair | 477 | +| id_bhvMadPiano | 478 | +| id_bhvFlyingBookend | 479 | +| id_bhvBookendSpawn | 480 | +| id_bhvHauntedBookshelfManager | 481 | +| id_bhvBookSwitch | 482 | +| id_bhvFirePiranhaPlant | 483 | +| id_bhvSmallPiranhaFlame | 484 | +| id_bhvFireSpitter | 485 | +| id_bhvFlyguyFlame | 486 | +| id_bhvSnufit | 487 | +| id_bhvSnufitBalls | 488 | +| id_bhvHorizontalGrindel | 489 | +| id_bhvEyerokBoss | 490 | +| id_bhvEyerokHand | 491 | +| id_bhvKlepto | 492 | +| id_bhvBird | 493 | +| id_bhvRacingPenguin | 494 | +| id_bhvPenguinRaceFinishLine | 495 | +| id_bhvPenguinRaceShortcutCheck | 496 | +| id_bhvCoffinSpawner | 497 | +| id_bhvCoffin | 498 | +| id_bhvClamShell | 499 | +| id_bhvSkeeter | 500 | +| id_bhvSkeeterWave | 501 | +| id_bhvSwingPlatform | 502 | +| id_bhvDonutPlatformSpawner | 503 | +| id_bhvDonutPlatform | 504 | +| id_bhvDDDPole | 505 | +| id_bhvRedCoinStarMarker | 506 | +| id_bhvTripletButterfly | 507 | +| id_bhvBubba | 508 | +| id_bhvBeginningLakitu | 509 | +| id_bhvBeginningPeach | 510 | +| id_bhvEndBirds1 | 511 | +| id_bhvEndBirds2 | 512 | +| id_bhvIntroScene | 513 | +| id_bhv_max_count | 514 | + +
+ ## [camera.h](#camera.h) - CAMERA_MODE_8_DIRECTIONS - CAMERA_MODE_BEHIND_MARIO @@ -1523,6 +2050,191 @@
+## [smlua_model_utils.h](#smlua_model_utils.h) + +### [enum ModelExtendedId](#ModelExtendedId) +| Identifier | Value | +| :--------- | :---- | +| E_MODEL_MARIO | 0 | +| E_MODEL_SMOKE | 1 | +| E_MODEL_SPARKLES | 2 | +| E_MODEL_BUBBLE | 3 | +| E_MODEL_SMALL_WATER_SPLASH | 4 | +| E_MODEL_IDLE_WATER_WAVE | 5 | +| E_MODEL_WATER_SPLASH | 6 | +| E_MODEL_WAVE_TRAIL | 7 | +| E_MODEL_YELLOW_COIN | 8 | +| E_MODEL_STAR | 9 | +| E_MODEL_TRANSPARENT_STAR | 10 | +| E_MODEL_WOODEN_SIGNPOST | 11 | +| E_MODEL_WHITE_PARTICLE_SMALL | 12 | +| E_MODEL_RED_FLAME | 13 | +| E_MODEL_BLUE_FLAME | 14 | +| E_MODEL_BURN_SMOKE | 15 | +| E_MODEL_LEAVES | 16 | +| E_MODEL_PURPLE_MARBLE | 17 | +| E_MODEL_FISH | 18 | +| E_MODEL_FISH_SHADOW | 19 | +| E_MODEL_SPARKLES_ANIMATION | 20 | +| E_MODEL_SAND_DUST | 21 | +| E_MODEL_BUTTERFLY | 22 | +| E_MODEL_BURN_SMOKE_UNUSED | 23 | +| E_MODEL_PEBBLE | 24 | +| E_MODEL_MIST | 25 | +| E_MODEL_WHITE_PUFF | 26 | +| E_MODEL_WHITE_PARTICLE_DL | 27 | +| E_MODEL_WHITE_PARTICLE | 28 | +| E_MODEL_YELLOW_COIN_NO_SHADOW | 29 | +| E_MODEL_BLUE_COIN | 30 | +| E_MODEL_BLUE_COIN_NO_SHADOW | 31 | +| E_MODEL_MARIOS_WINGED_METAL_CAP | 32 | +| E_MODEL_MARIOS_METAL_CAP | 33 | +| E_MODEL_MARIOS_WING_CAP | 34 | +| E_MODEL_MARIOS_CAP | 35 | +| E_MODEL_MARIOS_CAP2 | 36 | +| E_MODEL_BOWSER_KEY_CUTSCENE | 37 | +| E_MODEL_BOWSER_KEY | 38 | +| E_MODEL_RED_FLAME_SHADOW | 39 | +| E_MODEL_1UP | 40 | +| E_MODEL_RED_COIN | 41 | +| E_MODEL_RED_COIN_NO_SHADOW | 42 | +| E_MODEL_NUMBER | 43 | +| E_MODEL_EXPLOSION | 44 | +| E_MODEL_DIRT_ANIMATION | 45 | +| E_MODEL_CARTOON_STAR | 46 | +| E_MODEL_BLUE_COIN_SWITCH | 47 | +| E_MODEL_AMP | 48 | +| E_MODEL_PURPLE_SWITCH | 49 | +| E_MODEL_CHECKERBOARD_PLATFORM | 50 | +| E_MODEL_BREAKABLE_BOX | 51 | +| E_MODEL_BREAKABLE_BOX_SMALL | 52 | +| E_MODEL_EXCLAMATION_BOX_OUTLINE | 53 | +| E_MODEL_EXCLAMATION_BOX | 54 | +| E_MODEL_GOOMBA | 55 | +| E_MODEL_EXCLAMATION_POINT | 56 | +| E_MODEL_KOOPA_SHELL | 57 | +| E_MODEL_METAL_BOX | 58 | +| E_MODEL_METAL_BOX_DL | 59 | +| E_MODEL_BLACK_BOBOMB | 60 | +| E_MODEL_BOBOMB_BUDDY | 61 | +| E_MODEL_DL_CANNON_LID | 62 | +| E_MODEL_BOWLING_BALL | 63 | +| E_MODEL_CANNON_BARREL | 64 | +| E_MODEL_CANNON_BASE | 65 | +| E_MODEL_HEART | 66 | +| E_MODEL_FLYGUY | 67 | +| E_MODEL_CHUCKYA | 68 | +| E_MODEL_TRAJECTORY_MARKER_BALL | 69 | +| E_MODEL_BULLET_BILL | 70 | +| E_MODEL_YELLOW_SPHERE | 71 | +| E_MODEL_HOOT | 72 | +| E_MODEL_YOSHI_EGG | 73 | +| E_MODEL_THWOMP | 74 | +| E_MODEL_HEAVE_HO | 75 | +| E_MODEL_BLARGG | 76 | +| E_MODEL_BULLY | 77 | +| E_MODEL_BULLY_BOSS | 78 | +| E_MODEL_WATER_BOMB | 79 | +| E_MODEL_WATER_BOMB_SHADOW | 80 | +| E_MODEL_KING_BOBOMB | 81 | +| E_MODEL_MANTA_RAY | 82 | +| E_MODEL_UNAGI | 83 | +| E_MODEL_SUSHI | 84 | +| E_MODEL_DL_WHIRLPOOL | 85 | +| E_MODEL_CLAM_SHELL | 86 | +| E_MODEL_POKEY_HEAD | 87 | +| E_MODEL_POKEY_BODY_PART | 88 | +| E_MODEL_TWEESTER | 89 | +| E_MODEL_KLEPTO | 90 | +| E_MODEL_EYEROK_LEFT_HAND | 91 | +| E_MODEL_EYEROK_RIGHT_HAND | 92 | +| E_MODEL_DL_MONTY_MOLE_HOLE | 93 | +| E_MODEL_MONTY_MOLE | 94 | +| E_MODEL_UKIKI | 95 | +| E_MODEL_FWOOSH | 96 | +| E_MODEL_SPINDRIFT | 97 | +| E_MODEL_MR_BLIZZARD_HIDDEN | 98 | +| E_MODEL_MR_BLIZZARD | 99 | +| E_MODEL_PENGUIN | 100 | +| E_MODEL_CAP_SWITCH_EXCLAMATION | 101 | +| E_MODEL_CAP_SWITCH | 102 | +| E_MODEL_CAP_SWITCH_BASE | 103 | +| E_MODEL_BOO | 104 | +| E_MODEL_BETA_BOO_KEY | 105 | +| E_MODEL_HAUNTED_CHAIR | 106 | +| E_MODEL_MAD_PIANO | 107 | +| E_MODEL_BOOKEND_PART | 108 | +| E_MODEL_BOOKEND | 109 | +| E_MODEL_HAUNTED_CAGE | 110 | +| E_MODEL_BIRDS | 111 | +| E_MODEL_PEACH | 112 | +| E_MODEL_YOSHI | 113 | +| E_MODEL_ENEMY_LAKITU | 114 | +| E_MODEL_SPINY_BALL | 115 | +| E_MODEL_SPINY | 116 | +| E_MODEL_WIGGLER_HEAD | 117 | +| E_MODEL_WIGGLER_BODY | 118 | +| E_MODEL_BUBBA | 119 | +| E_MODEL_BOWSER | 120 | +| E_MODEL_BOWSER_BOMB_CHILD_OBJ | 121 | +| E_MODEL_BOWSER_BOMB | 122 | +| E_MODEL_BOWSER_SMOKE | 123 | +| E_MODEL_BOWSER_FLAMES | 124 | +| E_MODEL_BOWSER_WAVE | 125 | +| E_MODEL_BOWSER2 | 126 | +| E_MODEL_BUB | 127 | +| E_MODEL_TREASURE_CHEST_BASE | 128 | +| E_MODEL_TREASURE_CHEST_LID | 129 | +| E_MODEL_CYAN_FISH | 130 | +| E_MODEL_WATER_RING | 131 | +| E_MODEL_WATER_MINE | 132 | +| E_MODEL_SEAWEED | 133 | +| E_MODEL_SKEETER | 134 | +| E_MODEL_PIRANHA_PLANT | 135 | +| E_MODEL_WHOMP | 136 | +| E_MODEL_KOOPA_WITH_SHELL | 137 | +| E_MODEL_KOOPA_WITHOUT_SHELL | 138 | +| E_MODEL_METALLIC_BALL | 139 | +| E_MODEL_CHAIN_CHOMP | 140 | +| E_MODEL_KOOPA_FLAG | 141 | +| E_MODEL_WOODEN_POST | 142 | +| E_MODEL_MIPS | 143 | +| E_MODEL_BOO_CASTLE | 144 | +| E_MODEL_LAKITU | 145 | +| E_MODEL_TOAD | 146 | +| E_MODEL_CHILL_BULLY | 147 | +| E_MODEL_BIG_CHILL_BULLY | 148 | +| E_MODEL_MONEYBAG | 149 | +| E_MODEL_SWOOP | 150 | +| E_MODEL_SCUTTLEBUG | 151 | +| E_MODEL_MR_I_IRIS | 152 | +| E_MODEL_MR_I | 153 | +| E_MODEL_DORRIE | 154 | +| E_MODEL_SNUFIT | 155 | +| E_MODEL_BUBBLE_PLAYER | 156 | +| E_MODEL_LUIGI | 157 | +| E_MODEL_LUIGIS_CAP | 158 | +| E_MODEL_LUIGIS_METAL_CAP | 159 | +| E_MODEL_LUIGIS_WING_CAP | 160 | +| E_MODEL_LUIGIS_WINGED_METAL_CAP | 161 | +| E_MODEL_TOAD_PLAYER | 162 | +| E_MODEL_TOADS_CAP | 163 | +| E_MODEL_TOADS_METAL_CAP | 164 | +| E_MODEL_TOADS_WING_CAP | 165 | +| E_MODEL_WALUIGI | 166 | +| E_MODEL_WALUIGIS_CAP | 167 | +| E_MODEL_WALUIGIS_METAL_CAP | 168 | +| E_MODEL_WALUIGIS_WING_CAP | 169 | +| E_MODEL_WALUIGIS_WINGED_METAL_CAP | 170 | +| E_MODEL_WARIO | 171 | +| E_MODEL_WARIOS_CAP | 172 | +| E_MODEL_WARIOS_METAL_CAP | 173 | +| E_MODEL_WARIOS_WING_CAP | 174 | +| E_MODEL_WARIOS_WINGED_METAL_CAP | 175 | +| E_MODEL_MAX | 176 | + +
+ ## [types.h](#types.h) - ANIM_FLAG_2 - ANIM_FLAG_5 diff --git a/docs/lua/functions.md b/docs/lua/functions.md index d828bcfc..65f4ee43 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -1,6 +1,10 @@ ## [:rewind: Lua Reference](lua.md) # Supported Functions +- behavior_table.h + +
+ - camera.h - [set_camera_pitch_shake](#set_camera_pitch_shake) - [set_camera_roll_shake](#set_camera_roll_shake) @@ -305,6 +309,11 @@
+- smlua_obj_utils.h + - [spawn_object_sync](#spawn_object_sync) + +
+ - sound_init.h - [disable_background_sound](#disable_background_sound) - [enable_background_sound](#enable_background_sound) @@ -342,6 +351,12 @@
+--- +# functions from behavior_table.h + +
+ + --- # functions from camera.h @@ -5092,6 +5107,36 @@
+--- +# functions from smlua_obj_utils.h + +
+ + +## [spawn_object_sync](#spawn_object_sync) + +### Lua Example +`local ObjectValue = spawn_object_sync(behaviorId, modelId, x, y, z)` + +### Parameters +| Field | Type | +| ----- | ---- | +| behaviorId | integer | +| modelId | integer | +| x | number | +| y | number | +| z | number | + +### Returns +[Object](structs.md#Object) + +### C Prototype +`struct Object* spawn_object_sync(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z);` + +[:arrow_up_small:](#) + +
+ --- # functions from sound_init.h diff --git a/include/behavior_table.h b/include/behavior_table.h index 142df2f9..8a20092b 100644 --- a/include/behavior_table.h +++ b/include/behavior_table.h @@ -523,7 +523,6 @@ enum BehaviorId { id_bhv_max_count // must be the last in the list }; - enum BehaviorId get_id_from_behavior(const BehaviorScript* behavior); const BehaviorScript* get_behavior_from_id(enum BehaviorId id); diff --git a/src/engine/level_script.c b/src/engine/level_script.c index c25dffed..da78d493 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -23,6 +23,7 @@ #include "surface_collision.h" #include "surface_load.h" #include "level_table.h" +#include "src/pc/lua/smlua_model_utils.h" #define CMD_GET(type, offset) (*(type *) (CMD_PROCESS_OFFSET(offset) + (u8 *) sCurrentCmd)) @@ -304,6 +305,8 @@ static void level_cmd_init_level(void) { clear_objects(); clear_areas(); main_pool_push_state(); + smlua_model_util_clear(); + sCurrentCmd = CMD_NEXT; } @@ -382,6 +385,7 @@ static void level_cmd_load_model_from_dl(void) { if (val1 < 256) { gLoadedGraphNodes[val1] = (struct GraphNode *) init_graph_node_display_list(sLevelPool, 0, val2, val3); + smlua_model_util_remember(val1, val2, val3); } sCurrentCmd = CMD_NEXT; @@ -393,6 +397,7 @@ static void level_cmd_load_model_from_geo(void) { if (arg0 < 256) { gLoadedGraphNodes[arg0] = process_geo_layout(sLevelPool, arg1); + smlua_model_util_remember(arg0, LAYER_OPAQUE, arg1); } sCurrentCmd = CMD_NEXT; @@ -419,6 +424,7 @@ static void level_cmd_23(void) { // is being stored to the array, so cast the pointer. gLoadedGraphNodes[model] = (struct GraphNode *) init_graph_node_scale(sLevelPool, 0, arg0H, arg1, arg2.f); + smlua_model_util_remember(model, arg0H, arg1); } sCurrentCmd = CMD_NEXT; diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index 1ad739b8..d193febe 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -11,6 +11,7 @@ #include "src/game/object_helpers.h" #include "include/object_fields.h" + #define LUA_ANIM_INFO_FIELD_COUNT 11 static struct LuaObjectField sAnimInfoFields[LUA_ANIM_INFO_FIELD_COUNT] = { { "animAccel", LVT_S32, offsetof(struct AnimInfo, animAccel), false, LOT_NONE }, diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index 40a8b32d..b1e22e2a 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -618,6 +618,521 @@ char gSmluaConstants[] = "" "SOUND_OBJ2_MONTY_MOLE_APPEAR = SOUND_ARG_LOAD(9, 0, 0x67, 0x80, 8)\n" "SOUND_OBJ2_BOSS_DIALOG_GRUNT = SOUND_ARG_LOAD(9, 0, 0x69, 0x40, 8)\n" "SOUND_OBJ2_MRI_SPINNING = SOUND_ARG_LOAD(9, 0, 0x6B, 0x00, 8)\n" +"id_bhvStarDoor = 0\n" +"id_bhvMrI = 1\n" +"id_bhvMrIBody = 2\n" +"id_bhvMrIParticle = 3\n" +"id_bhvPurpleParticle = 4\n" +"id_bhvGiantPole = 5\n" +"id_bhvPoleGrabbing = 6\n" +"id_bhvThiHugeIslandTop = 7\n" +"id_bhvThiTinyIslandTop = 8\n" +"id_bhvCapSwitchBase = 9\n" +"id_bhvCapSwitch = 10\n" +"id_bhvKingBobomb = 11\n" +"id_bhvBobombAnchorMario = 12\n" +"id_bhvBetaChestBottom = 13\n" +"id_bhvBetaChestLid = 14\n" +"id_bhvBubbleParticleSpawner = 15\n" +"id_bhvBubbleMaybe = 16\n" +"id_bhvBubblePlayer = 17\n" +"id_bhvSmallWaterWave = 18\n" +"id_bhvWaterAirBubble = 19\n" +"id_bhvSmallParticle = 20\n" +"id_bhvPlungeBubble = 21\n" +"id_bhvSmallParticleSnow = 22\n" +"id_bhvSmallParticleBubbles = 23\n" +"id_bhvFishGroup = 24\n" +"id_bhvCannon = 25\n" +"id_bhvCannonBarrel = 26\n" +"id_bhvCannonBaseUnused = 27\n" +"id_bhvChuckya = 28\n" +"id_bhvChuckyaAnchorMario = 29\n" +"id_bhvUnused05A8 = 30\n" +"id_bhvRotatingPlatform = 31\n" +"id_bhvTower = 32\n" +"id_bhvBulletBillCannon = 33\n" +"id_bhvWfBreakableWallRight = 34\n" +"id_bhvWfBreakableWallLeft = 35\n" +"id_bhvKickableBoard = 36\n" +"id_bhvTowerDoor = 37\n" +"id_bhvRotatingCounterClockwise = 38\n" +"id_bhvWfRotatingWoodenPlatform = 39\n" +"id_bhvKoopaShellUnderwater = 40\n" +"id_bhvExitPodiumWarp = 41\n" +"id_bhvFadingWarp = 42\n" +"id_bhvWarp = 43\n" +"id_bhvWarpPipe = 44\n" +"id_bhvWhitePuffExplosion = 45\n" +"id_bhvSpawnedStar = 46\n" +"id_bhvSpawnedStarNoLevelExit = 47\n" +"id_bhvMrIBlueCoin = 48\n" +"id_bhvCoinInsideBoo = 49\n" +"id_bhvCoinFormationSpawn = 50\n" +"id_bhvCoinFormation = 51\n" +"id_bhvOneCoin = 52\n" +"id_bhvYellowCoin = 53\n" +"id_bhvTemporaryYellowCoin = 54\n" +"id_bhvThreeCoinsSpawn = 55\n" +"id_bhvTenCoinsSpawn = 56\n" +"id_bhvSingleCoinGetsSpawned = 57\n" +"id_bhvCoinSparkles = 58\n" +"id_bhvGoldenCoinSparkles = 59\n" +"id_bhvWallTinyStarParticle = 60\n" +"id_bhvVertStarParticleSpawner = 61\n" +"id_bhvPoundTinyStarParticle = 62\n" +"id_bhvHorStarParticleSpawner = 63\n" +"id_bhvPunchTinyTriangle = 64\n" +"id_bhvTriangleParticleSpawner = 65\n" +"id_bhvDoorWarp = 66\n" +"id_bhvDoor = 67\n" +"id_bhvGrindel = 68\n" +"id_bhvThwomp2 = 69\n" +"id_bhvThwomp = 70\n" +"id_bhvTumblingBridgePlatform = 71\n" +"id_bhvWfTumblingBridge = 72\n" +"id_bhvBbhTumblingBridge = 73\n" +"id_bhvLllTumblingBridge = 74\n" +"id_bhvFlame = 75\n" +"id_bhvAnotherElavator = 76\n" +"id_bhvRrElevatorPlatform = 77\n" +"id_bhvHmcElevatorPlatform = 78\n" +"id_bhvWaterMist = 79\n" +"id_bhvBreathParticleSpawner = 80\n" +"id_bhvBreakBoxTriangle = 81\n" +"id_bhvWaterMist2 = 82\n" +"id_bhvUnused0DFC = 83\n" +"id_bhvMistCircParticleSpawner = 84\n" +"id_bhvDirtParticleSpawner = 85\n" +"id_bhvSnowParticleSpawner = 86\n" +"id_bhvWind = 87\n" +"id_bhvEndToad = 88\n" +"id_bhvEndPeach = 89\n" +"id_bhvUnusedParticleSpawn = 90\n" +"id_bhvUkiki = 91\n" +"id_bhvUkikiCageChild = 92\n" +"id_bhvUkikiCageStar = 93\n" +"id_bhvUkikiCage = 94\n" +"id_bhvBitfsSinkingPlatforms = 95\n" +"id_bhvBitfsSinkingCagePlatform = 96\n" +"id_bhvDddMovingPole = 97\n" +"id_bhvBitfsTiltingInvertedPyramid = 98\n" +"id_bhvSquishablePlatform = 99\n" +"id_bhvCutOutObject = 100\n" +"id_bhvBetaMovingFlames = 101\n" +"id_bhvRrRotatingBridgePlatform = 102\n" +"id_bhvFlamethrower = 103\n" +"id_bhvFlamethrowerFlame = 104\n" +"id_bhvBouncingFireball = 105\n" +"id_bhvBouncingFireballFlame = 106\n" +"id_bhvBowserShockWave = 107\n" +"id_bhvFireParticleSpawner = 108\n" +"id_bhvBlackSmokeMario = 109\n" +"id_bhvBlackSmokeBowser = 110\n" +"id_bhvBlackSmokeUpward = 111\n" +"id_bhvBetaFishSplashSpawner = 112\n" +"id_bhvSpindrift = 113\n" +"id_bhvTowerPlatformGroup = 114\n" +"id_bhvWfSlidingTowerPlatform = 115\n" +"id_bhvWfElevatorTowerPlatform = 116\n" +"id_bhvWfSolidTowerPlatform = 117\n" +"id_bhvLeafParticleSpawner = 118\n" +"id_bhvTreeSnow = 119\n" +"id_bhvTreeLeaf = 120\n" +"id_bhvAnotherTiltingPlatform = 121\n" +"id_bhvSquarishPathMoving = 122\n" +"id_bhvSquarishPathParent = 123\n" +"id_bhvPiranhaPlantBubble = 124\n" +"id_bhvPiranhaPlantWakingBubbles = 125\n" +"id_bhvFloorSwitchAnimatesObject = 126\n" +"id_bhvFloorSwitchGrills = 127\n" +"id_bhvFloorSwitchHardcodedModel = 128\n" +"id_bhvFloorSwitchHiddenObjects = 129\n" +"id_bhvHiddenObject = 130\n" +"id_bhvBreakableBox = 131\n" +"id_bhvPushableMetalBox = 132\n" +"id_bhvHeaveHo = 133\n" +"id_bhvHeaveHoThrowMario = 134\n" +"id_bhvCcmTouchedStarSpawn = 135\n" +"id_bhvUnusedPoundablePlatform = 136\n" +"id_bhvBetaTrampolineTop = 137\n" +"id_bhvBetaTrampolineSpring = 138\n" +"id_bhvJumpingBox = 139\n" +"id_bhvBooCage = 140\n" +"id_bhvStub = 141\n" +"id_bhvIgloo = 142\n" +"id_bhvBowserKey = 143\n" +"id_bhvGrandStar = 144\n" +"id_bhvBetaBooKey = 145\n" +"id_bhvAlphaBooKey = 146\n" +"id_bhvBulletBill = 147\n" +"id_bhvWhitePuffSmoke = 148\n" +"id_bhvUnused1820 = 149\n" +"id_bhvBowserTailAnchor = 150\n" +"id_bhvBowser = 151\n" +"id_bhvBowserBodyAnchor = 152\n" +"id_bhvBowserFlameSpawn = 153\n" +"id_bhvTiltingBowserLavaPlatform = 154\n" +"id_bhvFallingBowserPlatform = 155\n" +"id_bhvBlueBowserFlame = 156\n" +"id_bhvFlameFloatingLanding = 157\n" +"id_bhvBlueFlamesGroup = 158\n" +"id_bhvFlameBouncing = 159\n" +"id_bhvFlameMovingForwardGrowing = 160\n" +"id_bhvFlameBowser = 161\n" +"id_bhvFlameLargeBurningOut = 162\n" +"id_bhvBlueFish = 163\n" +"id_bhvTankFishGroup = 164\n" +"id_bhvCheckerboardElevatorGroup = 165\n" +"id_bhvCheckerboardPlatformSub = 166\n" +"id_bhvBowserKeyUnlockDoor = 167\n" +"id_bhvBowserKeyCourseExit = 168\n" +"id_bhvInvisibleObjectsUnderBridge = 169\n" +"id_bhvWaterLevelPillar = 170\n" +"id_bhvDddWarp = 171\n" +"id_bhvMoatGrills = 172\n" +"id_bhvClockMinuteHand = 173\n" +"id_bhvClockHourHand = 174\n" +"id_bhvMacroUkiki = 175\n" +"id_bhvStub1D0C = 176\n" +"id_bhvLllRotatingHexagonalPlatform = 177\n" +"id_bhvLllSinkingRockBlock = 178\n" +"id_bhvStub1D70 = 179\n" +"id_bhvLllMovingOctagonalMeshPlatform = 180\n" +"id_bhvLllRotatingBlockWithFireBars = 181\n" +"id_bhvLllRotatingHexFlame = 182\n" +"id_bhvLllWoodPiece = 183\n" +"id_bhvLllFloatingWoodBridge = 184\n" +"id_bhvVolcanoFlames = 185\n" +"id_bhvLllRotatingHexagonalRing = 186\n" +"id_bhvLllSinkingRectangularPlatform = 187\n" +"id_bhvLllSinkingSquarePlatforms = 188\n" +"id_bhvLllTiltingInvertedPyramid = 189\n" +"id_bhvUnused1F30 = 190\n" +"id_bhvKoopaShell = 191\n" +"id_bhvKoopaShellFlame = 192\n" +"id_bhvToxBox = 193\n" +"id_bhvPiranhaPlant = 194\n" +"id_bhvLllHexagonalMesh = 195\n" +"id_bhvLllBowserPuzzlePiece = 196\n" +"id_bhvLllBowserPuzzle = 197\n" +"id_bhvTuxiesMother = 198\n" +"id_bhvPenguinBaby = 199\n" +"id_bhvUnused20E0 = 200\n" +"id_bhvSmallPenguin = 201\n" +"id_bhvFish2 = 202\n" +"id_bhvFish3 = 203\n" +"id_bhvLargeFishGroup = 204\n" +"id_bhvFish = 205\n" +"id_bhvWdwExpressElevator = 206\n" +"id_bhvWdwExpressElevatorPlatform = 207\n" +"id_bhvChirpChirp = 208\n" +"id_bhvBub = 209\n" +"id_bhvExclamationBox = 210\n" +"id_bhvRotatingExclamationMark = 211\n" +"id_bhvSoundSpawner = 212\n" +"id_bhvRockSolid = 213\n" +"id_bhvBowserSubDoor = 214\n" +"id_bhvBowsersSub = 215\n" +"id_bhvSushiShark = 216\n" +"id_bhvSushiSharkCollisionChild = 217\n" +"id_bhvJrbSlidingBox = 218\n" +"id_bhvShipPart3 = 219\n" +"id_bhvInSunkenShip3 = 220\n" +"id_bhvSunkenShipPart = 221\n" +"id_bhvSunkenShipPart2 = 222\n" +"id_bhvInSunkenShip = 223\n" +"id_bhvInSunkenShip2 = 224\n" +"id_bhvMistParticleSpawner = 225\n" +"id_bhvWhitePuff1 = 226\n" +"id_bhvWhitePuff2 = 227\n" +"id_bhvWhitePuffSmoke2 = 228\n" +"id_bhvPurpleSwitchHiddenBoxes = 229\n" +"id_bhvBlueCoinSwitch = 230\n" +"id_bhvHiddenBlueCoin = 231\n" +"id_bhvOpenableCageDoor = 232\n" +"id_bhvOpenableGrill = 233\n" +"id_bhvWaterLevelDiamond = 234\n" +"id_bhvInitializeChangingWaterLevel = 235\n" +"id_bhvTweesterSandParticle = 236\n" +"id_bhvTweester = 237\n" +"id_bhvMerryGoRoundBooManager = 238\n" +"id_bhvAnimatedTexture = 239\n" +"id_bhvBooInCastle = 240\n" +"id_bhvBooWithCage = 241\n" +"id_bhvBalconyBigBoo = 242\n" +"id_bhvMerryGoRoundBigBoo = 243\n" +"id_bhvGhostHuntBigBoo = 244\n" +"id_bhvCourtyardBooTriplet = 245\n" +"id_bhvBoo = 246\n" +"id_bhvMerryGoRoundBoo = 247\n" +"id_bhvGhostHuntBoo = 248\n" +"id_bhvHiddenStaircaseStep = 249\n" +"id_bhvBooBossSpawnedBridge = 250\n" +"id_bhvBbhTiltingTrapPlatform = 251\n" +"id_bhvHauntedBookshelf = 252\n" +"id_bhvMeshElevator = 253\n" +"id_bhvMerryGoRound = 254\n" +"id_bhvPlaysMusicTrackWhenTouched = 255\n" +"id_bhvBetaBowserAnchor = 256\n" +"id_bhvStaticCheckeredPlatform = 257\n" +"id_bhvUnused2A10 = 258\n" +"id_bhvUnusedFakeStar = 259\n" +"id_bhvStaticObject = 260\n" +"id_bhvUnused2A54 = 261\n" +"id_bhvCastleFloorTrap = 262\n" +"id_bhvFloorTrapInCastle = 263\n" +"id_bhvTree = 264\n" +"id_bhvSparkle = 265\n" +"id_bhvSparkleSpawn = 266\n" +"id_bhvSparkleParticleSpawner = 267\n" +"id_bhvScuttlebug = 268\n" +"id_bhvScuttlebugSpawn = 269\n" +"id_bhvWhompKingBoss = 270\n" +"id_bhvSmallWhomp = 271\n" +"id_bhvWaterSplash = 272\n" +"id_bhvWaterDroplet = 273\n" +"id_bhvWaterDropletSplash = 274\n" +"id_bhvBubbleSplash = 275\n" +"id_bhvIdleWaterWave = 276\n" +"id_bhvObjectWaterSplash = 277\n" +"id_bhvShallowWaterWave = 278\n" +"id_bhvShallowWaterSplash = 279\n" +"id_bhvObjectWaveTrail = 280\n" +"id_bhvWaveTrail = 281\n" +"id_bhvTinyStrongWindParticle = 282\n" +"id_bhvStrongWindParticle = 283\n" +"id_bhvSLSnowmanWind = 284\n" +"id_bhvSLWalkingPenguin = 285\n" +"id_bhvYellowBall = 286\n" +"id_bhvMario = 287\n" +"id_bhvToadMessage = 288\n" +"id_bhvUnlockDoorStar = 289\n" +"id_bhvRandomAnimatedTexture = 290\n" +"id_bhvYellowBackgroundInMenu = 291\n" +"id_bhvMenuButton = 292\n" +"id_bhvMenuButtonManager = 293\n" +"id_bhvActSelectorStarType = 294\n" +"id_bhvActSelector = 295\n" +"id_bhvMovingYellowCoin = 296\n" +"id_bhvMovingBlueCoin = 297\n" +"id_bhvBlueCoinSliding = 298\n" +"id_bhvBlueCoinJumping = 299\n" +"id_bhvSeaweed = 300\n" +"id_bhvSeaweedBundle = 301\n" +"id_bhvBobomb = 302\n" +"id_bhvBobombFuseSmoke = 303\n" +"id_bhvBobombBuddy = 304\n" +"id_bhvBobombBuddyOpensCannon = 305\n" +"id_bhvCannonClosed = 306\n" +"id_bhvWhirlpool = 307\n" +"id_bhvJetStream = 308\n" +"id_bhvMessagePanel = 309\n" +"id_bhvSignOnWall = 310\n" +"id_bhvHomingAmp = 311\n" +"id_bhvCirclingAmp = 312\n" +"id_bhvButterfly = 313\n" +"id_bhvHoot = 314\n" +"id_bhvBetaHoldableObject = 315\n" +"id_bhvCarrySomething1 = 316\n" +"id_bhvCarrySomething2 = 317\n" +"id_bhvCarrySomething3 = 318\n" +"id_bhvCarrySomething4 = 319\n" +"id_bhvCarrySomething5 = 320\n" +"id_bhvCarrySomething6 = 321\n" +"id_bhvObjectBubble = 322\n" +"id_bhvObjectWaterWave = 323\n" +"id_bhvExplosion = 324\n" +"id_bhvBobombBullyDeathSmoke = 325\n" +"id_bhvSmoke = 326\n" +"id_bhvBobombExplosionBubble = 327\n" +"id_bhvRespawner = 328\n" +"id_bhvSmallBully = 329\n" +"id_bhvBigBully = 330\n" +"id_bhvBigBullyWithMinions = 331\n" +"id_bhvSmallChillBully = 332\n" +"id_bhvBigChillBully = 333\n" +"id_bhvJetStreamRingSpawner = 334\n" +"id_bhvJetStreamWaterRing = 335\n" +"id_bhvMantaRayWaterRing = 336\n" +"id_bhvMantaRayRingManager = 337\n" +"id_bhvBowserBomb = 338\n" +"id_bhvBowserBombExplosion = 339\n" +"id_bhvBowserBombSmoke = 340\n" +"id_bhvCelebrationStar = 341\n" +"id_bhvCelebrationStarSparkle = 342\n" +"id_bhvStarKeyCollectionPuffSpawner = 343\n" +"id_bhvLllDrawbridgeSpawner = 344\n" +"id_bhvLllDrawbridge = 345\n" +"id_bhvSmallBomp = 346\n" +"id_bhvLargeBomp = 347\n" +"id_bhvWfSlidingPlatform = 348\n" +"id_bhvMoneybag = 349\n" +"id_bhvMoneybagHidden = 350\n" +"id_bhvPitBowlingBall = 351\n" +"id_bhvFreeBowlingBall = 352\n" +"id_bhvBowlingBall = 353\n" +"id_bhvTtmBowlingBallSpawner = 354\n" +"id_bhvBobBowlingBallSpawner = 355\n" +"id_bhvThiBowlingBallSpawner = 356\n" +"id_bhvRrCruiserWing = 357\n" +"id_bhvSpindel = 358\n" +"id_bhvSslMovingPyramidWall = 359\n" +"id_bhvPyramidElevator = 360\n" +"id_bhvPyramidElevatorTrajectoryMarkerBall = 361\n" +"id_bhvPyramidTop = 362\n" +"id_bhvPyramidTopFragment = 363\n" +"id_bhvPyramidPillarTouchDetector = 364\n" +"id_bhvWaterfallSoundLoop = 365\n" +"id_bhvVolcanoSoundLoop = 366\n" +"id_bhvCastleFlagWaving = 367\n" +"id_bhvBirdsSoundLoop = 368\n" +"id_bhvAmbientSounds = 369\n" +"id_bhvSandSoundLoop = 370\n" +"id_bhvHiddenAt120Stars = 371\n" +"id_bhvSnowmansBottom = 372\n" +"id_bhvSnowmansHead = 373\n" +"id_bhvSnowmansBodyCheckpoint = 374\n" +"id_bhvBigSnowmanWhole = 375\n" +"id_bhvBigBoulder = 376\n" +"id_bhvBigBoulderGenerator = 377\n" +"id_bhvWingCap = 378\n" +"id_bhvMetalCap = 379\n" +"id_bhvNormalCap = 380\n" +"id_bhvVanishCap = 381\n" +"id_bhvStar = 382\n" +"id_bhvStarSpawnCoordinates = 383\n" +"id_bhvHiddenRedCoinStar = 384\n" +"id_bhvRedCoin = 385\n" +"id_bhvBowserCourseRedCoinStar = 386\n" +"id_bhvHiddenStar = 387\n" +"id_bhvHiddenStarTrigger = 388\n" +"id_bhvTtmRollingLog = 389\n" +"id_bhvLllVolcanoFallingTrap = 390\n" +"id_bhvLllRollingLog = 391\n" +"id_bhv1upWalking = 392\n" +"id_bhv1upRunningAway = 393\n" +"id_bhv1upSliding = 394\n" +"id_bhv1Up = 395\n" +"id_bhv1upJumpOnApproach = 396\n" +"id_bhvHidden1up = 397\n" +"id_bhvHidden1upTrigger = 398\n" +"id_bhvHidden1upInPole = 399\n" +"id_bhvHidden1upInPoleTrigger = 400\n" +"id_bhvHidden1upInPoleSpawner = 401\n" +"id_bhvControllablePlatform = 402\n" +"id_bhvControllablePlatformSub = 403\n" +"id_bhvBreakableBoxSmall = 404\n" +"id_bhvSlidingSnowMound = 405\n" +"id_bhvSnowMoundSpawn = 406\n" +"id_bhvWdwSquareFloatingPlatform = 407\n" +"id_bhvWdwRectangularFloatingPlatform = 408\n" +"id_bhvJrbFloatingPlatform = 409\n" +"id_bhvArrowLift = 410\n" +"id_bhvOrangeNumber = 411\n" +"id_bhvMantaRay = 412\n" +"id_bhvFallingPillar = 413\n" +"id_bhvFallingPillarHitbox = 414\n" +"id_bhvPillarBase = 415\n" +"id_bhvJrbFloatingBox = 416\n" +"id_bhvDecorativePendulum = 417\n" +"id_bhvTreasureChestsShip = 418\n" +"id_bhvTreasureChestsJrb = 419\n" +"id_bhvTreasureChests = 420\n" +"id_bhvTreasureChestBottom = 421\n" +"id_bhvTreasureChestTop = 422\n" +"id_bhvMips = 423\n" +"id_bhvYoshi = 424\n" +"id_bhvKoopa = 425\n" +"id_bhvKoopaRaceEndpoint = 426\n" +"id_bhvKoopaFlag = 427\n" +"id_bhvPokey = 428\n" +"id_bhvPokeyBodyPart = 429\n" +"id_bhvSwoop = 430\n" +"id_bhvFlyGuy = 431\n" +"id_bhvGoomba = 432\n" +"id_bhvGoombaTripletSpawner = 433\n" +"id_bhvChainChomp = 434\n" +"id_bhvChainChompChainPart = 435\n" +"id_bhvWoodenPost = 436\n" +"id_bhvChainChompGate = 437\n" +"id_bhvWigglerHead = 438\n" +"id_bhvWigglerBody = 439\n" +"id_bhvEnemyLakitu = 440\n" +"id_bhvCameraLakitu = 441\n" +"id_bhvCloud = 442\n" +"id_bhvCloudPart = 443\n" +"id_bhvSpiny = 444\n" +"id_bhvMontyMole = 445\n" +"id_bhvMontyMoleHole = 446\n" +"id_bhvMontyMoleRock = 447\n" +"id_bhvPlatformOnTrack = 448\n" +"id_bhvTrackBall = 449\n" +"id_bhvSeesawPlatform = 450\n" +"id_bhvFerrisWheelAxle = 451\n" +"id_bhvFerrisWheelPlatform = 452\n" +"id_bhvWaterBombSpawner = 453\n" +"id_bhvWaterBomb = 454\n" +"id_bhvWaterBombShadow = 455\n" +"id_bhvTTCRotatingSolid = 456\n" +"id_bhvTTCPendulum = 457\n" +"id_bhvTTCTreadmill = 458\n" +"id_bhvTTCMovingBar = 459\n" +"id_bhvTTCCog = 460\n" +"id_bhvTTCPitBlock = 461\n" +"id_bhvTTCElevator = 462\n" +"id_bhvTTC2DRotator = 463\n" +"id_bhvTTCSpinner = 464\n" +"id_bhvMrBlizzard = 465\n" +"id_bhvMrBlizzardSnowball = 466\n" +"id_bhvSlidingPlatform2 = 467\n" +"id_bhvOctagonalPlatformRotating = 468\n" +"id_bhvAnimatesOnFloorSwitchPress = 469\n" +"id_bhvActivatedBackAndForthPlatform = 470\n" +"id_bhvRecoveryHeart = 471\n" +"id_bhvWaterBombCannon = 472\n" +"id_bhvCannonBarrelBubbles = 473\n" +"id_bhvUnagi = 474\n" +"id_bhvUnagiSubobject = 475\n" +"id_bhvDorrie = 476\n" +"id_bhvHauntedChair = 477\n" +"id_bhvMadPiano = 478\n" +"id_bhvFlyingBookend = 479\n" +"id_bhvBookendSpawn = 480\n" +"id_bhvHauntedBookshelfManager = 481\n" +"id_bhvBookSwitch = 482\n" +"id_bhvFirePiranhaPlant = 483\n" +"id_bhvSmallPiranhaFlame = 484\n" +"id_bhvFireSpitter = 485\n" +"id_bhvFlyguyFlame = 486\n" +"id_bhvSnufit = 487\n" +"id_bhvSnufitBalls = 488\n" +"id_bhvHorizontalGrindel = 489\n" +"id_bhvEyerokBoss = 490\n" +"id_bhvEyerokHand = 491\n" +"id_bhvKlepto = 492\n" +"id_bhvBird = 493\n" +"id_bhvRacingPenguin = 494\n" +"id_bhvPenguinRaceFinishLine = 495\n" +"id_bhvPenguinRaceShortcutCheck = 496\n" +"id_bhvCoffinSpawner = 497\n" +"id_bhvCoffin = 498\n" +"id_bhvClamShell = 499\n" +"id_bhvSkeeter = 500\n" +"id_bhvSkeeterWave = 501\n" +"id_bhvSwingPlatform = 502\n" +"id_bhvDonutPlatformSpawner = 503\n" +"id_bhvDonutPlatform = 504\n" +"id_bhvDDDPole = 505\n" +"id_bhvRedCoinStarMarker = 506\n" +"id_bhvTripletButterfly = 507\n" +"id_bhvBubba = 508\n" +"id_bhvBeginningLakitu = 509\n" +"id_bhvBeginningPeach = 510\n" +"id_bhvEndBirds1 = 511\n" +"id_bhvEndBirds2 = 512\n" +"id_bhvIntroScene = 513\n" +"id_bhv_max_count = 514\n" "CAM_MODE_MARIO_ACTIVE = 0x01\n" "CAM_MODE_LAKITU_WAS_ZOOMED_OUT = 0x02\n" "CAM_MODE_MARIO_SELECTED = 0x04\n" @@ -1561,6 +2076,183 @@ char gSmluaConstants[] = "" "HOOK_ON_HUD_RENDER = 8\n" "HOOK_ON_INTERACT = 9\n" "HOOK_MAX = 10\n" +"E_MODEL_MARIO = 0\n" +"E_MODEL_SMOKE = 1\n" +"E_MODEL_SPARKLES = 2\n" +"E_MODEL_BUBBLE = 3\n" +"E_MODEL_SMALL_WATER_SPLASH = 4\n" +"E_MODEL_IDLE_WATER_WAVE = 5\n" +"E_MODEL_WATER_SPLASH = 6\n" +"E_MODEL_WAVE_TRAIL = 7\n" +"E_MODEL_YELLOW_COIN = 8\n" +"E_MODEL_STAR = 9\n" +"E_MODEL_TRANSPARENT_STAR = 10\n" +"E_MODEL_WOODEN_SIGNPOST = 11\n" +"E_MODEL_WHITE_PARTICLE_SMALL = 12\n" +"E_MODEL_RED_FLAME = 13\n" +"E_MODEL_BLUE_FLAME = 14\n" +"E_MODEL_BURN_SMOKE = 15\n" +"E_MODEL_LEAVES = 16\n" +"E_MODEL_PURPLE_MARBLE = 17\n" +"E_MODEL_FISH = 18\n" +"E_MODEL_FISH_SHADOW = 19\n" +"E_MODEL_SPARKLES_ANIMATION = 20\n" +"E_MODEL_SAND_DUST = 21\n" +"E_MODEL_BUTTERFLY = 22\n" +"E_MODEL_BURN_SMOKE_UNUSED = 23\n" +"E_MODEL_PEBBLE = 24\n" +"E_MODEL_MIST = 25\n" +"E_MODEL_WHITE_PUFF = 26\n" +"E_MODEL_WHITE_PARTICLE_DL = 27\n" +"E_MODEL_WHITE_PARTICLE = 28\n" +"E_MODEL_YELLOW_COIN_NO_SHADOW = 29\n" +"E_MODEL_BLUE_COIN = 30\n" +"E_MODEL_BLUE_COIN_NO_SHADOW = 31\n" +"E_MODEL_MARIOS_WINGED_METAL_CAP = 32\n" +"E_MODEL_MARIOS_METAL_CAP = 33\n" +"E_MODEL_MARIOS_WING_CAP = 34\n" +"E_MODEL_MARIOS_CAP = 35\n" +"E_MODEL_MARIOS_CAP2 = 36\n" +"E_MODEL_BOWSER_KEY_CUTSCENE = 37\n" +"E_MODEL_BOWSER_KEY = 38\n" +"E_MODEL_RED_FLAME_SHADOW = 39\n" +"E_MODEL_1UP = 40\n" +"E_MODEL_RED_COIN = 41\n" +"E_MODEL_RED_COIN_NO_SHADOW = 42\n" +"E_MODEL_NUMBER = 43\n" +"E_MODEL_EXPLOSION = 44\n" +"E_MODEL_DIRT_ANIMATION = 45\n" +"E_MODEL_CARTOON_STAR = 46\n" +"E_MODEL_BLUE_COIN_SWITCH = 47\n" +"E_MODEL_AMP = 48\n" +"E_MODEL_PURPLE_SWITCH = 49\n" +"E_MODEL_CHECKERBOARD_PLATFORM = 50\n" +"E_MODEL_BREAKABLE_BOX = 51\n" +"E_MODEL_BREAKABLE_BOX_SMALL = 52\n" +"E_MODEL_EXCLAMATION_BOX_OUTLINE = 53\n" +"E_MODEL_EXCLAMATION_BOX = 54\n" +"E_MODEL_GOOMBA = 55\n" +"E_MODEL_EXCLAMATION_POINT = 56\n" +"E_MODEL_KOOPA_SHELL = 57\n" +"E_MODEL_METAL_BOX = 58\n" +"E_MODEL_METAL_BOX_DL = 59\n" +"E_MODEL_BLACK_BOBOMB = 60\n" +"E_MODEL_BOBOMB_BUDDY = 61\n" +"E_MODEL_DL_CANNON_LID = 62\n" +"E_MODEL_BOWLING_BALL = 63\n" +"E_MODEL_CANNON_BARREL = 64\n" +"E_MODEL_CANNON_BASE = 65\n" +"E_MODEL_HEART = 66\n" +"E_MODEL_FLYGUY = 67\n" +"E_MODEL_CHUCKYA = 68\n" +"E_MODEL_TRAJECTORY_MARKER_BALL = 69\n" +"E_MODEL_BULLET_BILL = 70\n" +"E_MODEL_YELLOW_SPHERE = 71\n" +"E_MODEL_HOOT = 72\n" +"E_MODEL_YOSHI_EGG = 73\n" +"E_MODEL_THWOMP = 74\n" +"E_MODEL_HEAVE_HO = 75\n" +"E_MODEL_BLARGG = 76\n" +"E_MODEL_BULLY = 77\n" +"E_MODEL_BULLY_BOSS = 78\n" +"E_MODEL_WATER_BOMB = 79\n" +"E_MODEL_WATER_BOMB_SHADOW = 80\n" +"E_MODEL_KING_BOBOMB = 81\n" +"E_MODEL_MANTA_RAY = 82\n" +"E_MODEL_UNAGI = 83\n" +"E_MODEL_SUSHI = 84\n" +"E_MODEL_DL_WHIRLPOOL = 85\n" +"E_MODEL_CLAM_SHELL = 86\n" +"E_MODEL_POKEY_HEAD = 87\n" +"E_MODEL_POKEY_BODY_PART = 88\n" +"E_MODEL_TWEESTER = 89\n" +"E_MODEL_KLEPTO = 90\n" +"E_MODEL_EYEROK_LEFT_HAND = 91\n" +"E_MODEL_EYEROK_RIGHT_HAND = 92\n" +"E_MODEL_DL_MONTY_MOLE_HOLE = 93\n" +"E_MODEL_MONTY_MOLE = 94\n" +"E_MODEL_UKIKI = 95\n" +"E_MODEL_FWOOSH = 96\n" +"E_MODEL_SPINDRIFT = 97\n" +"E_MODEL_MR_BLIZZARD_HIDDEN = 98\n" +"E_MODEL_MR_BLIZZARD = 99\n" +"E_MODEL_PENGUIN = 100\n" +"E_MODEL_CAP_SWITCH_EXCLAMATION = 101\n" +"E_MODEL_CAP_SWITCH = 102\n" +"E_MODEL_CAP_SWITCH_BASE = 103\n" +"E_MODEL_BOO = 104\n" +"E_MODEL_BETA_BOO_KEY = 105\n" +"E_MODEL_HAUNTED_CHAIR = 106\n" +"E_MODEL_MAD_PIANO = 107\n" +"E_MODEL_BOOKEND_PART = 108\n" +"E_MODEL_BOOKEND = 109\n" +"E_MODEL_HAUNTED_CAGE = 110\n" +"E_MODEL_BIRDS = 111\n" +"E_MODEL_PEACH = 112\n" +"E_MODEL_YOSHI = 113\n" +"E_MODEL_ENEMY_LAKITU = 114\n" +"E_MODEL_SPINY_BALL = 115\n" +"E_MODEL_SPINY = 116\n" +"E_MODEL_WIGGLER_HEAD = 117\n" +"E_MODEL_WIGGLER_BODY = 118\n" +"E_MODEL_BUBBA = 119\n" +"E_MODEL_BOWSER = 120\n" +"E_MODEL_BOWSER_BOMB_CHILD_OBJ = 121\n" +"E_MODEL_BOWSER_BOMB = 122\n" +"E_MODEL_BOWSER_SMOKE = 123\n" +"E_MODEL_BOWSER_FLAMES = 124\n" +"E_MODEL_BOWSER_WAVE = 125\n" +"E_MODEL_BOWSER2 = 126\n" +"E_MODEL_BUB = 127\n" +"E_MODEL_TREASURE_CHEST_BASE = 128\n" +"E_MODEL_TREASURE_CHEST_LID = 129\n" +"E_MODEL_CYAN_FISH = 130\n" +"E_MODEL_WATER_RING = 131\n" +"E_MODEL_WATER_MINE = 132\n" +"E_MODEL_SEAWEED = 133\n" +"E_MODEL_SKEETER = 134\n" +"E_MODEL_PIRANHA_PLANT = 135\n" +"E_MODEL_WHOMP = 136\n" +"E_MODEL_KOOPA_WITH_SHELL = 137\n" +"E_MODEL_KOOPA_WITHOUT_SHELL = 138\n" +"E_MODEL_METALLIC_BALL = 139\n" +"E_MODEL_CHAIN_CHOMP = 140\n" +"E_MODEL_KOOPA_FLAG = 141\n" +"E_MODEL_WOODEN_POST = 142\n" +"E_MODEL_MIPS = 143\n" +"E_MODEL_BOO_CASTLE = 144\n" +"E_MODEL_LAKITU = 145\n" +"E_MODEL_TOAD = 146\n" +"E_MODEL_CHILL_BULLY = 147\n" +"E_MODEL_BIG_CHILL_BULLY = 148\n" +"E_MODEL_MONEYBAG = 149\n" +"E_MODEL_SWOOP = 150\n" +"E_MODEL_SCUTTLEBUG = 151\n" +"E_MODEL_MR_I_IRIS = 152\n" +"E_MODEL_MR_I = 153\n" +"E_MODEL_DORRIE = 154\n" +"E_MODEL_SNUFIT = 155\n" +"E_MODEL_BUBBLE_PLAYER = 156\n" +"E_MODEL_LUIGI = 157\n" +"E_MODEL_LUIGIS_CAP = 158\n" +"E_MODEL_LUIGIS_METAL_CAP = 159\n" +"E_MODEL_LUIGIS_WING_CAP = 160\n" +"E_MODEL_LUIGIS_WINGED_METAL_CAP = 161\n" +"E_MODEL_TOAD_PLAYER = 162\n" +"E_MODEL_TOADS_CAP = 163\n" +"E_MODEL_TOADS_METAL_CAP = 164\n" +"E_MODEL_TOADS_WING_CAP = 165\n" +"E_MODEL_WALUIGI = 166\n" +"E_MODEL_WALUIGIS_CAP = 167\n" +"E_MODEL_WALUIGIS_METAL_CAP = 168\n" +"E_MODEL_WALUIGIS_WING_CAP = 169\n" +"E_MODEL_WALUIGIS_WINGED_METAL_CAP = 170\n" +"E_MODEL_WARIO = 171\n" +"E_MODEL_WARIOS_CAP = 172\n" +"E_MODEL_WARIOS_METAL_CAP = 173\n" +"E_MODEL_WARIOS_WING_CAP = 174\n" +"E_MODEL_WARIOS_WINGED_METAL_CAP = 175\n" +"E_MODEL_MAX = 176\n" "SPTASK_STATE_NOT_STARTED = 0\n" "SPTASK_STATE_RUNNING = 1\n" "SPTASK_STATE_INTERRUPTED = 2\n" diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index dd073485..3ded6bdb 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -18,8 +18,40 @@ #include "src/game/sound_init.h" #include "src/pc/djui/djui_hud_utils.h" #include "src/pc/network/network_player.h" +#include "include/behavior_table.h" +#include "src/pc/lua/smlua_obj_utils.h" + ////////////////////// + // behavior_table.h // +////////////////////// + +/* +int smlua_func_get_behavior_from_id(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + + int id = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { return 0; } + + UNIMPLEMENTED -->(L, get_behavior_from_id(id)); + + return 1; +} +*/ + +/* +int smlua_func_get_id_from_behavior(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + +// const BehaviorScript* behavior = (const BehaviorScript*)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED + if (!gSmLuaConvertSuccess) { return 0; } + + lua_pushinteger(L, get_id_from_behavior(behavior)); + + return 1; +} +*/ + ////////////// // camera.h // ////////////// @@ -3170,6 +3202,29 @@ int smlua_func_save_file_get_total_star_count(lua_State* L) { return 1; } + /////////////////////// + // smlua_obj_utils.h // +/////////////////////// + +int smlua_func_spawn_object_sync(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 5)) { return 0; } + + int behaviorId = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { return 0; } + int modelId = smlua_to_integer(L, 2); + if (!gSmLuaConvertSuccess) { return 0; } + f32 x = smlua_to_number(L, 3); + if (!gSmLuaConvertSuccess) { return 0; } + f32 y = smlua_to_number(L, 4); + if (!gSmLuaConvertSuccess) { return 0; } + f32 z = smlua_to_number(L, 5); + if (!gSmLuaConvertSuccess) { return 0; } + + smlua_push_object(L, LOT_OBJECT, spawn_object_sync(behaviorId, modelId, x, y, z)); + + return 1; +} + ////////////////// // sound_init.h // ////////////////// @@ -3564,6 +3619,10 @@ int smlua_func_queue_rumble_data_object(lua_State* L) { void smlua_bind_functions_autogen(void) { lua_State* L = gLuaState; + // behavior_table.h + //smlua_bind_function(L, "get_behavior_from_id", smlua_func_get_behavior_from_id); <--- UNIMPLEMENTED + //smlua_bind_function(L, "get_id_from_behavior", smlua_func_get_id_from_behavior); <--- UNIMPLEMENTED + // camera.h smlua_bind_function(L, "set_camera_pitch_shake", smlua_func_set_camera_pitch_shake); smlua_bind_function(L, "set_camera_roll_shake", smlua_func_set_camera_roll_shake); @@ -3832,6 +3891,9 @@ void smlua_bind_functions_autogen(void) { smlua_bind_function(L, "save_file_get_star_flags", smlua_func_save_file_get_star_flags); smlua_bind_function(L, "save_file_get_total_star_count", smlua_func_save_file_get_total_star_count); + // smlua_obj_utils.h + smlua_bind_function(L, "spawn_object_sync", smlua_func_spawn_object_sync); + // sound_init.h smlua_bind_function(L, "disable_background_sound", smlua_func_disable_background_sound); smlua_bind_function(L, "enable_background_sound", smlua_func_enable_background_sound); diff --git a/src/pc/lua/smlua_model_utils.c b/src/pc/lua/smlua_model_utils.c new file mode 100644 index 00000000..6e1e7829 --- /dev/null +++ b/src/pc/lua/smlua_model_utils.c @@ -0,0 +1,289 @@ +#include "sm64.h" +#include "types.h" + +#include "src/game/area.h" +#include "src/engine/graph_node.h" +#include "src/engine/level_script.h" + +// models +#include "actors/common0.h" +#include "actors/common1.h" +#include "actors/custom0.h" +#include "actors/group0.h" +#include "actors/group1.h" +#include "actors/group2.h" +#include "actors/group3.h" +#include "actors/group4.h" +#include "actors/group5.h" +#include "actors/group6.h" +#include "actors/group7.h" +#include "actors/group8.h" +#include "actors/group9.h" +#include "actors/group10.h" +#include "actors/group11.h" +#include "actors/group12.h" +#include "actors/group13.h" +#include "actors/group14.h" +#include "actors/group15.h" +#include "actors/group16.h" +#include "actors/group17.h" +#include "actors/zcustom0.h" + +#include "smlua_model_utils.h" +#include "pc/debuglog.h" + +struct ModelUtilsInfo { + enum ModelExtendedId id; + const void* asset; + u8 layer; + u8 cacheId; +}; + +#define MODEL_UTIL_GEO(x, y) [x] = { .id = x, .asset = y, .layer = LAYER_OPAQUE, .cacheId = 0xFF } +#define MODEL_UTIL_DL(x, y, z) [x] = { .id = x, .asset = y, .layer = z, .cacheId = 0xFF } + +struct ModelUtilsInfo sModels[] = { + MODEL_UTIL_GEO(E_MODEL_MARIO, mario_geo), + MODEL_UTIL_GEO(E_MODEL_SMOKE, smoke_geo), + MODEL_UTIL_GEO(E_MODEL_SPARKLES, sparkles_geo), + MODEL_UTIL_GEO(E_MODEL_BUBBLE, bubble_geo), + MODEL_UTIL_GEO(E_MODEL_SMALL_WATER_SPLASH, small_water_splash_geo), + MODEL_UTIL_GEO(E_MODEL_IDLE_WATER_WAVE, idle_water_wave_geo), + MODEL_UTIL_GEO(E_MODEL_WATER_SPLASH, water_splash_geo), + MODEL_UTIL_GEO(E_MODEL_WAVE_TRAIL, wave_trail_geo), + MODEL_UTIL_GEO(E_MODEL_YELLOW_COIN, yellow_coin_geo), + MODEL_UTIL_GEO(E_MODEL_STAR, star_geo), + MODEL_UTIL_GEO(E_MODEL_TRANSPARENT_STAR, transparent_star_geo), + MODEL_UTIL_GEO(E_MODEL_WOODEN_SIGNPOST, wooden_signpost_geo), + MODEL_UTIL_DL (E_MODEL_WHITE_PARTICLE_SMALL, white_particle_small_dl, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_RED_FLAME, red_flame_geo), + MODEL_UTIL_GEO(E_MODEL_BLUE_FLAME, blue_flame_geo), + MODEL_UTIL_GEO(E_MODEL_BURN_SMOKE, burn_smoke_geo), + MODEL_UTIL_GEO(E_MODEL_LEAVES, leaves_geo), + MODEL_UTIL_GEO(E_MODEL_PURPLE_MARBLE, purple_marble_geo), + MODEL_UTIL_GEO(E_MODEL_FISH, fish_geo), + MODEL_UTIL_GEO(E_MODEL_FISH_SHADOW, fish_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_SPARKLES_ANIMATION, sparkles_animation_geo), + MODEL_UTIL_DL (E_MODEL_SAND_DUST, sand_seg3_dl_0302BCD0, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_BUTTERFLY, butterfly_geo), + MODEL_UTIL_GEO(E_MODEL_BURN_SMOKE_UNUSED, burn_smoke_geo), + MODEL_UTIL_DL (E_MODEL_PEBBLE, pebble_seg3_dl_0301CB00, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_MIST, mist_geo), + MODEL_UTIL_GEO(E_MODEL_WHITE_PUFF, white_puff_geo), + MODEL_UTIL_DL (E_MODEL_WHITE_PARTICLE_DL, white_particle_dl, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_WHITE_PARTICLE, white_particle_geo), + MODEL_UTIL_GEO(E_MODEL_YELLOW_COIN_NO_SHADOW, yellow_coin_no_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_BLUE_COIN, blue_coin_geo), + MODEL_UTIL_GEO(E_MODEL_BLUE_COIN_NO_SHADOW, blue_coin_no_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_MARIOS_WINGED_METAL_CAP, marios_winged_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_MARIOS_METAL_CAP, marios_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_MARIOS_WING_CAP, marios_wing_cap_geo), + MODEL_UTIL_GEO(E_MODEL_MARIOS_CAP, marios_cap_geo), + MODEL_UTIL_GEO(E_MODEL_MARIOS_CAP2, marios_cap_geo), // repeated + MODEL_UTIL_GEO(E_MODEL_BOWSER_KEY_CUTSCENE, bowser_key_cutscene_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_KEY, bowser_key_geo), + MODEL_UTIL_GEO(E_MODEL_RED_FLAME_SHADOW, red_flame_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_1UP, mushroom_1up_geo), + MODEL_UTIL_GEO(E_MODEL_RED_COIN, red_coin_geo), + MODEL_UTIL_GEO(E_MODEL_RED_COIN_NO_SHADOW, red_coin_no_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_NUMBER, number_geo), + MODEL_UTIL_GEO(E_MODEL_EXPLOSION, explosion_geo), + MODEL_UTIL_GEO(E_MODEL_DIRT_ANIMATION, dirt_animation_geo), + MODEL_UTIL_GEO(E_MODEL_CARTOON_STAR, cartoon_star_geo), + MODEL_UTIL_GEO(E_MODEL_BLUE_COIN_SWITCH, blue_coin_switch_geo), + MODEL_UTIL_GEO(E_MODEL_AMP, amp_geo), + MODEL_UTIL_GEO(E_MODEL_PURPLE_SWITCH, purple_switch_geo), + MODEL_UTIL_GEO(E_MODEL_CHECKERBOARD_PLATFORM, checkerboard_platform_geo), + MODEL_UTIL_GEO(E_MODEL_BREAKABLE_BOX, breakable_box_geo), + MODEL_UTIL_GEO(E_MODEL_BREAKABLE_BOX_SMALL, breakable_box_small_geo), + MODEL_UTIL_GEO(E_MODEL_EXCLAMATION_BOX_OUTLINE, exclamation_box_outline_geo), + MODEL_UTIL_GEO(E_MODEL_EXCLAMATION_BOX, exclamation_box_geo), + MODEL_UTIL_GEO(E_MODEL_GOOMBA, goomba_geo), + MODEL_UTIL_DL (E_MODEL_EXCLAMATION_POINT, exclamation_box_outline_seg8_dl_08025F08, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_KOOPA_SHELL, koopa_shell_geo), + MODEL_UTIL_GEO(E_MODEL_METAL_BOX, metal_box_geo), + MODEL_UTIL_DL (E_MODEL_METAL_BOX_DL, metal_box_dl, LAYER_OPAQUE), + MODEL_UTIL_GEO(E_MODEL_BLACK_BOBOMB, black_bobomb_geo), + MODEL_UTIL_GEO(E_MODEL_BOBOMB_BUDDY, bobomb_buddy_geo), + MODEL_UTIL_DL (E_MODEL_DL_CANNON_LID, cannon_lid_seg8_dl_080048E0, LAYER_OPAQUE), + MODEL_UTIL_GEO(E_MODEL_BOWLING_BALL, bowling_ball_geo), + MODEL_UTIL_GEO(E_MODEL_CANNON_BARREL, cannon_barrel_geo), + MODEL_UTIL_GEO(E_MODEL_CANNON_BASE, cannon_base_geo), + MODEL_UTIL_GEO(E_MODEL_HEART, heart_geo), + MODEL_UTIL_GEO(E_MODEL_FLYGUY, flyguy_geo), + MODEL_UTIL_GEO(E_MODEL_CHUCKYA, chuckya_geo), + MODEL_UTIL_GEO(E_MODEL_TRAJECTORY_MARKER_BALL, bowling_ball_track_geo), + MODEL_UTIL_GEO(E_MODEL_BULLET_BILL, bullet_bill_geo), + MODEL_UTIL_GEO(E_MODEL_YELLOW_SPHERE, yellow_sphere_geo), + MODEL_UTIL_GEO(E_MODEL_HOOT, hoot_geo), + MODEL_UTIL_GEO(E_MODEL_YOSHI_EGG, yoshi_egg_geo), + MODEL_UTIL_GEO(E_MODEL_THWOMP, thwomp_geo), + MODEL_UTIL_GEO(E_MODEL_HEAVE_HO, heave_ho_geo), + MODEL_UTIL_GEO(E_MODEL_BLARGG, blargg_geo), + MODEL_UTIL_GEO(E_MODEL_BULLY, bully_geo), + MODEL_UTIL_GEO(E_MODEL_BULLY_BOSS, bully_boss_geo), + MODEL_UTIL_GEO(E_MODEL_WATER_BOMB, water_bomb_geo), + MODEL_UTIL_GEO(E_MODEL_WATER_BOMB_SHADOW, water_bomb_shadow_geo), + MODEL_UTIL_GEO(E_MODEL_KING_BOBOMB, king_bobomb_geo), + MODEL_UTIL_GEO(E_MODEL_MANTA_RAY, manta_seg5_geo_05008D14), + MODEL_UTIL_GEO(E_MODEL_UNAGI, unagi_geo), + MODEL_UTIL_GEO(E_MODEL_SUSHI, sushi_geo), + MODEL_UTIL_DL (E_MODEL_DL_WHIRLPOOL, whirlpool_seg5_dl_05013CB8, LAYER_TRANSPARENT), + MODEL_UTIL_GEO(E_MODEL_CLAM_SHELL, clam_shell_geo), + MODEL_UTIL_GEO(E_MODEL_POKEY_HEAD, pokey_head_geo), + MODEL_UTIL_GEO(E_MODEL_POKEY_BODY_PART, pokey_body_part_geo), + MODEL_UTIL_GEO(E_MODEL_TWEESTER, tweester_geo), + MODEL_UTIL_GEO(E_MODEL_KLEPTO, klepto_geo), + MODEL_UTIL_GEO(E_MODEL_EYEROK_LEFT_HAND, eyerok_left_hand_geo), + MODEL_UTIL_GEO(E_MODEL_EYEROK_RIGHT_HAND, eyerok_right_hand_geo), + MODEL_UTIL_DL (E_MODEL_DL_MONTY_MOLE_HOLE, monty_mole_hole_seg5_dl_05000840, LAYER_TRANSPARENT_DECAL), + MODEL_UTIL_GEO(E_MODEL_MONTY_MOLE, monty_mole_geo), + MODEL_UTIL_GEO(E_MODEL_UKIKI, ukiki_geo), + MODEL_UTIL_GEO(E_MODEL_FWOOSH, fwoosh_geo), + MODEL_UTIL_GEO(E_MODEL_SPINDRIFT, spindrift_geo), + MODEL_UTIL_GEO(E_MODEL_MR_BLIZZARD_HIDDEN, mr_blizzard_hidden_geo), + MODEL_UTIL_GEO(E_MODEL_MR_BLIZZARD, mr_blizzard_geo), + MODEL_UTIL_GEO(E_MODEL_PENGUIN, penguin_geo), + MODEL_UTIL_DL (E_MODEL_CAP_SWITCH_EXCLAMATION, cap_switch_exclamation_seg5_dl_05002E00, LAYER_ALPHA), + MODEL_UTIL_GEO(E_MODEL_CAP_SWITCH, cap_switch_geo), + MODEL_UTIL_DL (E_MODEL_CAP_SWITCH_BASE, cap_switch_base_seg5_dl_05003120, LAYER_OPAQUE), + MODEL_UTIL_GEO(E_MODEL_BOO, boo_geo), + MODEL_UTIL_GEO(E_MODEL_BETA_BOO_KEY, small_key_geo), + MODEL_UTIL_GEO(E_MODEL_HAUNTED_CHAIR, haunted_chair_geo), + MODEL_UTIL_GEO(E_MODEL_MAD_PIANO, mad_piano_geo), + MODEL_UTIL_GEO(E_MODEL_BOOKEND_PART, bookend_part_geo), + MODEL_UTIL_GEO(E_MODEL_BOOKEND, bookend_geo), + MODEL_UTIL_GEO(E_MODEL_HAUNTED_CAGE, haunted_cage_geo), + MODEL_UTIL_GEO(E_MODEL_BIRDS, birds_geo), + MODEL_UTIL_GEO(E_MODEL_PEACH, peach_geo), + MODEL_UTIL_GEO(E_MODEL_YOSHI, yoshi_geo), + MODEL_UTIL_GEO(E_MODEL_ENEMY_LAKITU, enemy_lakitu_geo), + MODEL_UTIL_GEO(E_MODEL_SPINY_BALL, spiny_ball_geo), + MODEL_UTIL_GEO(E_MODEL_SPINY, spiny_geo), + MODEL_UTIL_GEO(E_MODEL_WIGGLER_HEAD, wiggler_head_geo), + MODEL_UTIL_GEO(E_MODEL_WIGGLER_BODY, wiggler_body_geo), + MODEL_UTIL_GEO(E_MODEL_BUBBA, bubba_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER, bowser_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_BOMB_CHILD_OBJ, bowser_bomb_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_BOMB, bowser_bomb_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_SMOKE, bowser_impact_smoke_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_FLAMES, bowser_flames_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER_WAVE, invisible_bowser_accessory_geo), + MODEL_UTIL_GEO(E_MODEL_BOWSER2, bowser2_geo), + MODEL_UTIL_GEO(E_MODEL_BUB, bub_geo), + MODEL_UTIL_GEO(E_MODEL_TREASURE_CHEST_BASE, treasure_chest_base_geo), + MODEL_UTIL_GEO(E_MODEL_TREASURE_CHEST_LID, treasure_chest_lid_geo), + MODEL_UTIL_GEO(E_MODEL_CYAN_FISH, cyan_fish_geo), + MODEL_UTIL_GEO(E_MODEL_WATER_RING, water_ring_geo), + MODEL_UTIL_GEO(E_MODEL_WATER_MINE, water_mine_geo), + MODEL_UTIL_GEO(E_MODEL_SEAWEED, seaweed_geo), + MODEL_UTIL_GEO(E_MODEL_SKEETER, skeeter_geo), + MODEL_UTIL_GEO(E_MODEL_PIRANHA_PLANT, piranha_plant_geo), + MODEL_UTIL_GEO(E_MODEL_WHOMP, whomp_geo), + MODEL_UTIL_GEO(E_MODEL_KOOPA_WITH_SHELL, koopa_with_shell_geo), + MODEL_UTIL_GEO(E_MODEL_KOOPA_WITHOUT_SHELL, koopa_without_shell_geo), + MODEL_UTIL_GEO(E_MODEL_METALLIC_BALL, metallic_ball_geo), + MODEL_UTIL_GEO(E_MODEL_CHAIN_CHOMP, chain_chomp_geo), + MODEL_UTIL_GEO(E_MODEL_KOOPA_FLAG, koopa_flag_geo), + MODEL_UTIL_GEO(E_MODEL_WOODEN_POST, wooden_post_geo), + MODEL_UTIL_GEO(E_MODEL_MIPS, mips_geo), + MODEL_UTIL_GEO(E_MODEL_BOO_CASTLE, boo_castle_geo), + MODEL_UTIL_GEO(E_MODEL_LAKITU, lakitu_geo), + MODEL_UTIL_GEO(E_MODEL_TOAD, toad_geo), + MODEL_UTIL_GEO(E_MODEL_CHILL_BULLY, chilly_chief_geo), + MODEL_UTIL_GEO(E_MODEL_BIG_CHILL_BULLY, chilly_chief_big_geo), + MODEL_UTIL_GEO(E_MODEL_MONEYBAG, moneybag_geo), + MODEL_UTIL_GEO(E_MODEL_SWOOP, swoop_geo), + MODEL_UTIL_GEO(E_MODEL_SCUTTLEBUG, scuttlebug_geo), + MODEL_UTIL_GEO(E_MODEL_MR_I_IRIS, mr_i_iris_geo), + MODEL_UTIL_GEO(E_MODEL_MR_I, mr_i_geo), + MODEL_UTIL_GEO(E_MODEL_DORRIE, dorrie_geo), + MODEL_UTIL_GEO(E_MODEL_SNUFIT, snufit_geo), + + // CUSTOM MODELS BEGIN + MODEL_UTIL_GEO(E_MODEL_BUBBLE_PLAYER, water_bomb_geo), + MODEL_UTIL_GEO(E_MODEL_LUIGI, luigi_geo), + MODEL_UTIL_GEO(E_MODEL_LUIGIS_CAP, luigis_cap_geo), + MODEL_UTIL_GEO(E_MODEL_LUIGIS_METAL_CAP, luigis_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_LUIGIS_WING_CAP, luigis_wing_cap_geo), + MODEL_UTIL_GEO(E_MODEL_LUIGIS_WINGED_METAL_CAP, luigis_winged_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_TOAD_PLAYER, toad_player_geo), + MODEL_UTIL_GEO(E_MODEL_TOADS_CAP, toads_cap_geo), + MODEL_UTIL_GEO(E_MODEL_TOADS_METAL_CAP, toads_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_TOADS_WING_CAP, toads_wing_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WALUIGI, waluigi_geo), + MODEL_UTIL_GEO(E_MODEL_WALUIGIS_CAP, waluigis_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WALUIGIS_METAL_CAP, waluigis_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WALUIGIS_WING_CAP, waluigis_wing_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WALUIGIS_WINGED_METAL_CAP, waluigis_winged_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WARIO, wario_geo), + MODEL_UTIL_GEO(E_MODEL_WARIOS_CAP, warios_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WARIOS_METAL_CAP, warios_metal_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WARIOS_WING_CAP, warios_wing_cap_geo), + MODEL_UTIL_GEO(E_MODEL_WARIOS_WINGED_METAL_CAP, warios_winged_metal_cap_geo), + // CUSTOM MODELS END +}; + +struct ModelUtilsInfo sCachedAssets[256] = { 0 }; + +void smlua_model_util_remember(u8 modelId, u8 layer, const void* asset) { + struct ModelUtilsInfo* c = &sCachedAssets[modelId]; + c->id = modelId; + c->layer = layer; + c->asset = asset; +} + +void smlua_model_util_clear(void) { + memset(sCachedAssets, 0, sizeof(sCachedAssets)); + for (int i = 0; i < E_MODEL_MAX; i++) { + if (sModels[i].cacheId != 0xFF) { + gLoadedGraphNodes[sModels[i].cacheId] = NULL; + } + sModels[i].cacheId = 0xFF; + } +} + +u8 smlua_model_util_load(enum ModelExtendedId id) { + if (id >= E_MODEL_MAX) { + LOG_ERROR("id invalid"); + return 0xFF; + } + + struct ModelUtilsInfo* info = &sModels[id]; + + // check cache + if (info->cacheId != 0xFF) { + //LOG_INFO("Found in info cache"); + return info->cacheId; + } + + // find cached asset + bool foundEmptyCacheId = false; + u8 emptyCacheId = 0; + for (int i = 0; i < 255; i++) { + if (sCachedAssets[i].asset == info->asset) { + //LOG_INFO("Found in cached assets"); + return sCachedAssets[i].id; + } + if (sCachedAssets[i].asset == NULL) { + foundEmptyCacheId = true; + emptyCacheId = i; + } + } + if (!foundEmptyCacheId) { + LOG_ERROR("No empty cache"); + return 0xFF; + } + + // load + struct AllocOnlyPool* pool = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), MEMORY_POOL_LEFT); + gLoadedGraphNodes[emptyCacheId] = process_geo_layout(pool, (void*)info->asset); + alloc_only_pool_resize(pool, pool->usedSpace); + //LOG_INFO("Loaded at runtime"); + + // remember + smlua_model_util_remember(emptyCacheId, info->layer, info->asset); + info->cacheId = emptyCacheId; + + return emptyCacheId; +} diff --git a/src/pc/lua/smlua_model_utils.h b/src/pc/lua/smlua_model_utils.h new file mode 100644 index 00000000..e641614d --- /dev/null +++ b/src/pc/lua/smlua_model_utils.h @@ -0,0 +1,190 @@ +#ifndef SMLUA_MODEL_UTILS_H +#define SMLUA_MODEL_UTILS_H + +enum ModelExtendedId { + E_MODEL_MARIO, + E_MODEL_SMOKE, + E_MODEL_SPARKLES, + E_MODEL_BUBBLE, + E_MODEL_SMALL_WATER_SPLASH, + E_MODEL_IDLE_WATER_WAVE, + E_MODEL_WATER_SPLASH, + E_MODEL_WAVE_TRAIL, + E_MODEL_YELLOW_COIN, + E_MODEL_STAR, + E_MODEL_TRANSPARENT_STAR, + E_MODEL_WOODEN_SIGNPOST, + E_MODEL_WHITE_PARTICLE_SMALL, + E_MODEL_RED_FLAME, + E_MODEL_BLUE_FLAME, + E_MODEL_BURN_SMOKE, + E_MODEL_LEAVES, + E_MODEL_PURPLE_MARBLE, + E_MODEL_FISH, + E_MODEL_FISH_SHADOW, + E_MODEL_SPARKLES_ANIMATION, + E_MODEL_SAND_DUST, + E_MODEL_BUTTERFLY, + E_MODEL_BURN_SMOKE_UNUSED, + E_MODEL_PEBBLE, + E_MODEL_MIST, + E_MODEL_WHITE_PUFF, + E_MODEL_WHITE_PARTICLE_DL, + E_MODEL_WHITE_PARTICLE, + E_MODEL_YELLOW_COIN_NO_SHADOW, + E_MODEL_BLUE_COIN, + E_MODEL_BLUE_COIN_NO_SHADOW, + E_MODEL_MARIOS_WINGED_METAL_CAP, + E_MODEL_MARIOS_METAL_CAP, + E_MODEL_MARIOS_WING_CAP, + E_MODEL_MARIOS_CAP, + E_MODEL_MARIOS_CAP2, + E_MODEL_BOWSER_KEY_CUTSCENE, + E_MODEL_BOWSER_KEY, + E_MODEL_RED_FLAME_SHADOW, + E_MODEL_1UP, + E_MODEL_RED_COIN, + E_MODEL_RED_COIN_NO_SHADOW, + E_MODEL_NUMBER, + E_MODEL_EXPLOSION, + E_MODEL_DIRT_ANIMATION, + E_MODEL_CARTOON_STAR, + E_MODEL_BLUE_COIN_SWITCH, + E_MODEL_AMP, + E_MODEL_PURPLE_SWITCH, + E_MODEL_CHECKERBOARD_PLATFORM, + E_MODEL_BREAKABLE_BOX, + E_MODEL_BREAKABLE_BOX_SMALL, + E_MODEL_EXCLAMATION_BOX_OUTLINE, + E_MODEL_EXCLAMATION_BOX, + E_MODEL_GOOMBA, + E_MODEL_EXCLAMATION_POINT, + E_MODEL_KOOPA_SHELL, + E_MODEL_METAL_BOX, + E_MODEL_METAL_BOX_DL, + E_MODEL_BLACK_BOBOMB, + E_MODEL_BOBOMB_BUDDY, + E_MODEL_DL_CANNON_LID, + E_MODEL_BOWLING_BALL, + E_MODEL_CANNON_BARREL, + E_MODEL_CANNON_BASE, + E_MODEL_HEART, + E_MODEL_FLYGUY, + E_MODEL_CHUCKYA, + E_MODEL_TRAJECTORY_MARKER_BALL, + E_MODEL_BULLET_BILL, + E_MODEL_YELLOW_SPHERE, + E_MODEL_HOOT, + E_MODEL_YOSHI_EGG, + E_MODEL_THWOMP, + E_MODEL_HEAVE_HO, + E_MODEL_BLARGG, + E_MODEL_BULLY, + E_MODEL_BULLY_BOSS, + E_MODEL_WATER_BOMB, + E_MODEL_WATER_BOMB_SHADOW, + E_MODEL_KING_BOBOMB, + E_MODEL_MANTA_RAY, + E_MODEL_UNAGI, + E_MODEL_SUSHI, + E_MODEL_DL_WHIRLPOOL, + E_MODEL_CLAM_SHELL, + E_MODEL_POKEY_HEAD, + E_MODEL_POKEY_BODY_PART, + E_MODEL_TWEESTER, + E_MODEL_KLEPTO, + E_MODEL_EYEROK_LEFT_HAND, + E_MODEL_EYEROK_RIGHT_HAND, + E_MODEL_DL_MONTY_MOLE_HOLE, + E_MODEL_MONTY_MOLE, + E_MODEL_UKIKI, + E_MODEL_FWOOSH, + E_MODEL_SPINDRIFT, + E_MODEL_MR_BLIZZARD_HIDDEN, + E_MODEL_MR_BLIZZARD, + E_MODEL_PENGUIN, + E_MODEL_CAP_SWITCH_EXCLAMATION, + E_MODEL_CAP_SWITCH, + E_MODEL_CAP_SWITCH_BASE, + E_MODEL_BOO, + E_MODEL_BETA_BOO_KEY, + E_MODEL_HAUNTED_CHAIR, + E_MODEL_MAD_PIANO, + E_MODEL_BOOKEND_PART, + E_MODEL_BOOKEND, + E_MODEL_HAUNTED_CAGE, + E_MODEL_BIRDS, + E_MODEL_PEACH, + E_MODEL_YOSHI, + E_MODEL_ENEMY_LAKITU, + E_MODEL_SPINY_BALL, + E_MODEL_SPINY, + E_MODEL_WIGGLER_HEAD, + E_MODEL_WIGGLER_BODY, + E_MODEL_BUBBA, + E_MODEL_BOWSER, + E_MODEL_BOWSER_BOMB_CHILD_OBJ, + E_MODEL_BOWSER_BOMB, + E_MODEL_BOWSER_SMOKE, + E_MODEL_BOWSER_FLAMES, + E_MODEL_BOWSER_WAVE, + E_MODEL_BOWSER2, + E_MODEL_BUB, + E_MODEL_TREASURE_CHEST_BASE, + E_MODEL_TREASURE_CHEST_LID, + E_MODEL_CYAN_FISH, + E_MODEL_WATER_RING, + E_MODEL_WATER_MINE, + E_MODEL_SEAWEED, + E_MODEL_SKEETER, + E_MODEL_PIRANHA_PLANT, + E_MODEL_WHOMP, + E_MODEL_KOOPA_WITH_SHELL, + E_MODEL_KOOPA_WITHOUT_SHELL, + E_MODEL_METALLIC_BALL, + E_MODEL_CHAIN_CHOMP, + E_MODEL_KOOPA_FLAG, + E_MODEL_WOODEN_POST, + E_MODEL_MIPS, + E_MODEL_BOO_CASTLE, + E_MODEL_LAKITU, + E_MODEL_TOAD, + E_MODEL_CHILL_BULLY, + E_MODEL_BIG_CHILL_BULLY, + E_MODEL_MONEYBAG, + E_MODEL_SWOOP, + E_MODEL_SCUTTLEBUG, + E_MODEL_MR_I_IRIS, + E_MODEL_MR_I, + E_MODEL_DORRIE, + E_MODEL_SNUFIT, + // CUSTOM MODELS BEGIN + E_MODEL_BUBBLE_PLAYER, + E_MODEL_LUIGI, + E_MODEL_LUIGIS_CAP, + E_MODEL_LUIGIS_METAL_CAP, + E_MODEL_LUIGIS_WING_CAP, + E_MODEL_LUIGIS_WINGED_METAL_CAP, + E_MODEL_TOAD_PLAYER, + E_MODEL_TOADS_CAP, + E_MODEL_TOADS_METAL_CAP, + E_MODEL_TOADS_WING_CAP, + E_MODEL_WALUIGI, + E_MODEL_WALUIGIS_CAP, + E_MODEL_WALUIGIS_METAL_CAP, + E_MODEL_WALUIGIS_WING_CAP, + E_MODEL_WALUIGIS_WINGED_METAL_CAP, + E_MODEL_WARIO, + E_MODEL_WARIOS_CAP, + E_MODEL_WARIOS_METAL_CAP, + E_MODEL_WARIOS_WING_CAP, + E_MODEL_WARIOS_WINGED_METAL_CAP, + // CUSTOM MODELS END + E_MODEL_MAX +}; + +void smlua_model_util_remember(u8 modelId, u8 layer, const void* asset); +void smlua_model_util_clear(void); +u8 smlua_model_util_load(enum ModelExtendedId id); + +#endif diff --git a/src/pc/lua/smlua_obj_utils.c b/src/pc/lua/smlua_obj_utils.c new file mode 100644 index 00000000..492238e8 --- /dev/null +++ b/src/pc/lua/smlua_obj_utils.c @@ -0,0 +1,45 @@ +#include "types.h" +#include "object_constants.h" +#include "object_fields.h" +#include "src/game/object_helpers.h" + +#include "smlua_obj_utils.h" +#include "smlua_model_utils.h" +#include "pc/debuglog.h" + + +struct Object* spawn_object_sync(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z) { + const BehaviorScript* behavior = get_behavior_from_id(behaviorId); + if (behavior == NULL) { + LOG_ERROR("failed to find behavior %u", behaviorId); + return NULL; + } + + u8 loadedModelId = smlua_model_util_load(modelId); + if (loadedModelId == 0xFF) { + LOG_ERROR("failed to load model %u", modelId); + return NULL; + } + + struct Object* obj = spawn_object(gMarioStates[0].marioObj, loadedModelId, behavior); + if (!network_set_sync_id(obj)) { + obj->activeFlags = ACTIVE_FLAG_DEACTIVATED; + LOG_ERROR("failed to set sync id"); + return NULL; + } + + obj->parentObj = obj; + obj->oPosX = x; + obj->oPosY = y; + obj->oPosZ = z; + + struct SyncObject* so = &gSyncObjects[obj->oSyncID]; + so->extendedModelId = modelId; + so->o = obj; + + struct Object* spawn_objects[] = { obj }; + u32 models[] = { loadedModelId }; + network_send_spawn_objects(spawn_objects, models, 1); + + return obj; +} diff --git a/src/pc/lua/smlua_obj_utils.h b/src/pc/lua/smlua_obj_utils.h new file mode 100644 index 00000000..438638be --- /dev/null +++ b/src/pc/lua/smlua_obj_utils.h @@ -0,0 +1,9 @@ +#ifndef SMLUA_OBJ_UTILS_H +#define SMLUA_OBJ_UTILS_H + +#include "behavior_table.h" +#include "smlua_model_utils.h" + +struct Object* spawn_object_sync(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z); + +#endif diff --git a/src/pc/network/network.h b/src/pc/network/network.h index 0bd6c9ce..af9fba0f 100644 --- a/src/pc/network/network.h +++ b/src/pc/network/network.h @@ -80,6 +80,7 @@ struct SyncObject { void* extraFields[MAX_SYNC_OBJECT_FIELDS]; bool rememberLastReliablePacket; bool lastReliablePacketIsStale; + u8 extendedModelId; }; enum PlayerInteractions { diff --git a/src/pc/network/packets/packet_object.c b/src/pc/network/packets/packet_object.c index dffc9192..85af5ee3 100644 --- a/src/pc/network/packets/packet_object.c +++ b/src/pc/network/packets/packet_object.c @@ -111,6 +111,7 @@ void network_override_object(u8 syncId, struct Object* o) { } struct SyncObject* network_init_object(struct Object *o, float maxSyncDistance) { + bool hadSyncId = (o->oSyncID != 0); // generate new sync ID if (!network_set_sync_id(o)) { LOG_ERROR("failed to sync id for object w/behavior %d", get_id_from_behavior(o->behavior)); @@ -144,6 +145,9 @@ struct SyncObject* network_init_object(struct Object *o, float maxSyncDistance) so->override_ownership = NULL; so->on_forget = NULL; so->syncDeathEvent = true; + if (!hadSyncId) { + so->extendedModelId = 0xFF; + } so->randomSeed = (u16)(o->oSyncID * 7951); memset(so->extraFields, 0, sizeof(void*) * MAX_SYNC_OBJECT_FIELDS); @@ -240,7 +244,10 @@ bool network_set_sync_id(struct Object* o) { LOG_ERROR("failed to sync id for object w/behavior %d", get_id_from_behavior(o->behavior)); return false; } - SOFT_ASSERT_RETURN(gSyncObjects[syncId].o == NULL, false); + if (gSyncObjects[syncId].o != NULL) { + LOG_ERROR("failed to sync id (o) for object w/behavior %d", get_id_from_behavior(o->behavior)); + return false; + } o->oSyncID = syncId; diff --git a/src/pc/network/packets/packet_spawn_objects.c b/src/pc/network/packets/packet_spawn_objects.c index 578f13f6..dbfec95e 100644 --- a/src/pc/network/packets/packet_spawn_objects.c +++ b/src/pc/network/packets/packet_spawn_objects.c @@ -7,6 +7,7 @@ #include "src/game/area.h" #include "behavior_data.h" #include "behavior_table.h" +#include "src/pc/lua/smlua_model_utils.h" //#define DISABLE_MODULE_LOG 1 #include "pc/debuglog.h" @@ -20,6 +21,7 @@ struct SpawnObjectData { s16 activeFlags; s32 rawData[80]; u8 globalPlayerIndex; + u8 extendedModelId; }; #pragma pack() @@ -49,10 +51,17 @@ void network_send_spawn_objects(struct Object* objects[], u32 models[], u8 objec } void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[], u32 models[], u8 objectCount) { - if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; } + if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { + LOG_ERROR("failed: area sync invalid"); + return; + } + SOFT_ASSERT(objectCount < MAX_SPAWN_OBJECTS_PER_PACKET); // prevent sending spawn objects during credits - if (gCurrActStarNum == 99) { return; } + if (gCurrActStarNum == 99) { + LOG_ERROR("failed: in credits"); + return; + } struct Packet p = { 0 }; packet_init(&p, PACKET_SPAWN_OBJECTS, true, PLMT_AREA); @@ -65,6 +74,9 @@ void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[] u32 model = models[i]; u8 parentId = generate_parent_id(objects, i, true); u16 behaviorId = get_id_from_behavior(o->behavior); + u8 extendedModelId = (o->oSyncID != 0 && gSyncObjects[o->oSyncID].o == o) + ? gSyncObjects[o->oSyncID].extendedModelId + : 0xFF; packet_write(&p, &parentId, sizeof(u8)); packet_write(&p, &model, sizeof(u32)); packet_write(&p, &behaviorId, sizeof(u16)); @@ -74,6 +86,7 @@ void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[] packet_write(&p, &o->header.gfx.scale[1], sizeof(f32)); packet_write(&p, &o->header.gfx.scale[2], sizeof(f32)); packet_write(&p, &o->globalPlayerIndex, sizeof(u8)); + packet_write(&p, &extendedModelId, sizeof(u8)); } if (sendToLocalIndex == PACKET_DESTINATION_BROADCAST) { @@ -88,7 +101,10 @@ void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[] void network_receive_spawn_objects(struct Packet* p) { LOG_INFO("rx spawn objects"); // prevent receiving spawn objects during credits - if (gCurrActStarNum == 99) { return; } + if (gCurrActStarNum == 99) { + LOG_ERROR("rx failed: in credits"); + return; + } u8 objectCount = 0; packet_read(p, &objectCount, sizeof(u8)); @@ -106,6 +122,7 @@ void network_receive_spawn_objects(struct Packet* p) { packet_read(p, &scale[1], sizeof(f32)); packet_read(p, &scale[2], sizeof(f32)); packet_read(p, &data.globalPlayerIndex, sizeof(u8)); + packet_read(p, &data.extendedModelId, sizeof(u8)); struct Object* parentObj = NULL; if (data.parentId == (u8)-1) { @@ -137,6 +154,14 @@ void network_receive_spawn_objects(struct Packet* p) { return; } + // load extended model + if (data.extendedModelId != 0xFF) { + u8 loadedModelId = smlua_model_util_load(data.extendedModelId); + if (loadedModelId != 0xFF) { + data.model = loadedModelId; + } + } + void* behavior = (void*)get_behavior_from_id(data.behaviorId); struct Object* o = spawn_object(parentObj, data.model, behavior); o->globalPlayerIndex = data.globalPlayerIndex; @@ -157,6 +182,7 @@ void network_receive_spawn_objects(struct Packet* p) { } // check if they've allocated one of their reserved sync objects gSyncObjects[o->oSyncID].o = o; + gSyncObjects[o->oSyncID].extendedModelId = data.extendedModelId; } spawned[i] = o;