ok done
add script as a definition script...
--[[
Item Animation Control (v2) [very short method]
Written by AFRLme
-- * --
label@alternatingfrequencies.com | aim, skype, trillian @ AFRLme
--]]
-- * let's create the function which sets the static frame for all items currently in the characters inventory * --
function initItems()
tblItmFrm = {} -- creates an empty table
tblItmFrm["_temporary_"] = "" -- sets table to temporary
tblItmFrm["items"] = game:getLink(VGameCurrentCharacter):getLinks(VCharacterItems) -- stores character items
-- * --
if table.maxn(tblItmFrm["items"]) > 0 then -- if items table is not empty then do ...
for i = 1, table.maxn(tblItmFrm["items"]) do -- for i = 1 to total number of items do ...
tblItmFrm["act_anim"] = getObject("ActiveAnimations[" .. tblItmFrm["items"][i]:getName() .. "]") -- store active animation
tblItmFrm["gen_anim"] = getObject("Animations[" .. tblItmFrm["items"][i]:getName() .. "]") -- store general animation
tblItmFrm["frames"] = tblItmFrm["gen_anim"]:getSprites(VAnimationSprites) -- store frames
tblItmFrm["frames"] = table.maxn(tblItmFrm["frames"]) -- convert total of frames into an integer value
-- * --
--print("item: " .. tblItmFrm["items"][i]:getName() .. ", frames: " .. tblItmFrm["frames"]) -- prints item name & frame amount to log
tblItmFrm["act_anim"]:setValue(VAnimationFirstFrame, tblItmFrm["frames"]) -- sets item animation to last frame & stops it from looping
end
end
end
to use it, create an at beginning of scene action for each non-menu scene & add an execute a script action part containing the following code
yes it's as simple as that for freezing all the items already in the characters inventory to their last frame....
ok so the next part requires some work from you! (check the attachments for reference)
you will need to edit the final frame of each items animation & create an execute a script action part containing something along the lines of this...
getObject("ActiveAnimations[add item name here]"):setValue(VAnimationFirstFrame, add last frame number)
-- example
getObject("ActiveAnimations[1_Weapon]"):setValue(VAnimationFirstFrame, 4)
I've tested it...
if no items are in inventory then InitItems() function does nothing.
If you add an item to the inventory it will play the animation & then if you've done what I've said then it should remain on the last frame...
if you remove an item & then re-add it, it will play animation from the beginning as it should do.
*edit: annoying bloody code box still parsing emoticons...
where the
are is actually ... " ) quotation mark & a right bracket.