How do I put the characters names in their text window

Started by shayavr, Thu 15/10/2009 09:39:17

Previous topic - Next topic

shayavr

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
the dude abides

Matti


shayavr

yap.. good point
already checking the manual..
Thanks Mr Matti

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



the dude abides

NsMn

Code: ags

Display(String.Format("Hello, my dear friend %s. How are you?", player.Name));

Khris

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.

shayavr

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..

the dude abides

Khris

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.

NsMn

What you might want to try is the DisplayTopBar command... unfortenately, it's not compitable with speech yet.

Lufia

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.

shayavr

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.. :-[

the dude abides

Khris

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?

shayavr

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. :-\



the dude abides

Khris

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!".

SMF spam blocked by CleanTalk