View unanswered posts | View active topics It is currently Wed Dec 25, 2024 5:37 pm



Reply to topic  [ 4 posts ] 
 Animation, Attachable and Framecount Question 
Author Message
User avatar

Joined: Sun Oct 29, 2006 4:26 am
Posts: 298
Reply with quote
Post 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?


Tue Jul 24, 2012 6:58 pm
Profile YIM

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post 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.


Tue Jul 24, 2012 7:04 pm
Profile
User avatar

Joined: Sun Oct 29, 2006 4:26 am
Posts: 298
Reply with quote
Post 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? :-(


Tue Jul 24, 2012 7:28 pm
Profile YIM

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post 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   


Thu Jul 26, 2012 3:50 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.041s | 13 Queries | GZIP : Off ]