Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shayavr on Thu 15/10/2009 09:39:17

Title: How do I put the characters names in their text window
Post by: shayavr on Thu 15/10/2009 09:39:17
Hi

I want to make a sierra style speech mode in my game so when you talk to the character or when the player is talking the text window is shown by a picture of the speaker (as usual..) but there's also a bar at the top of the text window that shows the speaking characters name.

Does anyone know how to do that?
Any help would be appreciated.
Thanks
Title: Re: How do I put the characters names in their text window
Post by: Matti on Thu 15/10/2009 15:02:42
I think String Character.Name is what you're looking for..
Title: Re: How do I put the characters names in their text window
Post by: shayavr on Thu 15/10/2009 15:25:10
yap.. good point
already checking the manual..
Thanks Mr Matti

But how do I apply the name property to the text window GUI ?



Title: Re: How do I put the characters names in their text window
Post by: NsMn on Thu 15/10/2009 15:30:25

Display(String.Format("Hello, my dear friend %s. How are you?", player.Name));
Title: Re: How do I put the characters names in their text window
Post by: Khris on Thu 15/10/2009 15:33:13
No.

I've never used Sierra Speech style, so I'm just guessing here:
Afaik, there's no built-in way to display the name in the corner of the text window.
You could try setting Character.Name but I doubt this'll suffice.
Title: Re: How do I put the characters names in their text window
Post by: shayavr on Thu 15/10/2009 16:08:06
Thanks Khris.

The only option I can think of is simply to make the characters speech view contain his/her name so it's not a part of the GUI but a part of the views sprite.

Anyway if a more elegant solution comes to someones mind I`d sure be glad to hear it..

Title: Re: How do I put the characters names in their text window
Post by: Khris on Thu 15/10/2009 20:21:36
Another way would be to check for talking characters in rep_ex_always and display the name on a seperate, correctly positioned GUI.
Don't know how feasible this is.
Title: Re: How do I put the characters names in their text window
Post by: NsMn on Thu 15/10/2009 20:30:11
What you might want to try is the DisplayTopBar command... unfortenately, it's not compitable with speech yet.
Title: Re: How do I put the characters names in their text window
Post by: Lufia on Thu 15/10/2009 20:31:20
It would be better to customise the function used for speech.

function Whatever(this Character*) {
myGui.SetPosition
myNameLabel.Text = this.Name
this.Say("Hello there !")
}

General outline, not legit code. Don't copy/paste but do look up GUI functions and extender functions in the manual.

Maybe it can be done with an Overlay, to avoid having one more GUI. I haven't read up on text overlays.
Title: Re: How do I put the characters names in their text window
Post by: shayavr on Fri 16/10/2009 10:12:43
Thanks for taking the time to reply everybody

I guess it's not as trivial as I thought it is.
I've been working on this all night and still no significance breakthrough.. :-[

Title: Re: How do I put the characters names in their text window
Post by: Khris on Fri 16/10/2009 12:06:11
Just had a revelation:
Use a custom TextWindowGUI and a custom Say command, and right before speech is displayed, set the top border image to a DynamicSprite's graphic that's made of the border sprite with the name printed on it.
The drawback is that this wouldn't work during dialogs.
However, Sierra games usually have fixed dialogs anyway, so maybe this'll do?
Title: Re: How do I put the characters names in their text window
Post by: shayavr on Fri 16/10/2009 14:11:52
Ok.. this could defently work for Say command
I'm already on it.
thanks Khris

My game is more like Heart of China style so dialogs are importent for the plot though..
So will have to figure something out for multi options dialogs. :-\



Title: Re: How do I put the characters names in their text window
Post by: Khris on Fri 16/10/2009 14:19:43
You can always use the custom function for all dialog lines, it's just more of a hassle to type " player.CSay("Hi");" instead of "player: Hi!".