sorry I've not replied in a wee while; having issues with electric. shitty storm raging on outside.
It's good that you are willing to get down & dirty with the Lua side of things. a lot of people aren't really willing to give it a try, as you can achieve most things via the action parts alone.
In regards to support: I'm the English support for the community & wiki, which is why I reply to most threads. I mostly manage to provide help but sometimes it eludes me as I'm more of a visual person; meaning I prefer to check out the problem myself in the .ved file or via screenshots etc.
-- * --
hmm you mean to literally left click, hold & drag an item over another item, character or object? in vs there is a built in option for drag & drop but it doesn't work in the way you would think. confused me at first as it works by left clicking on an item which it then automatically sets the currently held item as the item you clicked on & sets the mouse cursor as the item image & then will remain as current item/cursor until you left click on a character, item, scene object, empty space or cancel it with right click etc. strange system.
you can also manually set currently held items & commands with action parts & define what can be used on each object, character etc via "executed" actions.
-- * --
Ok, so, here's the script, all in working order; I tested it multiple ways by setting up some debug options so I could quickly change the game language & the integer value of "cmd_state".
To use it you want to set the active command to your interaction one on mouse over the interaction action area & then execute a script containing: renameBtn()... You need to set the value of cmd_state on mouse over each object, character etc...
--[[
Global action rename function (v1)
Written by AFRLme
-- * --
alternatingfrequencies@hotmail.com | skype @ AFRLme
--]]
-- * local variables * --
local texts, btn, val, t -- empty variables
-- * tables * --
t = {}
t["de"] = {"Benutzen", "Nehmen", "Drucken", "Ziehen"}
t["en"] = {"Use", "Pick up", "Push", "Pull"}
t["es"] = {"Usar", "Cojer", "Empujar", "Tirar"}
t["fr"] = {"Usage", "Prendre", "Appuyer", "Arracher"}
-- * function * --
function renameBtn()
val = getObject("Values[cmd_state]"):getInt(VValueInt) -- get current value
btn = game:getLink(VGameActiveCommand):getLink(VButtonName) -- store current command
texts = btn:getLinks(VTextAll) -- get all texts related to the button
-- * --
for i = 1, table.maxn(texts) do
if texts[i]:getLink(VTextLanguageLanguage):getName() == "English" then
texts[i]:setValue(VTextLanguageText, t["en"][val])
elseif texts[i]:getLink(VTextLanguageLanguage):getName() == "French" then
texts[i]:setValue(VTextLanguageText, t["fr"][val])
elseif texts[i]:getLink(VTextLanguageLanguage):getName() == "German" then
texts[i]:setValue(VTextLanguageText, t["de"][val])
elseif texts[i]:getLink(VTextLanguageLanguage):getName() == "Spanish" then
texts[i]:setValue(VTextLanguageText, t["es"][val])
end
end
end
I've not sorted out the resetBtn() function yet. too late now & I'm not in the mood to code anything else.