Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: rtf on Fri 13/02/2004 23:40:46

Title: Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: rtf on Fri 13/02/2004 23:40:46
Something isnt working right in this animation command.
Everything works except for the actual animation.  All the loops and views are correct, and I can't see a problem:

Quote
StartCutscene(1);
MoveCharacterBlocking(1, 661, 106, 0);
DisplaySpeech(1, "Take a deep breath and...");
SetCharacterView(1, 14);
AnimateCharacter(1, 2, 3, 2);
SetCharacterView(2, 15);
ObjectOn(5);
DisplaySpeech(1, "Hahahahahahaha!");
ReleaseCharacterView(1);
EndCutscene();

If you help me out I might add your name to my credits  :D
Title: Re:Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: Squinky on Sat 14/02/2004 00:27:48
You probably need to put a Wait (); command in there after the animation.
Title: Re:Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: Darth Mandarb on Sat 14/02/2004 00:44:33
use this:

StartCutscene(1);
MoveCharacterBlocking(1, 661, 106, 0);
DisplaySpeech(1, "Take a deep breath and...");
SetCharacterView(1, 14);
AnimateCharacter(1, 2, 3, 2);
while (character[CHARID].animating==1) {
 Wait(1);
 }

SetCharacterView(2, 15);
ObjectOn(5);
DisplaySpeech(1, "Hahahahahahaha!");
ReleaseCharacterView(1);
EndCutscene();

See if that works.

~ d

Edit - Squinky's idea would work too ... but you'd have to play around with how long to wait to get it to work right.  This way just waits until the animation stops and then continues the script.
Title: Re:Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: rtf on Sat 14/02/2004 03:56:14
Awesome.  Thanks, Darth Squinky.
Title: Re:Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: rtf on Sat 14/02/2004 16:59:20
Uh oh, I tried Darth Mandarb's thing and it didnt work.  And I added a wait command but still nothing happened.
Title: Re:Asanine And Appaled Antics At Articulating An Animation Attempt
Post by: Darth Mandarb on Sat 14/02/2004 17:55:58
Quote from: releasethefrogs on Sat 14/02/2004 16:59:20
Uh oh, I tried Darth Mandarb's thing and it didnt work.  And I added a wait command but still nothing happened.

D'OH!!  I can't believe I didn't see this first:

StartCutscene(1);
MoveCharacterBlocking(1, 661, 106, 0);
DisplaySpeech(1, "Take a deep breath and...");
SetCharacterView(1, 14);
AnimateCharacter(1, 2, 3,0); // last digit can only be 0 or 1 (0 no repeat, 1 repeat)
while (character[CHARID].animating==1) {
Wait(1);
}
SetCharacterView(2, 15);
ObjectOn(5);
DisplaySpeech(1, "Hahahahahahaha!");
ReleaseCharacterView(1);
EndCutscene();

You can't use the "while" statement if you set it to repeat though, cause it'll keep waiting forever!  So you'll have to make the animation double up if you wanted it to run through twice!

See if that works!

~ d