VisionaireObject Command: getFloat

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 20:06, 11 August 2023 by EK (talk | contribs) (Created page with "Returns the decimal value of a VisionaireObject field. == Syntax == <syntaxhighlight lang="lua"> getFloat(field) </syntaxhighlight> == Parameters == {| class="ts" |- ! st...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns the decimal value of a VisionaireObject field.


Syntax

getFloat(field)


Parameters

Parameter Type Description
field int The field which specifies a decimal value. The field type must be "t_float".

Specify the field by the field constant (V + object table name in singular + field name) or by its id, see the example.


Return values

Type Description
decimal The decimal value of the field.


Examples

Example 1: Get the current size of a character.

-- Specify the field by the field constant or by its id
local char_size = getObject("Characters[hero]"):getFloat(VCharacterSize)
local char_size = getObject("Characters[hero]"):getFloat(749)

-- The shorthand notation offers a more convenient way to achieve the same
local char_size = Characters["hero"].Size