SayBackground and Movement

Started by El_Yind, Sat 19/01/2008 03:43:36

Previous topic - Next topic

El_Yind

Hi. I have just began with AGS and I'm trying to do a modification of MI but something that AGS does is the characters when talk pauses the game so with SayBackground I can say something and move but it hasn't any animation at all.

I made a code to do what MI does, when character is talking and you are moving the characters walks as usual but when it stops moving it continue moving the lips until the dialog ends

I made this code but my problem is when I change the view I loose the face direction.

My code is: (If you know something better to do this please tell me)

This in Global Overlay* miOverlay;

This code in repeatedly_execute()
if (miOverlay != null) {
if(miOverlay.Valid == 1) {
    if (cEgo.Moving==1 && animo==1) {
       animo=0;
       cEgo.ChangeView(3);
       //cEgo.FaceLocation(exx, exy);
    } else if (cEgo.Moving==0 && animo==0) {
       animo=1;
       cEgo.ChangeView(4);
       cEgo.Animate(0, 5, eRepeat,eNoBlock);
       //cEgo.FaceLocation(exx, exy);
    }
  } else {
    if (animo==1) {
      animo=0;
      cEgo.ChangeView(3);
      //cEgo.FaceLocation(exx, exy);
    }
  }
}


And this when the char says something miOverlay = cEgo.SayBackground("No puedo darle nada a eso.");


Thanks!


Gilbert

I'm too lazy to read your codes at the moment, but I think one suggestion is not to use ChangeView() for temporal animations, but use LockView() and UnlockView() instead.

See http://www.adventuregamestudio.co.uk/yabb/index.php?topic=33447.0 which was about exactly the same thing, just a few days ago.

El_Yind

Yeap, that works enough there is the code if anyone needs it.

if (miOverlay != null) {
if(miOverlay.Valid == 1) {
      if (cEgo.Moving == 0) {
        if (cEgo.View!=cEgo.SpeechView){
          cEgo.ChangeView(cEgo.SpeechView);
          cEgo.Animate(cEgo.Loop, 4, eRepeat, eNoBlock);
        }
      }
      else{
        if(cEgo.View!=3) cEgo.ChangeView(3);
      }
  } else {
     if(cEgo.View!=3){
     cEgo.ChangeView(3);
    }
  }
}

SMF spam blocked by CleanTalk