Menu
Lumberyard
Developer Guide (Version 1.11)

ScriptBind_GameStatistics

CryLua is deprecated and will be removed in a future version of Lumberyard.

Lists C++ game statistics functions that can be called from Lua script.

AddGameElement

Adds a game element to specified scope.

Syntax

Copy
GameStatistics.AddGameElement(scopeID, elementID, locatorID, locatorValue [, table])

Parameter Description
scopeID The identifier of the scope.
elementID The identifier of the element to be added.
locatorID The identifier of the locator.
locatorValue The value of the locator.
table Optional. The table of the element.

BindTracker

Syntax

Copy
GameStatistics.BindTracker(name, tracker)

Parameter Description
name The name of the tracker to bind.
tracker The IStatsTracker* to be bound.

CurrentScope

Returns the ID of current scope, or -1 if the stack is empty.

Syntax

Copy
GameStatistics.CurrentScope()

Event

Syntax

Copy
GameStatistics.Event()

PopGameScope

Removes the scope from the top of the stack.

Syntax

Copy
GameStatistics.PopGameScope([checkScopeId])

Parameter Description
checkScopeId Optional. The identifier of the scope to be removed from the top of the stack.

PushGameScope

Pushes a scope on top of the stack.

Syntax

Copy
GameStatistics.PushGameScope(scopeID)

Parameter Description
scopeID The identifier of the scope to be placed on top of the stack.

RemoveGameElement

Removes the element that has the supplied parameter values from the specified scope.

Syntax

Copy
GameStatistics.RemoveGameElement(scopeID, elementID, locatorID, locatorValue)

Parameter Description
scopeID The identifier of the scope.
elementID The identifier of the element to be removed.
locatorID The identifier of the locator.
locatorValue The value of the locator.

StateValue

Syntax

Copy
GameStatistics.StateValue()

UnbindTracker

Syntax

Copy
GameStatistics.UnbindTracker(name, tracker)

Parameter Description
name The name of the tracker to unbind.
tracker The IStatsTracker* to unbind.