-- here's a quick global function example for renaming objects...
-- to use: add inside of an execute a script action part: renameObj("the objects name", "the command name you want to add")
function renameObj(obj, cmd)
getObject("Game.GameCurrentScene.SceneObjects[" .. obj .. "]"):setValue(VObjectName, cmd .. " " .. obj)
end
renameBtn()
-- * local variables * --
local val
local btn = getObject("Buttons[use]") -- store interface button
-- * tables * --
tCmd = {"Pick up ", "Use ", "Push ", "Pull "}
-- * function used to rename objects * --
function renameBtn()
val = getObject("Values[cmd_state]"):getInt(VValueInt) -- store number value of value
btn:setValue(VButtonName, tCmd[val] ) -- ammend required action name to the "use" button
end
-- edit use to whatever you called the interface button...
getObject("Buttons[use]"):setValue(VButtonName, "")
local btn = getObject("Interfaces[coin_disc1].InterfaceButtons[Action_Coin]")
getObject("Interfaces[coin_disc1]") --Seems fine
getObject("Button[Action_Coin]") --invalid table name
getObject("InterfaceButtons[Action_Coin]") --invalid table name
getObject("Interfaces[coin_disc1].InterfaceButtons[Action_Coin]") --invalid
local btn = getObject("Interfaces[coin_disc1].InterfaceButtons.Button[Action_Coin]")
local val
local btn = getObject("Interfaces[coin_disc1].InterfaceButtons[Action_Coin]")
function newName()
btn:setValue(ButtonName, "wibble" )
end