This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
function prepOpenInv()
local kitems = getObject("Game.GameCurrentCharacter"):getLinks(VCharacterItems)
local VileItem, VileItem2
for i=1,table.maxn(kitems) do
VileItem = kitems[i]:getLink(VObjectAnimation)
print(kitems[i]:getName())
print(VileItem:getName())
VileItem2 = getObject("ActiveAnimations[" .. VileItem:getName() .. "]")
VileItem2:setValue(VAnimationCurrentPosition, {x=0,y=100})
end
end
The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Until 1 Dec 2026 all licenses are 30 % off, for example the Indie Bundle for €69.30 instead of €99. The code BLACKFRIDAY is applied automatically at checkout.
See licenses Try it for freei = i + 1
-- or alternatively whatever variable name you decide to use
tblName = {}
tblName["_temporary_"] = ""
tblName[integer value] = -- something...
tblName["name"] = -- alternative method
Hmm it doesn't seem to work. The incrementing part is working alright (that's why we get 1_Weapon, 2_sharp_rock and 3_Scanner in the log) but the problem is that it seems they all link to the same animation. Perhaps this has something to do with how items only get 1 animation and we can't name the animation?
I'm really confused about the local variable thing though. I thought local variables get destroyed after the block finishes executing. Or even if they don't get destroyed, wouldn't creating them in a loop make it just replace the same one over and over again since they have the same name? That way it won't bloat up the save file. And if I create the local variables outside of the function, won't they be on the main level / outside of all blocks? I'm a beginner though, so I really don't know. Anyway, do you recommend that tblName should be used as a global table?
This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.
New threadDeponia, The Whispered World and more than 160 other games were made with Visionaire Studio. The free version covers up to 25 scenes. For more scenes there is Visionaire Studio PRO from €75, and to sell your game the Indie Bundle for €99.
Through December 1: all licenses 30% off, for example the Indie Bundle for €69.30 instead of €99. Applied automatically at checkout.