Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Joelman on Thu 04/12/2003 19:19:36

Title: Make ego talk?
Post by: Joelman on Thu 04/12/2003 19:19:36
hey all, I'm trying to make the main char talk when looked at, grabbed, or talked to, rather than just displaying a message. I've looked through the manual and everything else i could think of, but i can't figure it out. I would appreciate any help.
Title: Re:Make ego talk?
Post by: Babar on Thu 04/12/2003 19:39:59
You need to choose the name of your character from the list in the Message editor. THe default is "Normal Text". Change it to the name of your character.
Title: Re:Make ego talk?
Post by: Joelman on Thu 04/12/2003 19:51:50
lol how did i miss that. thanks!
Title: Re:Make ego talk?
Post by: Joelman on Thu 04/12/2003 20:00:25
..um, wait, im in the global messages thing, no name chooser there... double clicked the mssg to edit it, not there either. Am I missing something totally obvious?
also I'm using  Game-DisplayMessage
is that good or bad?
Title: Re:Make ego talk?
Post by: Ishmael on Thu 04/12/2003 20:21:26
You need to check the "Always display as speech" option in the general settings to get those global messages to be displayed as the player character's speech.

Another option is to remake the interactions:

in the characters editor, go to your main char and click on the "Interactions" button, doubleclick on the "Look at...", "Interact..." and "Talk to..." options in turns and select "Run script" from the dropdown menu, and then click the OK button. when you have these three defined, go to the global script and add to it's start:

string egointact;

and then go to the bottom of the script where you should find functions like:

function character0_a() {
// look at character

}

or similiar (I don't remember the exact form). Add to every one some code as follows:

to Look:

GetMessageText(999, egointact);
DisplaySpeech(EGO, egointact);

to Interact:

GetMessageText(998, egointact);
DisplaySpeech(EGO, egointact);

and to Talk:

GetMessageText(997, egointact);
DisplaySpeech(EGO, egointact);

Hope this helps.
Title: Re:Make ego talk?
Post by: Inkoddi on Thu 04/12/2003 20:25:39
or you could just do this:

Run script

DisplaySpeech(EGO, "Whoa! I'm talking to myself")
Title: Re:Make ego talk?
Post by: Ishmael on Thu 04/12/2003 20:31:18
>:/ yeah, sure... but editing the messages through the global message editor is easier and cleaner... or not... :P
Title: Re:Make ego talk?
Post by: Joelman on Thu 04/12/2003 20:44:51
cool, thanks guys.