GetTerrainScriptIntVariable

Definition

int GetTerrainScriptIntVariable(string variable)

Description

This function gets the value of the Integer variable defined in the script attached to the terrain object.

Parameters

variable
Specifies the name of the Integer variable defined in the script attached to the terrain object.

Return Value

Returns the value of the Integer variable defined in the script attached to the terrain object.

Example

--script name is GetTerrainScriptIntVariable.lua attached a to game object such as water

return_value = 0

function Init()
    return_value = GetTerrainScriptIntVariable("a")
end

function Update()

end
Assuming that the variable “a” is defined with the value in the script attached to the terrain object, GetTerrainScriptIntVariable function returns the value 1.
adminGetTerrainScriptIntVariable