ID:1988942
 
(See the best response by GatewayRa.)
Is there any way possible to have 2 mobs with the same icon not have their animations be synchronized?

Basically, if 10 players use an icon that say... has an animation where they eyes blink every 5 seconds, is there any way to stagger those animations so every player in the game isn't blinking at the same time? Without making multiple versions of the icon.
Hmm, I'm not sure if icon ticks always join the stack at the same point, or if they synchronize, but if they don't, it's worth testing to see if setting the icon to something blank then after a time of say, rand(3,7), setting the icon to the actual icon. In theory this should off-set it.

Having said that, if that doesn't work then no there is no way I'm afraid, since there's no way to play with icon delays from code. Feature request?
Best response
When viewing the icon in the icon editor, change its option "loop forever" to another value.
In response to GatewayRa
GatewayRa wrote:
When viewing the icon in the icon editor, change its option "loop forever" to another value.

That does work somewhat. But byond limits the number of loops to 65535 times. That'd mean each frame gives... 18~ minutes of animation. I have players playing games that can sometimes last upwards of 2 hours. I guess it'll work if I add redundant frames.

I think I can make that work. Thanks for the idea.
Can't you just reload icon after a certain number of minutes or time has passed?
No, unfortunately, when you use a preset number of loops, reloading the same icon doesn't reset the loop count.
If you want something like offset idle animations, make them separate flick() commands on a random timer for each object.

For something like blinking, what I suggest is having the eyes as an overlay instead of part of the main body itself, then all you have to do to make it blink is simply turn it invisible for a 10th of a second or something.

Although it would be more convenient to have more ability to control the animation frames for DMI icons, there are actually still better ways of doing what you want.

I still say it should go to a feature request, but for now, I hope my workaround will suit what you're doing.
Well, the eye thing was actually just an example.

It's actually for a sidescrolling driving bit of sorts.

The background is animated so it looks like the players are moving and the players are in single direction vehicle icons with their wheels spinning. The wheels occasionally kick off dirt and rocks and whatnot. I wanted to make it so all the vehicles aren't kicking off dust and rocks at the same time and their wheel animations aren't all synchronized.

The eye blinking thing is just the simplest way I could think of explaining it without going in to too much detail.
The same thing would apply. Make the dirt-kicking as an overlay that has no icon state by default, then just set up a random timer that flick()'s it to the icon you want. Flick will run through 1 loop and then return to the normal icon state; in this case, nothing.
Yeah but the wheel spinning animation would still be synced.
In response to IceFire2050
A spinning wheel animation shouldn't really matter, in all honesty. It should be such a subtle effect that being synchronized won't look off. As long as it's not some crazy, really specific and complex animation that is, in which case, spinning wheels probably isn't the thing to spend all that time on. Lol.

If would be better if you had something to show me so I could see what you're talking about, though.
If an icon loops a limited number of times, changing its icon or its icon_state will reset the loop count and the "begin" time for the animation.

Icons that loop forever are synced to simplify processing in Dream Seeker.
Yeah but if you load the same icon again, it doesn't restart the animation. It leaves it at wherever it was previously, even if that's at the end of the animation.

The limited loop count is working well enough for me. My animation is 12 frames long at 1/10 second per frame. At the max loop amount, it can run the animation for around 21-22 hours.
All you need to restart that animation after it's over is to change its icon_state for a few ticks, and change it back after.
I thought the icon frame ticks followed the same clock. This is useful information, if a bit hacky that things need to be delayed specifically for it. I'd like to see a better solution for it sometime, but no pressure. :P
In response to Lummox JR
Lummox JR wrote:
All you need to restart that animation after it's over is to change its icon_state for a few ticks, and change it back after.

Too bad there's no way to get the length of an animation at runtime.

Right??

Right??? Eh?? eh??

Nudge. Nudge.
In response to Rushnut
Rushnut wrote:
Too bad there's no way to get the length of an animation at runtime.

^ This.
This is probably as good a time as any to dip into another wishlist item of mine and develop a proc that returns detailed info about an icon or state, in a multidimensional associative list.
An ability for icon.Blend to take objs would be great too, although unrelated.
In response to Somepotato
I'm not sure what you mean there.
Page: 1 2