Difference between revisions of "VisionaireObject Command: getLinks"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Command History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since ...")
 
Line 60: Line 60:
 
Returns the data from the linked objects table; or returns empty.
 
Returns the data from the linked objects table; or returns empty.
  
{{i18n|GetLink_(CMS)}}
+
{{i18n|GetLinks_(CMS)}}

Revision as of 19:16, 19 March 2014

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.