-
Notifications
You must be signed in to change notification settings - Fork 20
entities
This library provides access to the game's entity array and helper functions.
local entities = require('entities')
❗ Dependency Required
To use this library, you must include
entities
in themanifest.xml
file for your package:<dependency>entities</dependency>
The entities table can be accessed directly with an entity's index to get the entity_object or nil
if there is no entity at that position. It can also be iterated with pairs
or ipairs
to go through the entire entity array.
The following helpers are also provided:
- entities:by_id Looks an entity up by its ID
- entities:by_name Looks an entity up by its name
Additionally, the entity array is subdivided into three categories, which provide the same helpers as the root table. They can be used for stricter access as well as to improve performance of the helpers that have to search through the array:
- entities.npcs NPC section
- entities.pcs PC section
- entities.allies Ally section
Searches the entity array (or section) for the provided ID.
function entities:by_id(id : number)
id number
The ID of the entity to find
The entity_object with that ID if found, otherwise nil
.
Searches the entity array (or section) for the provided name. The search is case-sensitive.
function entities:by_name(name : string)
name string
The name of the entity to find
The first entity_object with that name if found, otherwise nil
.
Provides the same behavior as the entities
table, but restricted to the NPC section (indices 0x000
- 0x3FF
).
Provides the same behavior as the entities
table, but restricted to the PC section (indices 0x400
- 0x6FF
).
Provides the same behavior as the entities
table, but restricted to the ally (pets, trusts) section (indices 0x700
- 0x8FF
).
- Background and Architecture
- Windower Data Locations
- Code Standards and Guidelines
- Addon Development
- Windower Commands
- Packet Tutorial
- burdometer
- config
- delay_me_not
- distance
- dress_up
- enternity
- fps
- ime
- logger
- party_time
- paste
- pouches
- send
- shortcuts
- speedometer
- target_info
- terminate
- timestamp
- window_title
- Game
- Windower
- General