Class Objects.AIObject

AI object

Functions

AIObject:GetPosition() Get the object's position.
AIObject:SetPosition(position) Set the object's position.
AIObject:GetRotationY() Get the object's Y-axis rotation.
AIObject:SetRotationY(rotation) Set the object's Y-axis rotation.
AIObject:GetName() Get the object's unique string identifier.
AIObject:SetName(name) Set the object's unique string identifier.
AIObject:GetRoom() Get the current room of the object.
AIObject:GetRoomNumber() Get the current room number of the object.
AIObject:SetRoomNumber(ID) Set room number of the object.
AIObject:GetObjectID() Retrieve the object ID.
AIObject:SetObjectID(ID) Change the object ID.


Functions

AIObject:GetPosition()
Get the object's position.

Returns:

    Vec3 A copy of the object's position.
AIObject:SetPosition(position)
Set the object's position.

Parameters:

  • position Vec3 The new position of the object.
AIObject:GetRotationY()
Get the object's Y-axis rotation.

Returns:

    int The object's Y-axis rotation.
AIObject:SetRotationY(rotation)
Set the object's Y-axis rotation.

Parameters:

  • rotation int The object's new Y-axis rotation.
AIObject:GetName()
Get the object's unique string identifier.

Returns:

    string The object's name.
AIObject:SetName(name)
Set the object's unique string identifier.

Parameters:

  • name string The object's new name.
AIObject:GetRoom()
Get the current room of the object.

Returns:

    Room current room of the object.
AIObject:GetRoomNumber()
Get the current room number of the object.

Returns:

    int Number representing the current room of the object.
AIObject:SetRoomNumber(ID)
Set room number of the object. This is used in conjunction with SetPosition to teleport the object to a new room.

Parameters:

  • ID int The ID of the new room.
AIObject:GetObjectID()
Retrieve the object ID.

Returns:

    int A number representing the ID of the object.
AIObject:SetObjectID(ID)
Change the object ID. This will change the type of AI object it is. Note that a baddy will gain the behaviour of the tile it's on before said baddy is triggered. This means that changing the type of an AI object beneath a moveable will have no effect. Instead, this function can be used to change an object that the baddy isn't standing on. For example, you could have a pair of AIGUARD objects, and change one or the other two AIPATROL_1 based on whether the player has a certain item or not.

Parameters:

Usage:

    aiObj = TEN.Objects.GetMoveableByName("ai_guard_sphinx_room")
    aiObj:SetObjectID(TEN.Objects.ObjID.AI_PATROL1)
generated by TEN-LDoc (a fork of LDoc 1.4.6)