VisionaireObject Command: getStr

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

Returns the string value of a VisionaireObject field.


Syntax

getStr(field)


Parameters

Parameter Type Description
field integer The field which specifies a string value. The field type must be "t_string".

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


Return values

Type Description
string The string value of the field.


Examples

Example 1: Get the version number of the game (as defined in the game info).

-- Specify the field constant name or the field id
local ver = game:getStr(VGameVersion)
local ver = game:getStr(627)

-- The shorthand notation offers a more convenient way to achieve the same
local ver = game.Version