96 {
"c_dbbkfny0",
"lego red"}, {
"c_dbbkxly0",
"lego white"},
97 {
"c_chbasey0",
"lego black"}, {
"c_chbacky0",
"lego black"},
98 {
"c_chdishy0",
"lego white"}, {
"c_chhorny0",
"lego black"},
99 {
"c_chljety1",
"lego black"}, {
"c_chrjety1",
"lego black"},
100 {
"c_chmidly0",
"lego black"}, {
"c_chmotry0",
"lego blue"},
101 {
"c_chsidly0",
"lego black"}, {
"c_chsidry0",
"lego black"},
102 {
"c_chstuty0",
"lego black"}, {
"c_chtaily0",
"lego black"},
103 {
"c_chwindy1",
"lego black"}, {
"c_dbfbrdy0",
"lego red"},
104 {
"c_dbflagy0",
"lego yellow"}, {
"c_dbfrfny4",
"lego red"},
105 {
"c_dbfrxly0",
"lego white"}, {
"c_dbhndly0",
"lego white"},
106 {
"c_dbltbry0",
"lego white"}, {
"c_jsdashy0",
"lego white"},
107 {
"c_jsexhy0",
"lego black"}, {
"c_jsfrnty5",
"lego black"},
108 {
"c_jshndly0",
"lego red"}, {
"c_jslsidy0",
"lego black"},
109 {
"c_jsrsidy0",
"lego black"}, {
"c_jsskiby0",
"lego red"},
110 {
"c_jswnshy5",
"lego white"}, {
"c_rcbacky6",
"lego green"},
111 {
"c_rcedgey0",
"lego green"}, {
"c_rcfrmey0",
"lego red"},
112 {
"c_rcfrnty6",
"lego green"}, {
"c_rcmotry0",
"lego white"},
113 {
"c_rcsidey0",
"lego green"}, {
"c_rcstery0",
"lego white"},
114 {
"c_rcstrpy0",
"lego yellow"}, {
"c_rctailya",
"lego white"},
115 {
"c_rcwhl1y0",
"lego white"}, {
"c_rcwhl2y0",
"lego white"},
116 {
"c_jsbasey0",
"lego white"}, {
"c_chblady0",
"lego black"},
117 {
"c_chseaty0",
"lego white"},
148 SetROIColorOverride();
182 for (
MxS16 i = 0; i < m_stateCount; i++) {
189 delete[] m_stateArray;
200 m_actorId = p_actorId;
290 if (WriteVariable(&storage, variableTable,
"backgroundcolor") ==
FAILURE) {
293 if (WriteVariable(&storage, variableTable,
"lightposition") ==
FAILURE) {
297 WriteEndOfVariables(&storage);
302 for (j = 0; j < m_stateCount; j++) {
303 if (m_stateArray[j]->IsSerializable()) {
310 for (j = 0; j < m_stateCount; j++) {
311 if (m_stateArray[j]->IsSerializable()) {
328 MxS16 stateCount = m_stateCount;
334 for (
MxS32 count = 0; count < stateCount; count++) {
335 if (!stateArray[count]->Reset() && stateArray[count]->IsSerializable()) {
336 delete stateArray[count];
340 stateArray[count] =
NULL;
365 MxS16 count, actArea;
366 const char* lightPosition;
370 if (version != 0x1000c) {
371 OmniError(
"Saved game version mismatch", 0);
379 storage.
ReadU8(m_actorId);
385 status = ReadVariable(&storage, variableTable);
389 }
while (status != 2);
415 for (
MxS16 i = 0; i < count; i++) {
433 if (m_currentAct ==
e_act1) {
445 OmniError(
"Game state loading was not successful!", 0);
454 if (m_savePath !=
NULL) {
459 m_savePath =
new char[strlen(p_savePath) + 1];
460 strcpy(m_savePath, p_savePath);
472 const char* variableValue = p_from->
GetVariable(p_variableName);
475 MxU8 length = strlen(p_variableName);
476 if (p_storage->
Write(&length,
sizeof(length)) !=
SUCCESS) {
480 if (p_storage->
Write(p_variableName, length) !=
SUCCESS) {
484 length = strlen(variableValue);
485 if (p_storage->
Write(&length,
sizeof(length)) !=
SUCCESS) {
489 result = p_storage->
Write(variableValue, length);
516 if (p_storage->
Read(&len,
sizeof(len)) !=
SUCCESS) {
521 assert(len <
sizeof(varName));
534 if (p_storage->
Read(&len,
sizeof(len)) !=
SUCCESS) {
539 assert(len <
sizeof(value));
557 char baseForSlot[2] =
"0";
558 char path[1024] =
"";
561 if (m_savePath !=
NULL) {
562 strcpy(path, m_savePath);
567 baseForSlot[0] += p_slotn;
568 strcat(path, baseForSlot);
630 if (p_playerId > 0) {
640 for (
MxS16 i = p_playerId; i > 0; i--) {
661 if (memcmp(&
m_players[i], &p_player,
sizeof(p_player)) == 0) {
1015 if (act2main ==
NULL) {
1053void LegoGameState::SetColors()
1063void LegoGameState::SetROIColorOverride()
1071 if (p_output !=
NULL && p_copyLen != 0 &&
1072 (strnicmp(p_input,
"INDIR-F-", strlen(
"INDIR-F-")) == 0 ||
1073 strnicmp(p_input,
"INDIR-G-", strlen(
"INDIR-F-")) == 0)) {
1076 sprintf(buf,
"c_%s", &p_input[strlen(
"INDIR-F-")]);
1079 if (value !=
NULL) {
1080 strncpy(p_output, value, p_copyLen);
1081 p_output[p_copyLen - 1] =
'\0';
1093 for (
MxS32 i = 0; i < m_stateCount; ++i) {
1094 if (m_stateArray[i]->IsA(p_stateName)) {
1095 return m_stateArray[i];
1119 for (targetIndex = 0; targetIndex < m_stateCount; ++targetIndex) {
1120 if (m_stateArray[targetIndex]->IsA(p_state->
ClassName())) {
1125 if (targetIndex == m_stateCount) {
1128 if (m_stateCount != 0) {
1129 memcpy(newBuffer, m_stateArray, m_stateCount *
sizeof(
LegoState*));
1130 delete[] m_stateArray;
1133 newBuffer[m_stateCount++] = p_state;
1134 m_stateArray = newBuffer;
1137 delete m_stateArray[targetIndex];
1138 m_stateArray[targetIndex] = p_state;
1145 m_backgroundColor->
SetValue(
"set 56 54 68");
1147 m_tempBackgroundColor->
SetValue(
"set 56 54 68");
1161 if (m_loadedAct ==
e_act1) {
1221 if (!videomanager || !p_colorString) {
1225 float convertedR, convertedG, convertedB;
1226 char* colorStringCopy = strcpy(
new char[strlen(p_colorString) + 1], p_colorString);
1227 char* colorStringSplit = strtok(colorStringCopy,
g_delimiter);
1229 if (!strcmp(colorStringSplit,
g_set)) {
1231 if (colorStringSplit) {
1232 m_h = (float) (atoi(colorStringSplit) * 0.01);
1235 if (colorStringSplit) {
1236 m_s = (float) (atoi(colorStringSplit) * 0.01);
1239 if (colorStringSplit) {
1240 m_v = (float) (atoi(colorStringSplit) * 0.01);
1243 ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
1244 videomanager->
SetSkyColor(convertedR, convertedG, convertedB);
1246 else if (!strcmp(colorStringSplit,
g_reset)) {
1247 ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
1248 videomanager->
SetSkyColor(convertedR, convertedG, convertedB);
1251 delete[] colorStringCopy;
1273 sprintf(buffer,
"set %d %d %d", (
MxU32) (m_h * 100.0f), (
MxU32) (m_s * 100.0f), (
MxU32) (m_v * 100.0f));
1276 float convertedR, convertedG, convertedB;
1277 ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
1293 sprintf(buffer,
"set %d %d %d", (
MxU32) (m_h * 100.0f), (
MxU32) (m_s * 100.0f), (
MxU32) (m_v * 100.0f));
1296 float convertedR, convertedG, convertedB;
1297 ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
1306 if (!
VideoManager()->GetVideoParam().Flags().GetF2bit0()) {
1332 float convertedR, convertedG, convertedB;
1333 ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
1376 p_storage->
ReadS16(m_letters[i]);
1392 memcpy(m_letters, p_other.
m_letters,
sizeof(m_letters));
1401 p_storage->
ReadS16(m_totalScore);
1403 for (
MxS32 i = 0; i < 5; i++) {
1404 for (
MxS32 j = 0; j < 5; j++) {
1405 p_storage->
ReadU8(m_scores[i][j]);
1409 m_name.Serialize(p_storage);
1410 p_storage->
ReadS16(m_unk0x2a);
1415 for (
MxS32 i = 0; i < 5; i++) {
1416 for (
MxS32 j = 0; j < 5; j++) {
1417 p_storage->
WriteU8(m_scores[i][j]);
1421 m_name.Serialize(p_storage);
1440 MxS16 totalScore = 0;
1453 for (
MxS32 actor = 1; actor <= 5; actor++) {
1455 totalScore += scores[0][actor - 1];
1458 totalScore += scores[1][actor - 1];
1460 scores[2][actor - 1] = pizzaMissionState ? pizzaMissionState->
GetHighScore(actor) : 0;
1461 totalScore += scores[2][actor - 1];
1463 scores[3][actor - 1] = towTrackMissionState ? towTrackMissionState->
GetHighScore(actor) : 0;
1464 totalScore += scores[3][actor - 1];
1466 scores[4][actor - 1] = ambulanceMissionState ? ambulanceMissionState->
GetHighScore(actor) : 0;
1467 totalScore += scores[4][actor - 1];
1473 if (p_scorehist !=
NULL) {
1479 m_scores[m_count].m_totalScore = totalScore;
1480 memcpy(m_scores[m_count].m_scores, scores,
sizeof(m_scores[m_count].m_scores));
1485 else if (m_scores[19].m_totalScore <= totalScore) {
1486 m_scores[19].m_totalScore = totalScore;
1487 memcpy(m_scores[19].m_scores, scores,
sizeof(m_scores[19].m_scores));
1493 MxU8 tmpScores[5][5];
1498 for (
MxS32 i = m_count - 1; i > 0; i--) {
1499 for (
MxS32 j = 1; j <= i; j++) {
1500 if (m_scores[j - 1].m_totalScore < m_scores[j].m_totalScore) {
1501 memcpy(tmpScores, m_scores[j - 1].m_scores,
sizeof(tmpScores));
1502 tmpPlayer = m_scores[j - 1].m_name;
1503 tmpUnk0x2a = m_scores[j - 1].m_unk0x2a;
1505 memcpy(m_scores[j - 1].m_scores, m_scores[j].m_scores,
sizeof(m_scores[j - 1].m_scores));
1506 m_scores[j - 1].m_name = m_scores[j].m_name;
1507 m_scores[j - 1].m_unk0x2a = m_scores[j].m_unk0x2a;
1509 memcpy(m_scores[j].m_scores, tmpScores,
sizeof(m_scores[j].m_scores));
1510 m_scores[j].m_name = tmpPlayer;
1511 m_scores[j].m_unk0x2a = tmpUnk0x2a;
1527 for (; i < m_count; i++) {
1528 if (!memcmp(p_player, &m_scores[i].m_name,
sizeof(*p_player)) && m_scores[i].m_unk0x2a == p_unk0x24) {
1539 return &m_scores[i];
1547 p_storage->
ReadS16(m_unk0x372);
1550 for (
MxS16 i = 0; i < m_count; i++) {
1553 m_scores[i].Serialize(p_storage);
1560 for (
MxS16 i = 0; i < m_count; i++) {
1562 m_scores[i].Serialize(p_storage);
1589 m_currentAct = p_currentAct;
[AI] Defines enumerated script action identifiers for Act 3 of LEGO Island scripting system.
[AI] Holds state and transient gameplay data for the first act on Lego Island.
MxU32 GetUnknown18()
[AI] Retrieves the internal state variable at offset 0x018 (purpose: current major state,...
Holds state and scoring information for the Ambulance mission.
MxS16 GetHighScore(MxU8 p_actorId)
[AI] Retrieves the highest score achieved by a specified actor.
The state object used for the car race mini-game.
[AI] Represents the player-controllable dune buggy vehicle in LEGO Island, inheriting movement and in...
[AI] Represents the flyable helicopter vehicle/path actor in the game, handling all in-game behaviors...
[AI] Represents the state of the Infocenter area, storing scripts, dialogue playlists and UI letter p...
MxStillPresenter * m_letters[7]
[AI] UI presenters for each slot in the 7-letter name entry field (could be player's registered name)...
MxBool HasRegistered()
[AI] True if any letter slot is filled (indicating the player has registered).
Derived path actor type for handling player transitions and activities on LEGO Island.
@ c_spawnBit1
[AI] Bit flag to trigger additional camera/animation sequence during spawn. [AI]
@ c_playMusic
[AI] Bit flag to trigger background music playback on spawn. [AI]
@ c_spawnBit3
[AI] Unused/reserved extra spawn bit in flag set. [AI]
MxResult Create(MxDSAction &p_dsAction) override
[AI] Initialize this actor from a DSAction.
[AI] Represents the main overworld (LEGO Island) in the game, acting as the central hub and state mac...
virtual void VTable0x6c(LegoPathActor *p_actor)
[AI] Removes a path-based actor (vehicle, etc.) from the Isle world and unbinds pointers as needed.
[AI] Per-race state data and logic holder for JetskiRace, used for tracking player and AI standings,...
[AI] Represents the jetski vehicle placed in the 3D world of LEGO Island.
int SetFrustrum(float p_fov, float p_front, float p_back)
[AI] Sets the 3D perspective frustum parameters for camera and view.
BOOL Add(ViewROI &rROI)
[AI] Adds a ViewROI (rendered object) to the scene.
Lego3DView * GetLego3DView()
[AI] Returns the encapsulated Lego3DView instance.
BOOL Remove(ViewROI &rROI)
[AI] Removes a ViewROI from the scene.
static const char * GetActorName(MxU8 p_id)
[AI] Gets the static display name of an actor by ID.
virtual void SetActorId(MxU8 p_actorId)
[AI] Sets the actor's numeric ID.
void SetROI(LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2) override
[AI] Sets the Region of Interest (ROI, i.e.
void Reset(MxBool p_und)
[AI] Resets all internal state; optionally resets animation state too.
void Resume()
[AI] Resumes animation manager from suspension, restoring all previously suspended state.
void Suspend()
[AI] Suspends all activity, saving out transition/animation state, and disables extra processing.
Variable controlling the sky background color (HSV) and related light color in the game.
void SetLightColor()
Sets the light color according to the current HSV parameters. [AI].
void SetValue(const char *p_colorString) override
Sets the value of the background color using a command string.
void SetLightColor(float p_r, float p_g, float p_b)
Sets the global scene light color based on RGB values.
void ToggleSkyColor()
Rotates hue to cycle sky color (e.g. progressing through the day), updating all visuals....
void ToggleDayNight(MxBool p_sun)
Adjusts the saturation (day/night) and updates sky color and light accordingly.
void Init()
[AI] Initializes all manager fields, resets animation tracking, and loads the default building info a...
MxResult Write(LegoStorage *p_storage)
[AI] Serializes current building state to the given storage.
MxResult Write(LegoStorage *p_storage)
[AI] Writes the persistent character info data to a storage object.
void Init()
[AI] Initializes all actor info structures based on their templates/defaults.
LegoROI * GetActorROI(const char *p_name, MxBool p_createEntity)
[AI] Returns a LegoROI for the given character name, creating and registering the actor if necessary.
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
void ClearFlag(MxU8 p_flag)
[AI] Clears the given flag in the flags byte.
virtual void ResetWorldTransform(MxBool p_cameraFlag)
[AI] Resets the transformation for this entity (e.g., used with camera transitions).
@ c_managerOwned
[AI] Indicates this entity is managed/owned by an entity manager [AI]
Implementation of LegoStorage for file-backed storage using stdio FILE*.
LegoResult Open(const char *p_name, LegoU32 p_mode)
Opens a file with given name and mode, closing existing file if needed.
Variable controlling full screen movie playback in the video manager.
LegoFullScreenMovie(const char *p_key, const char *p_value)
Construct with variable name and value ("fsmovie", "disable"/"enable"). [AI].
void SetValue(const char *p_option) override
Sets the option to enable or disable fullscreen movies.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
void GetFileSavePath(MxString *p_outPath, MxS16 p_slotn)
Writes the full save path for the given slot to the output string object.
MxS16 m_playerCount
Number of player usernames registered. [AI].
void SwitchPlayer(MxS16 p_playerId)
Make the specified player (by ID/index) the current player.
void SerializeScoreHistory(MxS16 p_flags)
Serializes the score history table to score file.
MxS16 m_unk0x24
Serial/generation marker used for score records. [AI].
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
JukeboxScript::Script m_jukeboxMusic
Which jukebox music is currently set to play. [AI].
History m_history
High score table/history for current game. [AI].
void SetCurrentAct(Act p_currentAct)
Sets the current game act.
void Init()
Re-initializes all world/variable state to the current act's defaults. [AI].
void ResetROI()
Re-applies the current actor's ROI to the 3D world (remove/add for update). [AI].
Area m_currentArea
Area/world the player is presently in. [AI].
MxBool m_isDirty
TRUE if unsaved changes present. [AI].
Area m_unk0x42c
Used for act area storage on save/load. [AI].
void SetSavePath(char *p_savePath)
Sets the path for current save slot directory; creates a copy of input string.
LegoState * CreateState(const char *p_stateName)
Creates an instance of given state, registers it, and returns pointer.
Act
Indicates which main storyline section (Act 1/2/3) is currently active.
@ e_act3
Act 3: final main story segment. [AI].
@ e_act1
Act 1: the first main segment of the game. [AI].
@ e_actNotFound
No act currently loaded (does not correspond to valid play). [AI].
@ e_act2
Act 2: main story segment two. [AI].
void StopArea(Area p_area)
Calls cleanup logic for the specified area (removes actors, VMs, closes handles, etc....
void RegisterState(LegoState *p_state)
Registers a state object, replacing by class if already present.
MxResult DeleteState()
Destroys and removes all current state objects, freeing memory and unregistering. [AI].
void SerializePlayersInfo(MxS16 p_flags)
Serializes all player info (usernames, player count) to the appropriate storage.
Area m_previousArea
Where player was before last area switch. [AI].
Username m_players[9]
Array of all known player usernames (max 9, ranked). [AI].
MxResult Save(MxULong p_slot)
Saves persistent game state (world variables, actor, etc.) to a file slot.
void RemoveActor()
Removes (and deletes) the current user actor from the world.
void FindLoadedAct()
Analyses the loaded Lego worlds to determine which act is present. [AI].
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
MxS16 FindPlayer(Username &p_player)
Finds the player index for a username; returns -1 if not found.
Area
Enumeration of all major in-game locations ("areas") for area/scene management and serialization.
@ e_infomain
Information Center, main screen. [AI].
@ e_previousArea
Alias: go to previous area. [AI].
@ e_motocycle
Motorcycle (vehicle, spawn). [AI].
@ e_dunecarbuild
Vehicle construction: dune buggy. [AI].
@ e_racecarbuild
Vehicle construction: racecar. [AI].
@ e_bike
Bike minigame (spawns). [AI].
@ e_police
Police Station interior. [AI].
@ e_elevdown
Elevator moving down (animated). [AI].
@ e_copter
Helicopter (vehicle, spawn). [AI].
@ e_unk66
Used for some spawn locations. [AI].
@ e_hospitalExterior
Hospital, seen from outside. [AI].
@ e_dunecar
Dune buggy (vehicle, for spawn). [AI].
@ e_act3script
Act 3 world/script main. [AI].
@ e_act2main
Act 2 world main screen. [AI].
@ e_jetraceExterior
Jetski race transition? [AI].
@ e_carrace
Car race (track, main). [AI].
@ e_elevride2
Elevator ride/cab down (animated). [AI].
@ e_garageExterior
Garage (vehicle construction) exterior. [AI].
@ e_garage
Garage (build vehicle) interior. [AI].
@ e_garadoor
Garage door or doorway. [AI].
@ e_copterbuild
Vehicle construction: helicopter. [AI].
@ e_jetrace
Jetski race area, "interior"/main. [AI].
@ e_polidoor
Police Station door. [AI].
@ e_jukeboxw
Western Jukebox (special minigame). [AI].
@ e_isle
Open world (LEGO Island main map). [AI].
@ e_regbook
Registration book "new game" area. [AI].
@ e_histbook
History book (scoreboard). [AI].
@ e_jetrace2
Jetski race (exterior). [AI].
@ e_pizzeriaExterior
Pizzeria, seen from outside. [AI].
@ e_unk28
Used for certain spawn locations. [AI].
@ e_infoscor
Info Center hi-score area. [AI].
@ e_undefined
Undefined or unset area. [AI].
@ e_unk33
Used for certain player spawns. [AI].
@ e_skateboard
Skateboard (vehicle, spawn). [AI].
@ e_elevride
Elevator ride/cab up (animated). [AI].
@ e_jetskibuild
Vehicle construction: jetski. [AI].
@ e_unk4
Unknown / possibly reserved. [AI].
@ e_jukeboxExterior
Jukebox, seen from outside. [AI].
@ e_elevbott
Elevator bottom. [AI].
@ e_observe
Observatory interior. [AI].
@ e_hospital
Hospital interior. [AI].
@ e_policeExterior
Police Station, from outside. [AI].
@ e_carraceExterior
Car race exterior/transition. [AI].
@ e_infodoor
Info Center door/title view. [AI].
@ e_seaview
Ocean-side view at observatory. [AI].
@ e_elevopen
Elevator doors open. [AI].
@ e_jetski
Jetski (vehicle, spawn). [AI].
MxResult Load(MxULong p_slot)
Loads persistent game state from specified save slot.
void SetActor(MxU8 p_actorId)
Change the player character in the world to the given actor ID.
MxResult AddPlayer(Username &p_player)
Adds a new player (username), moves others down, manages slot files.
static MxResult UpdateLocation(MxU32 p_location)
[AI] Static: Changes the current world/camera location to the specified index in the location registr...
void RemoveWorld(const MxAtomId &p_atom, MxLong p_objectId)
[AI] Removes worlds by Atom and/or id, deleting matching entries from the world list and freeing reso...
@ c_disable3d
[AI] When set, disables 3D rendering. [AI]
@ c_disableInput
[AI] When set, disables input processing. [AI]
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
void SetBoundary(LegoPathBoundary *p_boundary)
[AI] Assigns a new boundary for the actor (for path switching).
LegoPathBoundary * GetBoundary()
[AI] Retrieves the current path boundary associated with this actor.
MxResult Write(LegoStorage *p_storage)
[AI] Serializes persistent plant state (color, variant, mood, animation, etc) to storage for save gam...
void Init()
[AI] Zeroes out state, resets world ID, and copies default plant info to runtime plant info array.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
static void SetColorOverride(ColorOverride p_colorOverride)
[AI] [Static] Sets the global color override callback function to allow palette remapping or customiz...
[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the...
virtual MxResult Serialize(LegoStorage *p_storage)
[AI] Serialize state to a storage (for save/load).
const char * ClassName() const override
[AI] Gets this class's name for RTTI/IsA functionality.
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
virtual LegoResult Write(const void *p_buffer, LegoU32 p_size)=0
Write bytes from buffer into storage.
LegoStorage * WriteU8(LegoU8 p_data)
Writes an 8-bit unsigned value to storage.
virtual LegoBool IsWriteMode()
Returns TRUE if object was opened in write mode.
LegoStorage * ReadU8(LegoU8 &p_data)
Reads an 8-bit unsigned value from storage.
LegoStorage * WriteS16(LegoS16 p_data)
Writes a 16-bit signed value to storage.
LegoStorage * ReadS16(LegoS16 &p_data)
Reads a 16-bit signed value from storage.
LegoStorage * ReadS32(MxS32 &p_data)
Reads a 32-bit signed value from storage.
virtual LegoResult Read(void *p_buffer, LegoU32 p_size)=0
Read bytes from storage into buffer.
virtual LegoBool IsReadMode()
Returns TRUE if object was opened in read mode.
LegoStorage * ReadString(char *p_data)
Reads a length-prefixed string from storage.
LegoStorage * WriteU16(LegoU16 p_data)
Writes a 16-bit unsigned value to storage.
@ c_read
Open for read operations. [AI].
@ c_write
Open for write operations. [AI].
LegoStorage * WriteS32(MxS32 p_data)
Writes a 32-bit signed value to storage.
[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphic...
void EnableFullScreenMovie(MxBool p_enable)
[AI] Convenience method to enable or disable fullscreen movie playback with default scaling.
void SetUnk0x554(MxBool p_unk0x554)
[AI] Used to control a non-interactive, non-main rendering update (PutData only).
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
void SetSkyColor(float p_red, float p_green, float p_blue)
[AI] Sets the RGB color for the sky/background in the 3D view and updates the palette accordingly.
void SetLightColor(BOOL bDirectionalLight, float red, float green, float blue)
[AI] Sets the RGB color for either the sun or directional light.
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
MxBool GetUnknown0xd0Empty()
Checks if the 'set0xd0' set is empty.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
virtual MxCore * Create(const char *p_name)
[AI] Creates a new instance of the class matching the provided string name.
Mindscape custom string class for managing dynamic C-strings within the game engine.
char * GetData() const
Returns a pointer to the internal character buffer.
void ToLowerCase()
Converts the string contents to lowercase in-place.
void ToUpperCase()
Converts the string contents to uppercase in-place.
MxVariableTable is a specialized hash table for storing key/value string variables used by the LEGO I...
const char * GetVariable(const char *p_key)
Returns the value for the variable with a given key, or an empty string if not found.
void SetVariable(const char *p_key, const char *p_value)
Sets a variable by key and value, replacing or updating if it exists.
MxString m_key
[AI] The variable's key (name), always stored in uppercase.
MxString m_value
[AI] The variable's value.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
Pizza mission state for the pizza delivery minigame and related characters.
MxS16 GetHighScore(MxU8 p_actorId)
Retrieves the historical best (high) score for a given actor's pizza mission.
[AI] Represents the drivable race car entity in the LEGO Island world.
Entry * GetState(MxU8 p_id)
[AI] Fetches a race state entry matching the given entry ID, or NULL if not found in the array.
[AI] State class for the TowTrack mini-game, storing scores by character and handling their serializa...
MxS16 GetHighScore(MxU8 p_actorId)
[AI] Retrieves the highscore for a given actor in the Tow Track mini-game.
#define DECOMP_SIZE_ASSERT(T, S)
[AI] Contains enumeration of script actions for ElevbottScript.
[AI] Enumerates all script elements used in the "Garage" sequence of LEGO Island.
const char * g_strDisable
ColorStringStruct g_colorSaveData[43]
const char * g_endOfVariables
const char * g_historyGSI
const char * g_fileExtensionGS
MxBool ROIColorOverride(const char *p_input, char *p_output, MxU32 p_copyLen)
Helper for ROI color override mechanism, mapping special part labels to variable table values.
const char * g_playersGSI
MxBool ROIColorOverride(const char *p_input, char *p_output, MxU32 p_copyLen)
Helper for ROI color override mechanism, mapping special part labels to variable table values.
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
MxBool RemoveFromWorld(MxAtomId &p_entityAtom, MxS32 p_entityId, MxAtomId &p_worldAtom, MxS32 p_worldEntityId)
[AI] Removes a game object referenced by atom/id from a specific world, handling presenters and EndAc...
void SetCameraControllerFromIsle()
[AI] Updates the current camera controller to the main ISLE camera specified in the global script.
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float *p_rOut, float *p_bOut, float *p_gOut)
[AI] Converts HSV color (hue/saturation/value) to RGB (red/green/blue).
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
void SetLightPosition(MxS32 p_index)
[AI] Sets the world space position and direction of the in-game directional light,...
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
void SetUserActor(LegoPathActor *p_userActor)
[AI] Sets the user-controlled LegoPathActor in the engine.
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
LegoWorld * FindWorld(const MxAtomId &p_atom, MxS32 p_entityid)
[AI] Searches for or retrieves a LegoWorld instance based on an atom id and entity id.
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [AI]
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
MxObjectFactory * ObjectFactory()
[AI] Returns the factory for creating core engine objects from atom/type ids.
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
@ c_notificationType20
[AI] Unspecified notification type [AI]
void OmniError(const char *p_message, MxS32 p_status)
Displays or logs an error message using the current user message handler, or aborts on error status i...
@ c__Act2Main
[AI] Root script or entry point for Act2Main actions.
@ c__Act3
[AI] Reserved or unnamed root action for Act 3 scripting context. [AI]
@ c__CarRace_World
[AI] Root node/world object for the Car Race script instance.
@ c_nrt002pz_Anim
[AI] Triggers the animation sequence for "nrt002pz".
@ c_Helicopter_Actor
[AI] Main helicopter actor logic entry/action.
@ c__StartUp
[AI] Start-up/initialization logic for the copter script context.
@ c__StartUp
[AI] Startup or initial script event.
@ c_DuneBugy_Actor
[AI] ID for the main Dune Buggy actor instance.
@ c__StartUp
[AI] Action for system or scene startup logic in the Elevbott context.
@ c__StartUp
[AI] Triggers Garage start-up logic or animation. [AI]
@ c__StartUp
[AI] Script ID for Histbook startup/init routine.
@ c__StartUp
[AI] Corresponds to the startup/initialization event. [SI file: StartUp]
@ c__InfoMain
[AI] Root script or entrypoint for InfoMain. Used to identify the main script file/context for scene ...
@ c_ElevDown_LeftArrow_Ctl
@ c_ElevOpen_RightArrow_Ctl
@ c_Observe_GlobeRArrow_Ctl
@ c_Observe_Globe4_Bitmap
@ c_SeaView_Background_Bitmap
@ c_Observe_Background_Bitmap
@ c_PoliDoor_LeftArrow_Ctl
@ c_PoliDoor_RightArrow_Ctl
@ c_ElevDown_Background_Bitmap
@ c_GaraDoor_Background_Bitmap
@ c_Observe_Globe2_Bitmap
@ c_Observe_RightArrow_Ctl
@ c_PoliDoor_Background_Bitmap
@ c_Observe_Globe5_Bitmap
@ c_Observe_Globe1_Bitmap
@ c_GaraDoor_RightArrow_Ctl
@ c_ElevRide_Background_Bitmap
@ c_Observe_Globe3_Bitmap
@ c_ElevOpen_LeftArrow_Ctl
@ c_Observe_LeftArrow_Ctl
@ c_Observe_Globe6_Bitmap
@ c_ElevDown_RightArrow_Ctl
@ c_ElevOpen_Background_Bitmap
@ c_GaraDoor_LeftArrow_Ctl
@ c_Observe_GlobeLArrow_Ctl
@ c_SeaView_RightArrow_Ctl
@ c_ElevDown_Elevator_Ctl
@ c_SeaView_LeftArrow_Ctl
@ c__JetRace_World
[AI] Root world scene object for JetRace area.
@ c__StartUp
[AI] Start-up/bootstrapping script, likely called at initialization. [AI]
@ c_Jetski_Actor
[AI] Main jetski actor entity script. [AI]
@ c_DuneCarBuild_Movie
[AI] Movie/cutscene for Dune Car build sequence.
@ c_JetskiBuild_Movie
[AI] Movie/cutscene for Jetski build sequence.
@ c_RaceCarBuild_Movie
[AI] Movie/cutscene for Race Car build sequence.
@ c_noneJukebox
[AI] Special value representing that no Jukebox script is selected or active.
@ c_HelicopterBuild_Movie
[AI] Movie/cutscene that plays during the helicopter build.
@ c__StartUp
[AI] Start-up action for the Jukeboxw component, usually for initialization sequence....
@ c__StartUp
[AI] Startup/init action for the Racecar script context. Should be first action executed.
@ c_RaceCar_Actor
[AI] Script action corresponding to the main interactive racecar actor.
@ c__StartUp
[AI] Initial startup action/script. [AI]
@ c_SoundAndAnim_Action
[AI] Main action combining sound and animation. [AI]
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_infoscorScript
[AI] Script AtomId for the Info Center scoring/stat script.
MxAtomId * g_act3Script
[AI] Script AtomId for Act 3 (endgame/helicopter chase) scripting.
MxAtomId * g_policeScript
[AI] Script AtomId for the police station script logic.
MxAtomId * g_regbookScript
[AI] Script AtomId for the registration book script (name entry).
MxAtomId * g_histbookScript
[AI] Script AtomId for the history book script (view records).
MxAtomId * g_jukeboxScript
[AI] Script AtomId for the Jukebox entity/event script.
MxAtomId * g_infodoorScript
[AI] Script AtomId for the Info Center door logic script.
MxAtomId * g_carracerScript
[AI] Script AtomId for the car racer entity or race logic.
MxAtomId * g_infomainScript
[AI] Script AtomId for the main Info Center world/event script.
MxAtomId * g_racecarScript
[AI] Script AtomId for the build/race car SI file.
MxAtomId * g_garageScript
[AI] Script AtomId for the vehicle garage/world logic.
MxAtomId * g_sndAnimScript
[AI] Script AtomId for sound animation or related cutscenes.
MxAtomId * g_copterScript
[AI] Script AtomId for the helicopter ("copter") build or activity.
MxAtomId * g_jetskiScript
[AI] Script AtomId for the jet ski-related script.
MxAtomId * g_jetraceScript
[AI] Script AtomId for jet racing-related scripts.
MxAtomId * g_elevbottScript
[AI] Script AtomId for the elevator bottom script in Info Center.
MxAtomId * g_hospitalScript
[AI] Script AtomId for the hospital SI logic.
MxAtomId * g_act2mainScript
[AI] Script AtomId for main script of Act 2 (island event progression).
MxAtomId * g_dunecarScript
[AI] Script AtomId for the dune car building or mission script.
MxAtomId * g_jetracerScript
[AI] Script AtomId for a jet racer entity or event.
MxAtomId * g_carraceScript
[AI] Script AtomId for the car racing event script.
MxAtomId * g_jukeboxwScript
[AI] Script AtomId for the JukeboxW (alternate or special jukebox) script.
Key-value pair tying a ROI color key name to a LEGO color string.
ScoreItem * FUN_1003cc90(Username *p_player, MxS16 p_unk0x24, MxS32 &p_unk0x2c)
Looks up a score entry for player and attempt index, or returns NULL if not found.
MxS16 m_unk0x372
Serial/sequence field incremented for each player. [AI].
void WriteScoreHistory()
Rebuilds the high score table from current state objects, sorts it descending. [AI].
MxResult Serialize(LegoStorage *p_storage)
Serializes whole history, including all score item slots, to the provided storage/backend....
Single score record for a player, including high score grids for all major games.
MxResult Serialize(LegoStorage *p_storage)
Reads/writes the ScoreItem to/from storage.
MxS16 m_totalScore
The total score calculated from all minigames. [AI].
MxU8 m_scores[5][5]
Scores by (minigame,row,column): custom packed format for all 5 game types. [AI].
Player "username", stored as 7 short integers (character codes).
MxS16 m_letters[7]
Array of 7 wide characters: player name (filled by registration). [AI].
void Set(Username &p_other)
Set this username by copying another.
Username & operator=(const Username &p_other)
Assignment, deep-copy of letter buffer [AI].
MxResult Serialize(LegoStorage *p_storage)
Reads or writes username as S16 array to/from the given storage.
MxS16 GetHighScore()
[AI] Retrieves the race entry's current high score.