IdaJS
    Preparing search index...

    Interface GameObject

    Interface representing a game object (actor) in the scene.

    The player, NPCs, but also doors, interractable items, anything that can move or interract in the 3D space of the scene - those are all game objects.

    The setters in the object can only be used in the scene setup phase (see SceneEvents.afterLoadScene event).

    interface GameObject {
        disable(): void;
        getAngle(): number;
        getAnimation(): number;
        getArmor(): number;
        getBody(): number;
        getBonusFlags(): number;
        getBonusQuantity(): number;
        getControlMode(): ControlMode;
        getEntity(): number;
        getHitPower(): number;
        getId(): number;
        getLifePoints(): number;
        getLifeScript(): boolean;
        getMoveScript(): boolean;
        getPos(): number[];
        getRegisters(): [number, number, number, number];
        getRotationSpeed(): number;
        getSpriteId(): number;
        getStaticFlags(): number;
        getTalkColor(): DialogColor;
        handleLifeScript(callback?: (objectId: number) => boolean | void): void;
        handleMoveScript(): void;
        isDisabled(): boolean;
        isFacingZoneDirection(zoneId: number, direction?: ZoneDirection): boolean;
        setAngle(angle: number): void;
        setAnimation(animation: number): void;
        setArmor(armor: number): void;
        setBody(body: number): void;
        setBonusFlags(bonusFlags: number): void;
        setBonusQuantity(bonusQuantity: number): void;
        setControlMode(controlMode: ControlMode): void;
        setEntity(entity: number): void;
        setHitPower(hitPower: number): void;
        setLifePoints(lifePoints: number): void;
        setPos(pos: number[]): void;
        setRegisters(registers: [number, number, number, number]): void;
        setRotationSpeed(rotationSpeed: number): void;
        setSpriteId(spriteId: number): void;
        setStaticFlags(staticFlags: number): void;
        setTalkColor(talkColor: DialogColor): void;
    }
    Index

    Methods

    • Returns the current angle of the object around Y in 0-4096 degrees.

      Returns number

    • Returns the animation id of a 3D object.

      Returns number

    • Returns the armor value of the object.

      Returns number

    • Returns the body type of a 3D object.

      Returns number

    • Returns the bonus quantity of the object.

      Returns number

    • Returns the entity index of a 3D object.

      Returns number

    • Returns the hit power of the object.

      Returns number

    • Returns the id of the object (the index of the object in the scene).

      Returns number

    • Returns the life points of the object.

      Returns number

    • Returns true if the life script is present for this object.

      Returns boolean

    • Returns true if the move script is present for this object.

      Returns boolean

    • Returns the current position of the object in the world.

      Returns number[]

      Array of 3 values representing the position as [x, y, z]

    • Returns array of 4 values that represent the object info registers When clipping is used, it is clipping information of the object as: [Left, Top, Right, Bottom]. When Move randomly mode is used, the #3 register contains the random interval. When following on actor the #3 register contains the actor ID.

      Returns [number, number, number, number]

    • Returns the rotation speed of the object. LBArchitect shows rotation delay instead. Rotation speed is connected to the delay by the formula: speed = 50 * 1024 / delay

      Returns number

    • Returns the sprite ID for a sprite object.

      Returns number

    • If called, the life script of this object will be handled by Ida. It is still possible to execute the vanilla life script of the object afterwards (controlled by the callback return value).

      Parameters

      • Optionalcallback: (objectId: number) => boolean | void

        The user function containing custom life commands for this object, will be called each frame. This function should return true if the vanilla life script should be executed afterwards, false or nothing otherwise. If callback is not specified, no life scripts will be executed for this object.

      Returns void

    • If called, the move script of this object will be handled by Ida, so it will enable Ida coroutines for this object. This action is irreversible in the context of the current loaded scene. No more vanilla move script will be executed for this object until the scene is reloaded.

      Returns void

    • Returns true if the object is facing the specified zone direction. This should usually be used with the sceneric zones, when you already checked the player is inside the zone.

      Parameters

      • zoneId: number

        The ID of the zone to check.

      • Optionaldirection: ZoneDirection

        The direction to check against this zone. If not specified or 0, it checks if the object is facing the direction from Info2 register of the zone.

      Returns boolean

    • Sets the angle of the object around Y in 0-4096 degrees.

      Parameters

      • angle: number

        The angle value.

      Returns void

    • Sets the animation id of a 3D object.

      Parameters

      • animation: number

        The animation id. You can view all the animation ids for a particular 3D entity, using Ida/Samples/animations sample.

      Returns void

    • Sets the armor value of the object.

      Parameters

      • armor: number

        The armor value.

      Returns void

    • Sets the body type of a 3D object.

      Parameters

      • body: number

        The body id. You can view all the body ids for a particular 3D entity, using Ida/Samples/animations sample.

      Returns void

    • Sets the bonus flags of the object.

      Parameters

      • bonusFlags: number

        The numeric value representing the bonus flags.

      Returns void

    • Sets the bonus quantity of the object.

      Parameters

      • bonusQuantity: number

        The number of bonus items for the object.

      Returns void

    • Sets the entity index of a 3D object.

      Parameters

      • entity: number

        The 3D entity id. You can view all the entity ids in Ida/srcjs/architect/entities.md file.

      Returns void

    • Sets the hit power of the object.

      Parameters

      • hitPower: number

        The hit power value.

      Returns void

    • Sets the life points of the object.

      Parameters

      • lifePoints: number

        The life points value.

      Returns void

    • Sets the position of the object in the world.

      Parameters

      • pos: number[]

        Array of 3 numbers: [x, y, z].

      Returns void

    • Sets the object info registers.

      Parameters

      • registers: [number, number, number, number]

        Array of 4 numbers: [Info, Info1, Info2, Info3].

      Returns void

    • Sets the rotation speed of the object.

      Parameters

      • rotationSpeed: number

        The rotation speed value should be an integer from -32768 to 32767. LBArchitect shows rotation delay instead. Rotation speed is connected to the delay by the formula: speed = 50 * 1024 / delay

      Returns void

    • Sets the sprite ID for a sprite object.

      Parameters

      • spriteId: number

        The sprite ID value.

      Returns void

    • Sets the static flags of the object.

      Parameters

      • staticFlags: number

        The numeric value representing the static flags.

      Returns void