26 m_worldLocation.Fill(0);
27 m_worldDirection.Fill(0);
35 m_targetEntityId = -1;
163 direction = p_direction;
239 char actionValue[1024];
240 strcpy(copy, p_extra);
251 m_siFile =
new char[strlen(token) + 1];
310 sprintf(extra,
"SUBST:actor_01:%s", name);
317 sprintf(extra,
"SUBST:bush:%s:tree:%s:flwrred:%s:palm:%s", name, name, name, name);
322 sprintf(extra,
"SUBST:haus1:%s", name);
BOOL Moved(ViewROI &rROI)
[AI] Notifies the manager that the ROI has moved and needs spatial update.
BOOL Remove(ViewROI &rROI)
[AI] Removes a ViewROI from the scene.
@ c_brickster
The Brickster ([AI])
@ c_pepper
Pepper Roni ([AI])
MxResult StartEntityAction(MxDSAction &p_dsAction, LegoEntity *p_entity)
[AI] Starts a DSAction for a specific entity, managing controller/actor logic if relevant.
MxBool SwitchSound(LegoEntity *p_entity)
[AI] Cycles the current active sound for a building (if sounds available).
MxBool SwitchMove(LegoEntity *p_entity)
[AI] Cycles the current move/animation state for a building (if moves available).
MxBool SwitchVariant(LegoEntity *p_entity)
[AI] Attempts to switch the building variant for the specified entity (e.g.
MxBool SwitchMood(LegoEntity *p_entity)
[AI] Cycles the current mood state for a building (if moods available, mood in 0.....
MxU32 GetSoundId(LegoEntity *p_entity, MxBool p_state)
[AI] Returns the sound id for a building entity, using either mood or active sound state.
MxBool FUN_10030000(LegoEntity *p_entity)
[AI] Attempts to "progress" demolition/animation of a building entity by calling FUN_10030030 on its ...
MxU32 GetAnimationId(LegoEntity *p_entity)
[AI] Returns the animation id for a building entity, factoring in base animation id and move offset.
void SetWorldTransform(const Vector3 &p_at, const Vector3 &p_dir, const Vector3 &p_up)
Updates the camera's world transformation matrix using view reference parameters.
void FUN_100123e0(const Matrix4 &p_transform, MxU32 p_und)
Sets the camera's transformation matrix in the 3D view, optionally applying a blend with the internal...
MxBool SwitchMood(LegoROI *p_roi)
[AI] Cycles the mood type for the actor, updating the per-actor info.
MxU32 GetSoundId(LegoROI *p_roi, MxBool p_und)
[AI] Returns the sound ID for the ROI's current sound/mood selection.
static const char * GetCustomizeAnimFile()
[AI] Gets the value of the customize animation file variable.
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
MxBool SwitchColor(LegoROI *p_roi, LegoROI *p_targetROI)
[AI] Changes the color of a part of a character's ROI, updating its part info index and updating ROI ...
MxBool SwitchSound(LegoROI *p_roi)
[AI] Cycles the sound type for the actor, updating the per-actor info.
MxBool SwitchVariant(LegoROI *p_roi)
[AI] Cycles through part variants (e.g.
MxBool SwitchMove(LegoROI *p_roi)
[AI] Cycles the move type for the actor, updating the per-actor info.
MxU32 GetAnimationId(LegoROI *p_roi)
[AI] Returns an animation ID corresponding to the ROI's move index.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
MxBool GetUnknown0x10IsSet(MxU8 p_flag)
[AI] Checks if a bit flag in m_unk0x10 is set (purpose: state/animation suppression lock).
void Init()
[AI] Initializes the entity's members to default/neutral values (utility for constructors and resets)...
void SetFlag(MxU8 p_flag)
[AI] Sets the given flag in the flags byte.
virtual void SetROI(LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2)
[AI] Assigns a 3D ROI (3D object instance) to this entity, controlling how it appears/acts in the wor...
void SetLocation(const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up, MxBool p_und)
[AI] Sets the world-space location, direction, and up, applying normalization and transformation.
virtual void SwitchSound()
[AI] Triggers a context-dependent audio/sound variant switch for this entity. [AI]
Mx3DPointFloat GetWorldDirection()
[AI] Gets the normalized world-space direction vector, optionally updating from ROI....
virtual void ClickSound(MxBool p_und)
[AI] Plays a click sound, typically in response to user/AI actions, according to entity type.
virtual void Destroy(MxBool p_fromDestructor)
[AI] Cleans up the entity, detaching ROI and releasing references.
MxS32 m_targetEntityId
[AI] When parsing ACTION command, this is the target entity ID for the action (or -1 for none)....
virtual void SwitchColor(LegoROI *p_roi)
[AI] Switches the color or texture variant for this entity (or target ROI).
MxU8 m_type
[AI] The entity type (Type enum value). [AI]
Mx3DPointFloat m_worldDirection
[AI] Entity direction vector in world space (normalized). [AI]
void FUN_10010c30()
[AI] Updates the camera transformation when this entity is the camera target. Used after movement or ...
MxBool m_cameraFlag
[AI] Set to TRUE if this entity is currently the camera target. [AI]
char * m_siFile
[AI] When parsing ACTION command, this is the SI script/filename to execute (owned,...
Mx3DPointFloat m_worldLocation
[AI] Entity location in world coordinates. [AI]
virtual MxResult Create(MxDSAction &p_dsAction)
[AI] Initializes the entity from a DSAction object, typically from a script or file load.
void ClearFlag(MxU8 p_flag)
[AI] Clears the given flag in the flags byte.
MxLong Notify(MxParam &p_param) override
[AI] Handles event notification for the entity, most notably user clicks, using polymorphic dispatch.
virtual void ResetWorldTransform(MxBool p_cameraFlag)
[AI] Resets the transformation for this entity (e.g., used with camera transitions).
Mx3DPointFloat m_worldUp
[AI] Entity up vector in world space (normalized). [AI]
virtual void SwitchMove()
[AI] Switches movement/animation variant for this entity, if applicable (e.g., walking/running state)...
Extra::ActionType m_actionType
[AI] Action type, parsed from script/extra string (e.g., openram/run/exit); guides Notify() and click...
virtual void SetWorldTransform(const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up)
[AI] Explicitly sets the world transformation (location, direction, up vector) for this entity.
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
MxU8 m_flags
[AI] Primary entity flags (bitfield); tracks per-entity management status, internal update locks,...
virtual void SwitchMood()
[AI] Triggers a mood/state switch for this entity (if supported), often for characters....
void SetType(MxU8 p_type)
[AI] Sets the entity's type (actor/plant/building/etc.) [AI]
Mx3DPointFloat GetWorldUp()
[AI] Gets the normalized world-space up vector, optionally updating from ROI. [AI]
virtual void SwitchVariant()
[AI] Switches variants for this entity (e.g., different animation, mesh, or texture variant),...
virtual void ParseAction(char *p_extra)
[AI] Parses an action description string (usually from script "extra" data) and sets up this entity's...
@ e_plant
[AI] Plant objects in the game (e.g., trees or bushes) [AI]
@ e_unk1
[AI_SUGGESTED_NAME: e_unknown1] Reserved or unused, purpose unclear [AI]
@ e_autoROI
[AI] Catchall for ROI-adapted/unknown entities [AI]
@ e_building
[AI] Building entities, usually interactable or decorations [AI]
@ e_actor
[AI] Standard character entity controlled by scripts or user [AI]
@ c_altBit1
[AI] Used to prevent repeat sound/animation actions while one is in progress [AI]
void SetWorld()
[AI] Registers/attaches this entity to the current world if not already; called on create or location...
@ c_bit1
[AI] Used internally for ROI/entity ownership tracking [AI]
virtual void ClickAnimation()
[AI] Plays a context-sensitive click animation, driven by current entity type and state....
MxU8 m_unk0x10
[AI] Unknown state/flag, used mainly to guard against repeated actions or manage animation/sound stat...
Mx3DPointFloat GetWorldPosition()
[AI] Gets the world-space position vector, optionally updating from ROI. [AI]
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
LegoROI * GetROI()
Returns the ROI (3D Object) associated with this event, if any.
@ e_act3
Act 3: final main story segment. [AI].
@ e_act2
Act 2: main story segment two. [AI].
LegoCharacterManager * GetCharacterManager()
[AI] Returns character manager, handling population and logic for all in-world characters.
LegoAnimationManager * GetAnimationManager()
[AI] Returns animation manager for managing character/world animations.
LegoBuildingManager * GetBuildingManager()
[AI] Returns building manager (handles in-world structures and their logic).
LegoPlantManager * GetPlantManager()
[AI] Returns active plant manager, which tracks in-world plants/objects.
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
MxBool SwitchSound(LegoEntity *p_entity)
[AI] Cycles the sound effect variant for a plant.
static const char * GetCustomizeAnimFile()
[AI] Gets the current file name/path for plant customization animation file.
MxBool SwitchColor(LegoEntity *p_entity)
[AI] Cycles the color attribute for the plant and updates its LOD/appearance.
MxBool SwitchVariant(LegoEntity *p_entity)
[AI] Cycles the variant/type for a plant (flower, tree, bush, palm) and updates appearance.
MxU32 GetSoundId(LegoEntity *p_entity, MxBool p_state)
[AI] Returns the sound ID for a plant, used for localized SFX depending on mood/state.
MxBool FUN_10026c50(LegoEntity *p_entity)
[AI] Triggers a growth decrement or similar on a plant entity, and updates accordingly if possible.
MxBool SwitchMood(LegoEntity *p_entity)
[AI] Cycles the plant's "mood" state property (e.g., for appearance/hidden states) [AI]
MxU32 GetAnimationId(LegoEntity *p_entity)
[AI] Returns the current animation ID for the given plant, based on its variant and move type.
MxBool SwitchMove(LegoEntity *p_entity)
[AI] Cycles the movement/animation type for a plant.
virtual void SetEntity(LegoEntity *p_entity)
[AI] Assign the entity which this controller operates on, typically to associate the point of view wi...
LegoEntity * GetEntity()
[AI] Accessor for the currently attached entity.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
void SetEntity(LegoEntity *p_entity)
[AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic).
const LegoChar * GetName() const
[AI] Gets this ROI's name.
LegoEntity * GetEntity()
[AI] Gets the entity associated with this ROI (or NULL).
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
[AI] Atomized (unique) string identifier, managed by reference counting.
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
void AppendExtra(MxU16 p_extraLength, const char *p_extraData)
[AI] Concatenates or stores extra data associated with this action, robust for multi-part actions.
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
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).
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
MxS32 m_entityId
The unique entity ID, typically used for lookup and reference.
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
const float * GetWorldUp() const
Returns a pointer to the world up vector from the transformation matrix.
const float * GetWorldPosition() const
Returns a pointer to the world position from the transformation matrix (translation row).
const float * GetWorldDirection() const
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
virtual int Unitize()
[AI] Scales the vector so its norm is 1 (unit vector).
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
#define DECOMP_SIZE_ASSERT(T, S)
const char * g_strACTION
[AI] Used as the key for defining an action or command block in game scripts.
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
#define NULL
[AI] Null pointer value (C/C++ semantics).
#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.
Extra::ActionType MatchActionString(const char *)
[AI] Parses an action string to determine the corresponding action type.
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]
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
@ e_lowerCase2
[AI] Alternative or legacy lower case mode, functionally equivalent to e_lowerCase.
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
@ c_notificationClick
[AI] Mouse click event [AI]
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.