can I choose my character's frame/sprite when I call the Wait() function?

Started by Filipe, Wed 03/04/2019 23:11:45

Previous topic - Next topic

Filipe

Hi,

Is there a way of choosing the frame/sprite we want our character to be, when we call the Wait() function? Also when I make a Non Playable chatracter talk with me, what is the frame AGS choose for my playable character, while the other is speaking?

I have my character seated on a chair, then I make him say something, and then I try to pause it, so that the human player/user/gamer (us) can read what my character is saying, with the wait() function, before he goes on saying something elese. However when I do this, he diplays my character frame of my cuurent view, which is the 1st frame of a loop, that makes my character seats on the chair... it is funny :) Also when my other character, talks with me, this happens again, my character goes to the 1st frame of the current view, so he stands up... I'm not sure if AGS is actualy using the first frame of my idle chatracter view, which is the same (my character standing). In this case, can I change the idle view, as I change my speechview?

What I really wanted was that there were some sort of comand that freezed my character after he speaks... or the hability to choose the frame that is used on the Wait function, or when my character is just listening...

Thanks  :)

Khris

If your character is going to sit on that chair during conversations and the like, you should use the ChangeView() command (instead of just LockView).

This way AGS will permanently use the provided view as normal view, until you change it back to the standard walk cycle (using ChangeView a 2nd time).

Filipe

Thanks, but I only going to do animations... Is the frame used by the wait () the first frame of the correspondent idle view? How can I make a pause after the character says something, so that it gives us more time to read what is being displayed/said? when our character is listening to other, is the idle view used?

Khris

Can you show some code?
Afaik, if you called LockView(), AGS doesn't change the frame on its own until you call UnlockView(). So your character should remain seated during conversations and Wait calls.

However if you want the character to be able to talk using an "in chair" SpeechView, you need to use
Code: ags
  player.Walk(...); // walk to chair
  player.LockView(PLAYERANIMS);
  player.Animate(...); // sit down
  player.UnlockView();
  player.ChangeView(INCHAIR);
  player.SpeechView = INCHAIRSPEECH;

to permanently change both the normal view (used for walking) and the speech view.

The IdleView is irrelevant here.

Filipe

ok, thanks, but I noticed that when a non player character says something to my character, my character starts the idle view... my code is a real mess. I'm asshamed to show it :(

Khris

Yes. Again, if you've called UnlockView() after the animation, regular engine behavior takes over and AGS shows the NormalView / IdleView.
Which means if you've set an idleview, you need to change it to a chair idle view (or disable it) while the player is sitting in the chair.

SMF spam blocked by CleanTalk