Difference between revisions of "VisionaireObject Command: getInt"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Returns the integer value of a VisionaireObject field. == Syntax == <syntaxhighlight lang="lua"> getInt(field) </syntaxhighlight> == Parameters == {| class="ts" |- ! styl...") |
(No difference)
|
Latest revision as of 21:18, 11 August 2023
Returns the integer value of a VisionaireObject field.
Syntax
getInt(field)
Parameters
Parameter | Type | Description |
---|---|---|
field | integer | The field which specifies an integer value. The field type must be "t_int".
Specify the field constant name (V + object table name in singular + field name) or the field id, see the example. |
Return values
Type | Description |
---|---|
integer | The integer value of the field. |
Examples
Example 1: Get the value of a value object.
-- Specify the field constant name or the field id
local num_coins = getObject("Values[coins]"):getInt(VValueInt)
local num_coins = getObject("Values[coins]"):getInt(328)
-- The shorthand notation offers a more convenient way to achieve the same
local num_coins = Values["coins"].Int