Skip to content

Trigger API Reference DCEI Functions General1

BlackTower edited this page Jul 28, 2022 · 2 revisions
Table of Contents

Trigger API Reference\DCEI Functions\General (2/2) {Trigger-API-ReferenceDCEI-FunctionsGeneral-22}

void EnableNavmeshCut(string prop_tag, bool enable) {void-EnableNavmeshCutstring-prop_tag-bool-enable}

void EnableNavmeshCut(string prop_tag, bool enable)

Description

Enable/disable a navmesh cut according to prop tag.

Parameters

  • string prop_tag the prop's tag.
  • bool enable if true, enable the navmesh cut.

Example Usage

DCEI.SetPropVisibility("prop_test", true)

object GetCardDamageStats() {object-GetCardDamageStats}

object GetCardDamageStats()

Description

Returns a table containing the card damage stats.

Example Usage

local card_damage_stats = DCEI.GetCardDamageStats()

void ResetCardDamageStats() {void-ResetCardDamageStats}

void ResetCardDamageStats()

Description

Resets the card damage stats.

Example Usage

DCEI.ResetCardDamageStats()

void TriggerOnFocusChange(TypedCallback<bool> callback) {void-TriggerOnFocusChangeTypedCallbackbool-callback}

void TriggerOnFocusChange(TypedCallback<bool> callback)

Description

This triggers the callback function on focus change (for the game window).

Parameters

  • object callback the callback function that is run.

Example Usage

function OnFocusChange()
    DCEI.LogMessage("Focus changed.")
end

DCEI.TriggerOnFocusChange(OnFocusChange)

void GarbageCollect() {void-GarbageCollect}

void GarbageCollect()

Description

Runs the garbage collector.

Example Usage

DCEI.GarbageCollect()

int GetLuaMemorySize() {int-GetLuaMemorySize}

int GetLuaMemorySize()

Description

Returns the lua memory size.

Example Usage

DCEI.LogMessage(DCEI.GetLuaMemorySize())

double GetLevelDataLoadingTime() {double-GetLevelDataLoadingTime}

double GetLevelDataLoadingTime()

Description

Returns the level data loading time.

Example Usage

DCEI.LogMessage(DCEI.GetLevelDataLoadingTime())

void Wait(float time, bool useRealTime) {void-Waitfloat-time-bool-useRealTime}

void Wait(float time, bool useRealTime)

Description

Waits for the given amount of time. Note that Wait cannot be used inside simple callback functions or main body.

Parameters

  • float time the amount of time to wait.
  • bool useRealTime if true, uses real time.

Example Usage

function OnFocusChange()
    DCEI.LogMessage("Focus changed.")
    DCEI.Wait(5, false)
    DCEI.LogMessage("It has been 5 seconds since the focus changed.")
end

DCEI.TriggerOnFocusChange(OnFocusChange)

Clone this wiki locally