Difference between revisions of "VisionaireObject Command: getLink"

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 ...")
 
m (Text replacement - "{{toc}}" to "")
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
{| class="toccolours mw-collapsible mw-collapsed ts"
<span class="bold">Command History</span>
+
|-
<div class="mw-collapsible-content">
+
! Function History
<div class="alt-bg">Available since v3.0</div>
+
|-
</div></div>
+
| Available since v3.0
 +
|}
  
  
Allows you to access, read & manipulate the data tables for general game objects, items, characters, conditions, & values etc...
+
Allows you to access, read & manipulate the data tables for objects, items, characters, conditions, & values etc...
  
'''''* this page is a work in progress *'''''
 
  
 
Syntax:
 
Syntax:
 
<syntaxhighlight>
 
<syntaxhighlight>
getLink(table)
+
getLink(t_link)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
Example 1: Quick getObject method; you must take care when using this method, that your project does not contain multiple objects with the same name.
+
Example 1: using getLink as initial function.
 
<syntaxhighlight>
 
<syntaxhighlight>
-- This method is unsafe because it accesses all the condition/value tables associated with the project
+
game:getLink(VGameCurrentCharacter) -- access all tables of current character
getObject("Conditions[condition_name]") -- get a condition
+
game:getLink(VGameCurrentScene) -- access all tables of current scene
getObject("Values[value_name]") -- get a value
 
getObject("Actions[action_name]") -- get an action
 
getObject("Animations[animation_name]") -- get an animation
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Example 2: Full getObject method.
+
Example 2: using getLink after other functions
 
<syntaxhighlight>
 
<syntaxhighlight>
-- * scenes * --
+
game:getLink(VGameCurrentCharacter):getLink(VCharacterCurrentOutfit) -- access table of current characters active outfit
getObject("Scenes[scene_name].SceneConditions[condition_name]") -- get condition linked to a scene
+
getObject("Characters[Tom]"):getLink(VCharacterCurrentOutfit) -- access active outfit table of character "Tom"
getObject("Scenes[scene_name].SceneObjects[object_name].ObjectConditions[condition_name]") -- get condition linked to a scene object
 
getObject("Scenes[scene_name].SceneValues[value_name]") -- get value linked to a scene
 
getObject("Scenes[scene_name].SceneObjects[object_name].ObjectValues[value_name]") -- get value linked to a scene object
 
getObject("Scenes[scene_name].SceneActions[action_name]") --
 
getObject("scenes[scene_name].SceneObjects[object_name].ObjectAnimations[animation_name]") -- get animation linked to a scene object
 
-- * characters * --
 
getObject("Characters[character_name].CharacterConditions[condition_name]") -- get condition linked to a character
 
getObject("Characters[character_name].CharacterValues[value_name]") -- get value linked to a character
 
getObject("Characters[character_name].CharacterActions[action_name]") -- get action linked to a character
 
getObject("Characters[character_name].CharacterOutfits[outfit_name].OutfitCharacterAnimations[animation_name]") -- get animation linked to a character
 
-- etc...
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
  
 
<span class="bold underline">Arguments</span>
 
<span class="bold underline">Arguments</span>
  
'''path''': "string" <br/>
+
'''t_link''': text <br/>
The path to the required data structure object.
+
The name of the data structure object table.
 
 
'''object''': text<br/>
 
Name of the object, character, condition etc; the name is case sensitive.
 
 
 
'''error''': bool (true/false) <br/>
 
If <span class="green">''true''</span> a warning will be printed to the log, if the linked object can not be found; it is set to <span class="green">true</span>, by default.
 
  
  
Line 65: Line 44:
 
'''object''' <br/>
 
'''object''' <br/>
 
Returns the data from the linked objects table; or returns empty.
 
Returns the data from the linked objects table; or returns empty.
 
{{i18n|GetObject_(CMS)}}
 

Revision as of 01:51, 4 November 2014

Function History
Available since v3.0


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


Syntax:

getLink(t_link)


Example 1: using getLink as initial function.

game:getLink(VGameCurrentCharacter) -- access all tables of current character
game:getLink(VGameCurrentScene) -- access all tables of current scene

Example 2: using getLink after other functions

game:getLink(VGameCurrentCharacter):getLink(VCharacterCurrentOutfit) -- access table of current characters active outfit
getObject("Characters[Tom]"):getLink(VCharacterCurrentOutfit) -- access active outfit table of character "Tom"


Arguments

t_link: text
The name of the data structure object table.


Flags

none


Return

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