ObjName (CMS)
From The Official Visionaire Studio: Adventure Game Engine Wiki
Name | Type | By |
---|---|---|
objName(obj) | Definition | Sebastian |
This small function allows you to return the action text name of the specified object; returns name based on current active language.
Instructions
1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2. To use this function you should create an execute a script action containing...
objName(game.CurrentScene.SceneObjects["example"]) -- return name of a specified object
or...
objName(game.CurrentObject) -- return name of object currently underneath the cursor
Main Script
-- * returns the objects, buttons or characters name * --
function objName(obj)
local table = obj:getId().tableId
if table == eObjects then
return obj:getTextStr(VObjectName)
elseif table == eCharacters then
return obj:getTextStr(VCharacterName)
elseif table == eButtons then
return obj:getTextStr(VButtonName)
end
end
Syntax Breakdown
Name | Type | Description |
---|---|---|
obj | link | This should be a link to the object you want to return the name for. The object can be a scene object, a character, an item or an interface button. |