ID:773974
 
Resolved
Limited-time looping animations (not flicks) had their time counters reset by appearance changes unrelated to the animation, such as invisibility. Now only icon or icon_state changes will reset the counter.
BYOND Version:494
Operating System:Windows XP Home
Web Browser:Firefox 12.0
Applies to:Dream Seeker
Status: Resolved (495)

This issue has been resolved.
Descriptive Problem Summary:
When setting animations to "loop once" and flipping the invisibility setting on/off, if the icon_state is set to the animation that is supposed to loop once the animation resets to the beginning when the invisibility is flicked on/off.

Demo to Reproduce Problem:
http://files.byondhome.com/Megablaze/Pixel%20RPG.zip

Numbered Steps to Reproduce Problem:

Run the game, run to the right until you find the slime enemy, hold X to charge your attack, run into the slime, while you're flickering release the attack button to attack. For testing purposes I've set the character animation to show his arm for only the first frame (which you will notice while not flickering). While flickering, the arm is shown repeatedly as the animation restarts (the sword animation also repeats but gets in 2 frames because it's 0.5/10 ticks a second). The invisibility is set on/off every 1/10th a second, so the arm looks static from the repeat.

Expected Results:
When changing the icon_state to an animation that loops once the animation should play from start to finish and stop at the end of it's animation, regardless of invisibility changes.

Actual Results:
When altering the invisibility, the animation from a "loop once" animation repeats from the beginning. Setting see_invisible does not change the repeating animation (you simply see it repeat twice as much due to not turning invisible).

Does the problem occur:
Every time? Or how often?
Every time.
In other games?
Yes.
On other computers?
Unknown.

When does the problem NOT occur?
Always occurs if you follow those steps.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
Tested in an earlier version (with a different game) and it produced the same results.

Workarounds:
Unknown.

I tried to reproduce this by downloading the test project and following your instructions, but I'm not sure I see problem. Per your instructions I went east and attacked the slime. While I was flashing I attacked again. The only real difference I'm seeing is that while flashing the arm looks extended during the attack sequence where you'd expect it to be, and I don't see the arm fully extended like that when not flashing.

I'll probably need source code to really understand what's going on (and what's supposed to be), including a chance to look at the icons up close to see how the looping is setup.
Lummox JR changed status to 'Unverified'
In response to Lummox JR
Lummox JR wrote:
While I was flashing I attacked again. The only real difference I'm seeing is that while flashing the arm looks extended during the attack sequence where you'd expect it to be, and I don't see the arm fully extended like that when not flashing.

That's the issue, that tester demo isn't supposed to show the arm fully extended during the animation. The animation in that demo only shows the arm during the first frame, so it would be expected to only show it during the first frame, but because it repeats when you flash (which is the bug), it looks like the arm is constantly extended. You can also note the repeated animations of the sword, if you hold the attack button down for a second before you release, it will release a charged attack, the restarting animation will be more noticeable when it's charged.

I sort of made the arm animation counter-intuitive for displaying the bug.
In response to Lummox JR
I've created a demo that displays the issue (hopefully more clearly):
http://files.byondhome.com/Megablaze/TestProject.zip

After you compile/run, you'll see one block on the top left, that's the glitched version, invisibility setting is changed every tick. The one below doesn't flicker with invisibility, that is the expected result. The block on the top right does NOT have the animation set to "loop x times", it does switch between invisibility settings, but that one isn't glitched and continues the animation. The one on the bottom right doesn't flicker and doesn't have the animation set to "loop x times".
I see the issue now. Any appearance update is resetting the time counter on the object, which makes sense for when you switch to a looping animation; the problem is the invisibility change counts as a new appearance. I'll confer with Tom as to how we want to handle this.
Lummox JR resolved issue with message:
Limited-time looping animations (not flicks) had their time counters reset by appearance changes unrelated to the animation, such as invisibility. Now only icon or icon_state changes will reset the counter.
Yay, I'm super happy, thanks.