LuaStateProxy.Id
Unique identifier for this Lua state.
Syntax
state.Id: numberDescription
LuaStateProxy.Id is a read-only property that returns a unique numeric identifier for the Lua state. Each state (game state and actor states) has its own unique ID.
Example
local state = getluastate()
print("State ID:", state.Id)Compare States
local gameState = getgamestate()
local currentState = getluastate()
if gameState.Id == currentState.Id then
print("Running on game state")
else
print("Running on different state (ID:", currentState.Id, ")")
endTrack States
local states = getactorstates()
local stateIds = {}
for _, state in ipairs(states) do
table.insert(stateIds, state.Id)
print("State ID:", state.Id, "Is Actor:", state.IsActorState)
endRelated Properties
LuaStateProxy.IsActorState- Check if state is for actorsLuaStateProxy.Event- Communication event