Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Wed 23/02/2011 23:23:07

Title: SOLVED: Changed character to new view and does not animate as he moves..
Post by: barefoot on Wed 23/02/2011 23:23:07

Hi

I've changed my character view so he is in a canoe..I have made the animating view and included this in the script below, yet he simply glides across without animating (rowing). The animating view itself is perfect.

The new view only lasts about 3 seconds and then he returns to his normal view.


function region1_WalksOnto()
{
 
 RestoreWalkableArea(2);
 cwizard.Say("I need to get across the river, that man may be a sage!");
 Display("You get in your canoe and oar your way across the Great River");
 cwizard.ChangeView(24);
 cwizard.Walk(518, 186, eBlock);

}


I don't normally have this problem...

cheers

barefoot

.
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: Baron on Thu 24/02/2011 01:03:58
Does View 24 have animated frames in all of its loops, especially the loop related to the direction of travel in question (loop 1 = left, for example)?
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: barefoot on Thu 24/02/2011 06:37:53
Hi Baron

All 4 loop views are correct ie they work in views view as it were and are view no. 24..

I'm using a workaround until it's sorted.

cheers

barefoot
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: Icey on Thu 24/02/2011 07:18:01
If it's a clear path for the wizard you can try this.

cwizard.changeview(24);
cwizard.animate(direction, delay, enoblock, erepeat);
cwizard.Walk(518, 186, eBlock);
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: barefoot on Thu 24/02/2011 07:30:11
Hi Studio3

after adjusting your code (caps etc) I put this in:


function region3_WalksOnto()
{
  cwizard.Say("I need to get across the river, that man may be a sage!");
  Display("You get in your canoe and oar your way across the Great River");
  cwizard.ChangeView(24);
  cwizard.Animate(2, 1, eNoBlock, eRepeat);
  cwizard.Walk(518, 186, eBlock);

}


The character animates but does not walk,,,, it is on a walkable area.

cheers

barefoot


Title: Re: Changed character to new view and character does not animate as he moves..
Post by: Icey on Thu 24/02/2011 07:54:11
Hum... try eAnywhere instead.
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: Icey on Thu 24/02/2011 07:57:58
i mean add this.
cwizard.Walk(0, 0, eBlock, eAnywhere);

Just replace the old walk command I gave you with this
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: barefoot on Thu 24/02/2011 08:27:30
Hi

Nothing seems to get this character to change view and animate whilst walking..could something possibly be blocking it?

here is a screen shot of the views (24)

(http://www.brooklandscarco.co.uk/wizardloops.png)

Ive had a lot of problems with AGS lately..

barefoot

Title: Re: Changed character to new view and character does not animate as he moves..
Post by: Gilbert on Thu 24/02/2011 08:38:01
Well, simple. There is no animation in this character view.

Make sure you remember the fact that the first frame of the walking view of a character is the stationary frame, so the animation in each direction actually starts from the second frame. Just add one more frame (just use the same sprite you use as the stationary frame) to the end of each loop to complete the animation.

Note that if you use character.Animate() it can indeed include the first frame in the loop in the animation. However, as your code is followed by character.Walk() the "...Animate()" line actually does nothing here (and thus can be removed).
Title: Re: Changed character to new view and character does not animate as he moves..
Post by: barefoot on Thu 24/02/2011 09:02:53
Dear Iceboty V7000a

Something I had overlooked..  many many thanks...

cheers

barefoot