Speech View (SOLVED)

Started by vjamesv, Sun 21/01/2007 05:27:20

Previous topic - Next topic

vjamesv

All right so this Banana Man game is my first ever game, and my player character has two main views: one with his costume on and one with his costume off.  I recommend anyone making their first game not do something similar.  This has made everything twice as hard for me...  double the animations...   anyway, i am using a dialogue system where a picture pops up of them talking, and i have this working great.  but i am having difficulty getting it to show the right view.  my character needs his costume on in one view and not in the other.  the way i did it, and i thought i had it working...  for the character interaction for the person he is talking to, before it does the run dialog, i have it run the following script:

if (character[AA].View == 1)
{
character[AA].SpeechView = 43; 
}

else if (character[AA].View == 2)
{
character[AA].SpeechView = 47; 
}

when i tested it at first it worked great.  when his costume was on, it was on in his speech view as well.  i even did a little dance because i thought i was so smart.  the problem is when i talk to the character again it does not match up. basically, i talk to the character once without my costume, the speech view has no costume.  1 talk again without putting on the costume, the speechview has the costume.  iput the costume on, the speechview still has the costume.  i take the costume off and talk again, the speech view does not have the costume.

can anyone see if something is wrong in my above code, or is there a better way to go about this?  thanks...

Alynn

probably the easiest way, would be to put it in the game rep_ex or rep_ex_always to check what view the character is in and change the speech view accordingly. Since it is checked every game loop it should be fast enough that you won't have those problems.

Ashen

But, that might have the effect of resetting the View every gameloop as well - I'm not sure how that'd affect the animation. You might want to add a check that the SpeechView hasn't already been changed:
Code: ags

if (cAa.View == 1 && cAa.SpeechView != 43) cAa.SpeechView = 43;
//etc


Or, why not just set the SpeechView at the same time you change the normal view? (That way you only need to do it when you chnage costume, not before EVERY dialogue.)
I know what you're thinking ... Don't think that.

vjamesv

Yeah that worked perfectly.  i just added a script to change his speechview whenever he changes.  so simple.  thanks!

SMF spam blocked by CleanTalk