Trigger API Reference\DCEI Functions\Event


Used for live game analytics.
Notes: there are some restrictions on event names, parameter names, and values:

void Event.Log(string key, object table)

void Event.Log(string key, object table)

Description


Logs an event.

Parameters

Example Usage

local key = "Stats"
local table = {
  health = DCEI.GetHealth(unit),
  shield = DCEI.GetShield(unit),
  mana = DCEI.GetMana(unit)
}

DCEI.Event.Log(key, table)

void Event.SetUserProperty(string key, object value)

void Event.SetUserProperty(string key, object value)

Description


Logs a user property.

Parameters

Example Usage

local key = "level"
local value = 10

DCEI.Event.SetUserProperty(key, value)

void Event.SetGameState(string state)

void Event.SetGameState(string state)

Description


Sets the user's game state. Useful for doing things like tracking the amount of time users spend in a particular game mode or game state, to gather relevant data and make charts on Amplitude.

Parameters

Example Usage

function Log.State:Set(name)
    local state_id = STATE[name]
    Core.Assert(state_id, "Invalid state name " .. tostring(name))
    DCEI.Event.SetGameState(state_id)

    -- DEBUG
    if Debug:IsPrintingEventState() then
        DCEI.LogWarning("> LOGGING STATE [" .. state_id .. "]")
    end
end