Logo

[Help] SM5 - Controlling speed in a tile based animation?

Register Log In Back To Forums

Post #1 · Posted at 2016-10-26 01:40:18am 7.4 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Hello friends, I was creating a theme and I've been stucj with this:

I have a tile based animation, for example a file named "animation 2x2.png", I load it on an actor object, but the speed of the animation is too fast, and I want to slower it, but I have not found how, I've tried using decelerate, but obviously It doesn't work 'cause is not a tween. There is an alternate way to do this? Thanks!

Post #2 · Posted at 2016-10-26 09:35:39pm 7.4 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2016-10-26 09:39pm
If it's a basic animated Sprite, you're looking for SetAllStateDelays(). It's a Sprite method.

Quote
SetAllStateDelays( float fRate )
Sets all the state delays to fRate. Useful for Sprites that need to change by BPM (e.g. Tran from DDR 5th Mix, the cube from DS EuroMix 2).

If it's a scrolling texture, you're looking for texcoordvelocity(). It's also a Sprite method.

Quote
texcoordvelocity( float fVelX, float fVelY )
Set the texture coordinate velocity which controls how the Sprite changes as it animates. A velocity of 1 makes the texture scroll all the way once per second.

Feel free to look at the other methods available to Sprite here: http://dguzek.github.io/Lua-For-SM5/API/Lua.xml#Sprite
(You'll need to click "Class Sprite" to expand it.)

Post #3 · Posted at 2016-10-30 02:34:46pm 7.4 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
I had a similar issue with animating the dancer sprites from 3rdMix. I found that using SetAllStateDelays(0.1200) and effectclock('beatnooffset') got the 4x8 sprite to animate the at the correct speed for the current songs BPM. I just adjusted the SetAllStateDelays till I was happy with the animation speed.

Not sure if it matters but the default SM5 effectclock speed is 120bpm (I worked that out as that is the default speed of cabinet light changes when not on a song according to the source files) - so maybe 0.1200 is the correct delay as the sprite changes can move up or down from the default BPM, though it could be a complete coincidence that it worked for me and the number 120 was in the delay. If a song is not highlighted, they animate correctly to the 120bpm beat.

dbk2 can probably elaborate on the hows and whys better than me. I just thought I'd chip in so you could test SetAllStateDelays(0.1200) rather than trial and error-ing to get the right delay.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #4 · Posted at 2016-10-30 02:46:30pm 7.4 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

I will check the docs, the animation that I like to tune is sprite based, and it will be easy, because all the frames have the same speed. Thanks dbk2, I will post here later my results
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 3% · Database: 8% · Server Time: 2024-04-16 18:55:28
This page took 0.002 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language