View unanswered posts | View active topics It is currently Fri Dec 27, 2024 9:19 am



Reply to topic  [ 4 posts ] 
 Making things happen according to frame 
Author Message
User avatar

Joined: Sun Oct 29, 2006 4:26 am
Posts: 298
Reply with quote
Post Making things happen according to frame
Here again, this time wondering how to hook into determining what sprite frame is active and then doing stuff based on that. I want it to check for frame 14 and do something then gib or remove the parent. I figured I'd try to do the last part first to test it, and I can't even get THAT to work. Take a look, svp:

function Create(self)
end

function Update(self)
if self.Frame > 13 then
self:GibThis();
end


Thu Feb 18, 2010 2:57 am
Profile YIM
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Making things happen according to frame
function Update(self)
if self.Frame == 14 then
self:GibThis();
end
end

should work, by all accounts, but then, your script should also work.

Check the console for any errors, and then try replacing 'self:GibThis' with 'print("test");', and then spawn the object and check the console

edit: oh and also try just adding 'print(self.Frame)' to the update code (outside of any checks)


Thu Feb 18, 2010 3:10 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Making things happen according to frame
your script needs another end :3


Thu Feb 18, 2010 3:26 am
Profile
User avatar

Joined: Sun Oct 29, 2006 4:26 am
Posts: 298
Reply with quote
Post Re: Making things happen according to frame
... Uh DURR. Woops. Thanks, guys, haha.


Thu Feb 18, 2010 4:25 am
Profile YIM
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.058s | 13 Queries | GZIP : Off ]