VisionaireObject Command: getLinks

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 18:16, 19 March 2014 by AFRLme (talk)

Command History

Available since v3.0


Allows you to access, read & manipulate grouped data tables for objects, items, characters, conditions, & values etc...


Additional Info

!important: The object names are case sensitive.
The data has to be iterated before you can access it.


Syntax:

getLinks(t_links)


Example 1: using getLinks as initial function.

local lang = game:getLinks(VGameLanguages) -- store all available game languages

-- * iterate the data * --
for i = 1, table.maxn(lang) do -- for i = 1 to amount of entries in lang table do...
 print(lang[i]:getId().id .. ": " .. lang[i]:getName()) -- prints "language id: language name"
end

Example 2: using getLinks after other functions

local obj = getLink(VGameCurrentObject):getLinks(VObjectActions) -- get current item underneath the cursor & all actions associated with it...

-- * iterate the data * --
for i = 1, table.maxn(obj) do -- for i = 1 to amount of entries in obj table do...
 print(i .. ": " .. obj[i]:getName()) -- prints "incremental value: action name"
end


Arguments

t_links: text
The name of the grouped data structure object table.


Flags

none


Return

object
Returns the data from the linked objects table; or returns empty.