FrameworkZ API - FrameworkZ.Entities

FrameworkZ.Entities

module

Entities module for FrameworkZ. Defines and interacts with ENTITY object.

4
Functions
8
Methods
1
Fields

Fields

1
FrameworkZ.Entities 📋 table
Entities module for FrameworkZ. Defines and interacts with ENTITY object.
Initial value: {}

Methods

8

FrameworkZ.Entities:EmitSound(worldObject, sound)

method
Play a world sound at an entity's square.

Parameters

worldObject 📋 table
The world object to use as the source.
sound 📝 string
The sound cue name.

Returns

✅ boolean
Whether the sound was queued.

FrameworkZ.Entities:GetData(worldObject, index)

method
Get persisted entity data value by key from a world object.

Parameters

worldObject 📋 table
The world object containing entity mod data.
index 📝 string
The persistData key to retrieve.

Returns

🏷️ mixed
The stored value or nil if missing.

FrameworkZ.Entities:GetEntityByID(entityID)

method
Get an entity by their ID.

Parameters

entityID 📝 string
The entity's ID.

Returns

📋 table
Entity Object

FrameworkZ.Entities:Initialize(data, name)

method
Initialize an entity.

Parameters

data 📋 table
The entity's object data
name 📝 string
The entity's name (i.e. ID)

Returns

📝 string
Entity ID

FrameworkZ.Entities:IsEntity(object)

method
Checks if an object is an entity (needs optimization from cached entities).

Parameters

object 📋 table
The object to check.

Returns

✅ boolean
Whether or not the object is an entity and its entity ID if it is an entity.
🔢 integer
The entity ID if the object is an entity.

FrameworkZ.Entities:LoadGridsquare(square)

method
Placeholder for loading entity data on chunk load.

Parameters

square 📋 table
The gridsquare being loaded.

FrameworkZ.Entities:New(name)

method
Create a new entity object.

Parameters

name 📝 string
The entity's name (i.e. ID).
square 📋 table
The square the entity is on.

Returns

📋 table
The entity's object table.

FrameworkZ.Entities:SetData(worldObject, index, value)

method
Update a persisted entity data value and transmit the change.

Parameters

worldObject 📋 table
The world object containing entity mod data.
index 📝 string
The persistData key to update.
value 🏷️ mixed
The value to set.

Returns

✅ boolean
Whether the data was updated.

Functions

4

FrameworkZ.Entities.OnGameStart()

function
Register entity context menu hook once the game starts.

FrameworkZ.Entities.OnObjectAboutToBeRemoved(object)

function
Invoked before an entity world object is removed.

Parameters

object 📋 table
The object being removed.

FrameworkZ.Entities.OnObjectAdded(object)

function
Called when an object is added to the world. Adds the entity to the object's mod data.

Parameters

object 📋 table
The object that was added to the world.

FrameworkZ.Entities.OnPreFillWorldObjectContextMenu(player, context, worldObjects, test)

function
Build interaction submenu entries for entity objects on right-click.

Parameters

player 🔢 integer
The local player index.
context 📋 table
The context menu being built.
worldObjects 📋 table
The world objects under the cursor.
test ✅ boolean
Test flag from PZ hook.