# Game Management

Before using game management API, create a gane management object is required, as below:

local Game = class.Game.new()

The specific function name and description are as follows:

Serial number Function name Description
1 doGameEnd(...) End the game
2 getDefString(...) Acquire default character string
3 setScriptVar(...) Set the script's attribute for custom
4 getScriptVar(...) Receive script attribute for custom
5 sendScriptVars2Client(...) Upload the script's attribute
6 addRenderGlobalEffect(...) New global effect
7 removeRenderGlobalEffect(...) Clear global effect
8 setRenderGlobalEffectPos(...) Set the location of global effect
9 setRenderGlobalEffectScale(...) Set global zoom effect
10 msgBox(...) Set pop-up notice

# doGameEnd

  • Parameters and types:nil
  • Return value and types:
  • The main role of this method: End the game
  • The specific use cases are as follows:
local result = Game:doGameEnd()

# getDefString

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Acquire default character string
  • The specific use cases are as follows:
local result = Game:getDefString(id, ...)

# setScriptVar

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set the script's attribute for custom
  • The specific use cases are as follows:
local result = Game:setScriptVar(index, val)

# getScriptVar

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Receive script attribute for custom
  • The specific use cases are as follows:
local result = Game:getScriptVar(index)

# sendScriptVars2Client

  • Parameters and types:nil
  • Return value and types:
  • The main role of this method: Upload the script's attribute
  • The specific use cases are as follows:
local result = Game:sendScriptVars2Client()

# addRenderGlobalEffect

  • Parameters and types:
  • Return value and types:
  • The main role of this method: New global effect
  • The specific use cases are as follows:
local result = Game:addRenderGlobalEffect(path)

# removeRenderGlobalEffect

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Clear global effect
  • The specific use cases are as follows:
local result = Game:removeRenderGlobalEffect(effectid)

# setRenderGlobalEffectPos

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set the location of global effect
  • The specific use cases are as follows:
local result = Game:setRenderGlobalEffectPos(effectid, x, y, z)

# setRenderGlobalEffectScale

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Set global zoom effect
  • The specific use cases are as follows:
local result = Game:setRenderGlobalEffectScale(effectid, scalex, scaley, scalez)

# msgBox

  • Parameters and types:
    • msg:string the text to display
  • Return value and types:
  • The main role of this method: Set pop-up notice
  • The specific use cases are as follows:
local result = Game:msgBox(msg)
Last Update: 11/22/2019, 2:31:59 PM