Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character's explicit animation resets to frame 0 if char stops moving #1123

Closed
ivan-mogilko opened this issue Sep 27, 2020 · 0 comments
Closed
Labels
context: game logic type: bug unexpected/erroneous behavior in the existing functionality

Comments

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Sep 27, 2020

Most recent report: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58446.0

Describe the bug
If a non-blocking character animation is started, and then character's Move command is called (either blocking or non-blocking), then, as soon as character arrives to destination and stops:

  • if animation was already complete, then character's frame resets to frame 0 of the animation loop and keeps that;
  • if animation was still playing, then it resets to frame 0 and continues playing to the end again.

AGS Version
At least in AGS 3.4.3 - 3.5.0, but could be an older issue.

To Reproduce

  1. Create a separate view with 1 loop and few frames;
  2. Use similar script:
player.LockView(VMOVEANIM);
player.Animate(0, 2, eOnce, eNoBlock);
player.Move(50, 100, eBlock, eAnywhere);
  1. Run the game and trigger above script.
  2. Observe the problem.
    Note you may experiment with the movement and animation speeds to see both potential outcomes described above.

Expected behavior
Character stopping after movement should not reset (or otherwise affect) ongoing animation if the view is locked.

Known workarounds
The simpliest known is to change coordinates by hand instead of calling Move, but this is only useful if you are moving without walkable areas, as you won't be able to utilise pathfinding, for example:

player.LockView(VMOVEANIM);
player.Animate(0, 2, eOnce, eNoBlock);
int current_x = player.x;
while (player.x > current_x - 100)
{
    player.x -= 5; // change 5 to the wanted speed
    Wait(1);
}

May be or not relevant to #935.

@ivan-mogilko ivan-mogilko added type: bug unexpected/erroneous behavior in the existing functionality context: game logic labels Sep 27, 2020
@ivan-mogilko ivan-mogilko added this to the 3.5.1 milestone Sep 27, 2020
@ivan-mogilko ivan-mogilko changed the title Character's forced animation resets to frame 0 if char stops moving Character's explicit animation resets to frame 0 if char stops moving Sep 27, 2020
@ivan-mogilko ivan-mogilko removed this from the 3.5.1 milestone Feb 13, 2021
@ivan-mogilko ivan-mogilko added this to the 3.6.0 maintenance milestone Apr 2, 2023
ivan-mogilko added a commit that referenced this issue May 31, 2023
Unlike Walk(), Move() is not supposed to animate character, or change frames.

Fixes #1123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: game logic type: bug unexpected/erroneous behavior in the existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant