VisionaireObject Command: clearLink: Difference between revisions

From The Official Visionaire Studio: Adventure Game Engine Wiki
EK (talk | contribs)
Created page with "Removes a link from the VisionaireObject. == Syntax == <syntaxhighlight lang="lua"> clearLink(field) </syntaxhighlight> == Parameters == {| class="ts" |- ! style="width:1..."
 
EK (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 17: Line 17:
|-
|-
| field
| field
| int
| integer
| The object field to be cleared; has to be of "t_link" type.
| The object field to be cleared; has to be of "t_link" type.
''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.''
Line 32: Line 32:
'''Example 1:''' Clear the link to the currently used item (will remove a dragged item from the cursor).
'''Example 1:''' Clear the link to the currently used item (will remove a dragged item from the cursor).
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Specify the field constant name
-- Specify the field constant name or the field id
game:clearLink(VGameUsedItem)
game:clearLink(VGameUsedItem)
-- Or specify the field id
game:clearLink(686)
game:clearLink(686)


-- Setting an empty object leads to the same result
-- Setting an empty object leads to the same result
game:setValue(VGameUsedItem, emptyObject)
game:setValue(VGameUsedItem, emptyObject)
-- The shorthand notation offers a more convenient way to achieve the same
game.UsedItem = emptyObject
</syntaxhighlight>
</syntaxhighlight>
{{toc}}
{{toc}}

Latest revision as of 20:13, 11 August 2023

Removes a link from the VisionaireObject.


Syntax

clearLink(field)


Parameters

Parameter Type Description
field integer The object field to be cleared; has to be of "t_link" type.

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


Return values

none


Examples

Example 1: Clear the link to the currently used item (will remove a dragged item from the cursor).

-- Specify the field constant name or the field id
game:clearLink(VGameUsedItem)
game:clearLink(686)

-- Setting an empty object leads to the same result
game:setValue(VGameUsedItem, emptyObject)

-- The shorthand notation offers a more convenient way to achieve the same
game.UsedItem = emptyObject