Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: leone on Fri 11/03/2005 20:17:00

Title: Discourse with sidekick [SOLVED]
Post by: leone on Fri 11/03/2005 20:17:00
Hello,

I started working with dialogs and there was no problem when I had a static character that shows up in just one room.

But what do I do when I have a female character that follows the hero throughout the game (like Sophia follows Indy in Fate of Atlantis)?

I want the player to be able to talk to her at any time, and depending on the situation start (many) different topics.

Could someone point me in the right direction?
Title: Re: Discourse with sidekick
Post by: Freydall on Fri 11/03/2005 22:17:57
I apologize for getting your hopes up of getting advice but I can't see your problem clearly. Do you not know how to make your female character follow the main character,is it that when you want to talk to her it doesn't work?
Title: Re: Discourse with sidekick
Post by: leone on Fri 11/03/2005 23:21:40
No, I think I got that. I was thinking about this: she should follow the hero through many rooms, and in each room, depending on the objects you found, people you talked to, things you did up to that moment,Ã,  you should get different topics when you talk to her.

So far I made a couple of characters that are each standing in one place, and you meet them and talk about one or two topics. That's all nice and linear. But this seems to me more complicated, many possible topics for a single character, that should show up at the right place and time.

I gather I should use variables and put the whole thing in her Characters -Interaction - Talk to character bit, but I'm not too sure how to start with this.
Title: Re: Discourse with sidekick
Post by: Freydall on Sat 12/03/2005 16:24:31
I see, all you need to do is, say if you picked up an object. Not only do want to give you the item but you want to use the 'Game-SetVariableValue' Change the variable and then go to edit variables. Click on new variable and give it a name. Click OK and change the variable from Global 1 to the one you just created. Then change the value to 1. Go to your female characters talk interaction and add a conditional- if variable set to current value (1), run dialog or game-enable dialog option depending on what you want.
Title: Re: Discourse with sidekick
Post by: leone on Sat 12/03/2005 23:58:24
Thanks Freydall, that's the stuff! After I applied what you said it led me to experiment some more, and I think this is the way to go:

When the hero, say, picks up an object, I set the variable value like you said. Then in my female character's talk interaction I first check in which room the hero is in, and then if he has the object. Something like:

Ã,  if (character[HERO].room == 10) {
Ã,  Ã,  if (GetGlobalInt(2) == 1)Ã,  // hero has the object
Ã,  Ã,  Ã,  Ã, RunDialog (7);Ã,  Ã,  Ã,  Ã,  // talk about the object
Ã,  Ã,  else RunDialog (6);Ã,  Ã,  // some general topic
Ã,  }