Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: NuDawnII on Fri 15/05/2015 02:24:46

Title: ChangeView only animates frame 1
Post by: NuDawnII on Fri 15/05/2015 02:24:46
I have looked through related posts, but have not seen one in which the response solves my issue.  I have a beach scene where I have set a region in the water.  When the player is standing on the region of water, I am changing the view from the from the walking view to a splashing view.  Code is as follows:

function region2_Standing()
{
    cEgo.ChangeView(VEGOSPLASH);
    cEgo.
}
function region2_WalksOff()
{
    cEgo.ChangeView(1);
}

The view changes appropriately and when standing in the water, the player standing frame (0) of the splash view is shown.  However, when the player walks in the water, the view moves to frame 1, but does not animate the other 5 to 7 frames of the loop.  Therefore, the player just floats across the screen with the same image.  Ultimately, when the player exit the water and the view is changed back to the walking view 1, animation is correct.
Title: Re: ChangeView only animates frame 1
Post by: Gilbert on Fri 15/05/2015 03:42:35
Use the Player walks onto region event instead of While player stands on region as the latter one will trigger the code repeatedly every game loop, so the ChangeView() call is done repeatedly, resetting the character to be at his first frame.
Title: Re: ChangeView only animates frame 1 - SOLVED
Post by: NuDawnII on Fri 15/05/2015 21:33:14
I changed this and it did the trick.  Thanks for the tip.