Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SebH on Tue 14/02/2012 17:40:34

Title: Making characters able to talk and walk simultaneously
Post by: SebH on Tue 14/02/2012 17:40:34
I've been working on my project for a while now (special thanks to Khris for solving my problem with having different characters speak in a different font), and I've come across another problem which I haven't been able to surmount -- I need to make it so that characters (mostly just the player character) can talk and walk at the same time, like in the LucasArts point-and-clicks. Using SayBackground doesn't work, as the characters don't play their speaking animations, and the Queued Speech module won't let the player character move while speaking. So, what can be done about it?

Again, any help would be much appreciated.
Title: Re: Making characters able to talk and walk simultaneously
Post by: steptoe on Tue 14/02/2012 21:10:36
I expect you would have to make a new walking view with talking loop views and change to that view for the walk and talk.

Title: Re: Making characters able to talk and walk simultaneously
Post by: Bernie on Wed 15/02/2012 14:49:26
There are few versions of this feature in the Plugins/Modules Forum. Usually, they display the speaking animation if the player is standing still and not displaying a blocked animation.

Here's one that sounds pretty good:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35787.0
Title: Re: Making characters able to talk and walk simultaneously
Post by: SebH on Wed 15/02/2012 20:07:49
The links for the background speech module are down. Any other ones available?
Title: Re: Making characters able to talk and walk simultaneously
Post by: RoliX on Fri 17/02/2012 13:39:47
You have a walking view and a speech view, but if you want to talk and walk simultaneously, you need a whole new view.
Unfortunately, AGS is not a magical tool what mix your walking and talking views and create you a whole new animation. Also, the engine can not assign a "walk+talk" animation to the characters.

You should forget about solving this feature with 2 clicks and 3 lines of script. Basically, you faced something what AGS does not support. You faced the border of AGS's basic capabilities. Stretching this border(e.g. implement whole new features into AGS) is not for beginners. If you are not a professional scripter, you should search for a module or plugin. If no module exists, then you can ask somebody to create one, BUT you should prepare that not many people will build a whole new module just for your needs.

If you can't find a pre-made solution in the forum, I suggest you to drop this idea. We have seen tons of brilliant games where the characters did not need to talk and walk simultaneously, so its not a critical feature.

Sorry for my attitude, but I've seen tons of great AGS games and many of them only used the default features of AGS and some modules if neccesary.
I don't like when beginners trying to make their first games and their first think is like "hey, lets do something what is not supported in AGS".
Title: Re: Making characters able to talk and walk simultaneously
Post by: Dave Gilbert on Fri 17/02/2012 21:04:44
I snuck something like this into a defunct project of mine. What I did was create a dummy version of the character's head (which contains the talk animation) and snap it to the body using the "repeat_execute_always" function which continually updates the x/y position of the head relative to the body. Then you set the character walking using a nonblocking walk function, and then have the character talk. Worked perfectly.
Title: Re: Making characters able to talk and walk simultaneously
Post by: Khris on Fri 17/02/2012 21:11:26
It should also be possible to do this with the Character.Follow command. That way you can additionally control which character is drawn in front of the other without having to put them on different y coordinates.
Title: Re: Making characters able to talk and walk simultaneously
Post by: SebH on Sat 18/02/2012 15:24:28
Snapping a seperate head to a body sounds like it could be the solution, but I haven't managed to make the head follow the body so far. Is there something simple I'm overlooking?
Title: Re: Making characters able to talk and walk simultaneously
Post by: Khris on Sat 18/02/2012 15:28:42
The proper command should be
  cHead.FollowCharacter(cBody, FOLLOW_EXACTLY, 0);
(Issues like this, always post the code you tried.)
Title: Re: Making characters able to talk and walk simultaneously
Post by: TheMagician on Sun 19/02/2012 23:55:44
Animating the head separately is what was done in some of the old-school adventure games like FoA so it should do the trick.
Title: Re: Making characters able to talk and walk simultaneously
Post by: steptoe on Mon 20/02/2012 04:44:31
I once had a separated head long ago.. worked a treat. Now I would do it slightly differently  ;)



Title: Re: Making characters able to talk and walk simultaneously
Post by: SebH on Wed 29/02/2012 17:40:07
I've managed to get a character's head following his body all right with the FollowCharacter command, but the head always faces forwards, even if the body is facing a different direction. How could this be fixed?
Title: Re: Making characters able to talk and walk simultaneously
Post by: Khris on Wed 29/02/2012 20:28:16
Put this in repeatedly_execute_always:

  cHead.Loop = cBody.Loop;
Title: Re: Making characters able to talk and walk simultaneously
Post by: SebH on Wed 29/02/2012 21:09:14
That solved it, Khris. I've got my characters walking and talking perfectly now. Thanks for the help! And thanks to Dave Gilbert as well for the dummy head suggestion. I couldn't have done it without both of you.