Class ItemInfo
Represents any object inside the game world.
Examples include statics, enemies, doors, pickups, and Lara herself.
Members
ItemInfo.objectID | (ObjID) object ID |
ItemInfo.currentAnimState | (int) State of current animation |
ItemInfo.requiredAnimState | (int) State of required animation |
ItemInfo.goalAnimState | (int) State of goal animation |
ItemInfo.animNumber | (int) animation number |
ItemInfo.frameNumber | (int) frame number |
ItemInfo.HP | (int) HP (hit points/health points) of object |
ItemInfo.OCB | (int) OCB (object code bit) of object |
ItemInfo.itemFlags | (table) item flags of object (table of 8 ints) |
ItemInfo.AIBits | (int) AIBits of object. |
ItemInfo.status | (int) status of object. |
ItemInfo.hitStatus | (bool) hit status of object |
ItemInfo.active | (bool) whether or not the object is active |
ItemInfo.room | (int) room the item is in |
ItemInfo.pos | (Position) position in level |
ItemInfo.rot | (Rotation) rotation represented as degree angles about X, Y, and Z axes |
ItemInfo.name | (string) unique string identifier. |
Functions
ItemInfo.newItem () | If you create items with this you NEED to give a position, room, and object number, and then call InitialiseItem before it will work. |
ItemInfo.newItemTemporary () | Like above, but the returned variable controls the lifetime of the object (it will be destroyed when the variable goes out of scope). |
ItemInfo.newItem (object, name, position, rotation, room, currentAnimState, requiredAnimState, goalAnimState, animNumber, frameNumber, hp, OCB, itemFlags, AIBits, status, active, hitStatus) | For more information on each parameter, see the associated getters and setters. |
ItemInfo.newItemTemporary (see_above) | Like the above, but the returned variable controls the lifetime of the object (it will be destroyed when the variable goes out of scope). |
ItemInfo.Init () | Initialise an item. |
ItemInfo:EnableItem () | Enable the item |
ItemInfo:DisableItem () | Disable the item |
Members
- ItemInfo.objectID
- (ObjID) object ID
- ItemInfo.currentAnimState
- (int) State of current animation
- ItemInfo.requiredAnimState
- (int) State of required animation
- ItemInfo.goalAnimState
- (int) State of goal animation
- ItemInfo.animNumber
- (int) animation number
- ItemInfo.frameNumber
- (int) frame number
- ItemInfo.HP
- (int) HP (hit points/health points) of object
- ItemInfo.OCB
- (int) OCB (object code bit) of object
- ItemInfo.itemFlags
- (table) item flags of object (table of 8 ints)
- ItemInfo.AIBits
- (int) AIBits of object. Will be clamped to [0, 255]
- ItemInfo.status
- (int) status of object. possible values: 0 - not active 1 - active 2 - deactivated 3 - invisible
- ItemInfo.hitStatus
- (bool) hit status of object
- ItemInfo.active
- (bool) whether or not the object is active
- ItemInfo.room
- (int) room the item is in
- ItemInfo.pos
- (Position) position in level
- ItemInfo.rot
- (Rotation) rotation represented as degree angles about X, Y, and Z axes
- ItemInfo.name
- (string) unique string identifier. e.g. "doorbackroom" or "crackedgreekstatue"
Functions
Methods- ItemInfo.newItem ()
- If you create items with this you NEED to give a position, room, and object number, and then call InitialiseItem before it will work.
- ItemInfo.newItemTemporary ()
- Like above, but the returned variable controls the lifetime of the object (it will be destroyed when the variable goes out of scope).
- ItemInfo.newItem (object, name, position, rotation, room, currentAnimState, requiredAnimState, goalAnimState, animNumber, frameNumber, hp, OCB, itemFlags, AIBits, status, active, hitStatus)
-
For more information on each parameter, see the
associated getters and setters. If you do not know what to set for these,
most can just be set to zero (see usage). See also the overload which
takes no arguments.
Parameters:
- object ObjID ID
- name string Lua name of the item
- position Position position in level
- rotation Rotation rotation about x, y, and z axes
- room int room ID item is in
- currentAnimState int current animation state
- requiredAnimState int required animation state
- goalAnimState int goal animation state
- animNumber int anim number
- frameNumber int frame number
- hp int HP of item
- OCB int ocb of item
- itemFlags int item flags
- AIBits int byte with AI bits
- status int status of object
- active bool is item active or not?
- hitStatus bool hit status of object
Returns:
-
reference to new ItemInfo object
Usage:
local item = ItemInfo.newItem( ObjID.PISTOLS_ITEM, -- object id "test", -- name Position.new(18907, 0, 21201), Rotation.new(0,0,0), 0, -- room 0, -- currentAnimState 0, -- requiredAnimState 0, -- goalAnimState 0, -- animNumber 0, -- frameNumber 0, -- HP 0, -- OCB {0,0,0,0,0,0,0,0}, -- itemFlags 0, -- AIBits 0, -- status false, -- active false, -- hitStatus )
- ItemInfo.newItemTemporary (see_above)
-
Like the above, but the returned variable controls the
lifetime of the object (it will be destroyed when the variable goes
out of scope).
Parameters:
- see_above same as above function
- ItemInfo.Init ()
- Initialise an item. Use this if you called new with no arguments
- ItemInfo:EnableItem ()
- Enable the item
- ItemInfo:DisableItem ()
- Disable the item