Trigger API Reference DCEI Functions Game0 - BLKTower/TestWiki GitHub Wiki

Table of Contents

Trigger API Reference\DCEI Functions\Game {Trigger-API-ReferenceDCEI-FunctionsGame}

void SetUpdateFrequency(float value) {void-SetUpdateFrequencyfloat-value}

void SetUpdateFrequency(float value)

Description

Changes how frequently a simulation update is called. The default of 1 means 16 FPS. Regardless what frequency is used, each simulation update will advance game time by 0.0625 unless SetSpeedFactor() is also used.

Parameters

  • float value the frequency with which simulation updates are called. Supported values are [1/4, 1/2, 1, 2].

Example Usage

DCEI.SetUpdateFrequency(2)

Related

void ClearUpdateFrequency() {void-ClearUpdateFrequency}

void ClearUpdateFrequency()

Description

Resets update frequency to the default frequency of 1, meaning 16 FPS.

Example Usage

DCEI.ClearUpdateFrequency()

float GetUpdateFrequency() {float-GetUpdateFrequency}

float GetUpdateFrequency()

Description

Returns the update frequency.

Example Usage

DCEI.LogMessage(DCEI.GetUpdateFrequency())

void SetSpeedFactor(float value) {void-SetSpeedFactorfloat-value}

void SetSpeedFactor(float value)

Description

Sets the speed factor for the simulation. The speed factor applies a multiplier to delta time in simulation updates, affecting how much time is processed in each simulation update. This will affect simulation results so it's recommended to only use it for slow motion effects with values like 1/64, 1/128, etc. Simulation update rate is now defaulted to 16 FPS with exactly 0.0625 delta time between updates.

Parameters

  • float value the multiplier for how much time is processed on each game update.

Example Usage

DCEI.SetSpeedFactor(0.5)

Related

float GetSpeedFactor() {float-GetSpeedFactor}

float GetSpeedFactor()

Description

Returns the speed factor.

Example Usage

DCEI.LogMessage(DCEI.GetSpeedFactor())

void SetVictory() {void-SetVictory}

void SetVictory()

Description

Ends the game in a victory.

Example Usage

DCEI.SetVictory()

void SetDefeat() {void-SetDefeat}

void SetDefeat()

Description

Ends the game in a defeat.

Example Usage

DCEI.SetDefeat()

void SetVictoryForPlayer(int player, string result) {void-SetVictoryForPlayerint-player-string-result}

void SetVictoryForPlayer(int player, string result)

Description

End the game in a victory for given player, with the given result.

Parameters

  • int player integer corresponding to the player.
  • string result the result.

Example Usage

DCEI.SetVictoryForPlayer(1, "Win")

void SetDefeatForPlayer(int player, string result) {void-SetDefeatForPlayerint-player-string-result}

void SetDefeatForPlayer(int player, string result)

Description

End the game in a defeat for given player, with the given result.

Parameters

  • int player integer corresponding to the player.
  • string result the result.

Example Usage

DCEI.SetVictoryForPlayer(1, "Lose")

⚠️ **GitHub.com Fallback** ⚠️