Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: j-Hed on Mon 08/03/2004 15:11:55

Title: Animate char before talking
Post by: j-Hed on Mon 08/03/2004 15:11:55
Hello!

I want an animation to be played before every talkingview and another anim after talking. The person looks out a window and before he answers he turns his head(-anim1) towards the playercharacter,then talks(-talkingview), when he has finished talking he turns his head back to the window (-anim2).
I want to apply it in the Dialog script but maybe there's a better solution.

Any help appreciated, Thanks!
Title: Re:Animate char before talking
Post by: j-Hed on Mon 08/03/2004 16:04:37
I put this:

dialog_request (int parameter) {
   // your code here
SetCharacterView(CAP,7);
AnimateCharacter(CAP,0,0,0);
}

in the global script and I put "run-script" 0, in the dialog script.
I have also tried putting 0 in (int parameter) and various combinations but it doesn't work.

I am very bad at scripting but I really tried finding help in FAQ, technical archive,manual etc. but I can't figure it out.


Title: Re:Animate char before talking
Post by: j-Hed on Mon 08/03/2004 17:50:05
I have solved it!
I had to put wait(10); before the animation runs, but it doesn't want to play an anim after he stopped talking...weird.

Well I have solved the main problem, if someone knows the other problem I'd be delighted to know!

;)
Title: Re:Animate char before talking
Post by: Scorpiorus on Mon 08/03/2004 17:51:17
So you put run-script 0 in the dialog script. Now the content of the dialog_request() function, just a bit of modifications:

function dialog_request (int parameter) {

   if (parameter == 0) { // 0 because your wrote "run-script 0"
      SetCharacterView(CAP,7);
      AnimateCharacter(CAP,0,0,0);
      while (character[CAP].animating) Wait(1); //wait him animating
   }

}

~Cheers