Difference between revisions of "VisionaireObject Command: getFloat"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 17: | Line 17: | ||
|- | |- | ||
| field | | field | ||
− | | | + | | integer |
| The field which specifies a decimal value. The field type must be "t_float". | | The field which specifies a decimal value. The field type must be "t_float". | ||
''Specify the field constant name (V + object table name in singular + field name) or the field id, see the example.'' | ''Specify the field constant name (V + object table name in singular + field name) or the field id, see the example.'' |
Latest revision as of 20:13, 11 August 2023
Returns the decimal value of a VisionaireObject field.
Syntax
getFloat(field)
Parameters
Parameter | Type | Description |
---|---|---|
field | integer | The field which specifies a decimal value. The field type must be "t_float".
Specify the field constant name (V + object table name in singular + field name) or the field 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 constant name or the field 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