Rick Posted December 22, 2013 Share Posted December 22, 2013 I'm using the lua animation manager script and notice some weird stuff on some animations. It's like they were starting sort of in the middle or just not from the beginning. I removed the offset in the script but I get the same problem. The first parameter name is called time, but the description says frame. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetanimationframe-r141 I assume each sequence has a starting frame of 0 and goes to however long the animation is. If we pass an animation frame that is beyond the max frame count of said seq it'll loop over. So really the current way the animation manager works with the formula: frame = currenttime * animation.speed It never forces the animations to start on the first frame. It could start on any frame. This creates strange artifacts because I would expect a walk animation or strafe animation to always start on the first frame when I transition to them. The longer the animation the more noticeable this issue would be. Am I missing something with doing it this way because it doesn't really seem all that acceptable as a method of doing animations. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 22, 2013 Share Posted December 22, 2013 I assume it was done as an easy way to cycle through the frames as time is constantly increasing. This method was also used in LE2 documentation. If you want to control where the frame starts and ends then you have to program for that by simply setting the start frame then increment the frame count yourself. In LE2, I always used AppSpeed() to increment the frame count while checking for the end frame to know when it was finished. psuedocode: frame = 0 endframe = 150 ... ... if playAnimation == 1 then entity:Animate(frame, 1, 0, 1 ) frame = frame + AppSpeed() if frame >= endframe then playAnimation = 0 frame = 0 end end 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Rick Posted December 22, 2013 Author Share Posted December 22, 2013 Cool, thanks Mack. This should be a pretty easy change because it sounded like in LE 3 the frame loops around if it's > the max frame count. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 22, 2013 Share Posted December 22, 2013 No problem. Yep it did the same in LE2. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.