Data Realms Fan Forums
http://45.55.195.193/

Making things happen according to frame
http://45.55.195.193/viewtopic.php?f=73&t=17866
Page 1 of 1

Author:  Djinn [ Thu Feb 18, 2010 2:57 am ]
Post subject:  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

Author:  Grif [ Thu Feb 18, 2010 3:10 am ]
Post subject:  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)

Author:  Mind [ Thu Feb 18, 2010 3:26 am ]
Post subject:  Re: Making things happen according to frame

your script needs another end :3

Author:  Djinn [ Thu Feb 18, 2010 4:25 am ]
Post subject:  Re: Making things happen according to frame

... Uh DURR. Woops. Thanks, guys, haha.

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