Data Realms Fan Forums
http://45.55.195.193/

Animation, Attachable and Framecount Question
http://45.55.195.193/viewtopic.php?f=73&t=31483
Page 1 of 1

Author:  Djinn [ Tue Jul 24, 2012 6:58 pm ]
Post subject:  Animation, Attachable and Framecount Question

I don't know whether this is possible, but I figured I'd ask - I want to add an attachable to an actor that increments its framecount up to a certain point and then stops - and upon reaching the max framecount, another attachable attached to the first begins incrementing up to a point. Think for instance of a bush growing from a seed and upon reaching full growth, berries grow from it. Is that feasible?

Author:  xenoargh [ Tue Jul 24, 2012 7:04 pm ]
Post subject:  Re: Animation, Attachable and Framecount Question

It should work, yes; Lua is able to specify which frame the Attachable is showing, see the Wiki for details about how to call the frames.

Author:  Djinn [ Tue Jul 24, 2012 7:28 pm ]
Post subject:  Re: Animation, Attachable and Framecount Question

xenoargh wrote:
It should work, yes; Lua is able to specify which frame the Attachable is showing, see the Wiki for details about how to call the frames.


I have briefly tried things like this in the past (before Lua could be run on attachables, natch), but I've always had to attach the lua file to the object in question - in this scenario you'd have to get access to the other attachable also. See what I'm getting at, or am I not making sense? :-(

Author:  xenoargh [ Thu Jul 26, 2012 3:50 pm ]
Post subject:  Re: Animation, Attachable and Framecount Question

If you need access to the other Attachable, that's pretty straightforward: iterate through all the MOIDs and find the Attachment. This should work, I think:

Code:
for i = 1, MovableMan:GetMOIDCount()-1 do
            local mo = ToMovableObject(MovableMan:GetMOFromID(i));
            if mo.RootID ~= nil then
               if mo.RootID == self.RootID and string.find(mo.PresetName,"name of my Attachable here",1,true) then
                  self.my_attachment_name = mo;
               end
            end
         end   

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/