Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: maximusfink on Mon 15/10/2012 00:27:06

Title: SOLVED: Implementing a Custom Dialog GUI
Post by: maximusfink on Mon 15/10/2012 00:27:06
Hey everyone.

I want to create a custom dialog GUI, I'm not sure how to start. Right now I'm Using LucasArts style speech. What I'm aiming for is a system where the character's lines appear not over their heads, but in a static rectangular GUI that occupies the bottom of the screen. When I say static, I just mean that unlike with the TextWindowGUI method, the dimensions of this GUI shouldn't wrap to the string of text. I'd also like to have separate GUIs on the right side of the text window to display a non animating portrait of the character whose line is currently being displayed. Additionally, I'd like to keep the characters doing their speech animations as they would normally. I've been checking out tutorials and the manual, and old forum posts, but I'm still kind of lost. Anyway, It seems like I'd need to create a function (or void?) that passes each line of dialog to be displayed in the GUI label, and also one that checks which character is speaking and changes the portrait GUI Graphic accordingly. So I THINK I know what I need to do, but I don't know how to do it. Any ideas?

If anyone is confused about what I'm trying to achieve, I can always upload a picture to reiterate.
Thanks a million for any suggestions.

EDIT: After posting this I kept tinkering around with it and it finally clicked (kind of) and I was able to scavenge some ideas from an old thread.

//placed right after function game_start in global script, I also Imported it in the global.ash

void Saying(this Character*, String message)
{
  lblText.Text = message;
  gDialog.Visible = true;
  this.Say(message);
  gDialog.Visible = false;
}


finally I realized that I needed to replace every instance of 'character.say' with 'character.saying'. I also replaced the speechfont with an invisible one.
Im making a bit of progress here, but is this the most sensible way to go about this? Also does this mean that I have to go into every dialog script and replace the streamlined dialog commands with my own 'Character.Saying' one?
Title: Re: Implementing a Custom Dialog GUI
Post by: Khris on Mon 15/10/2012 10:33:14
Unfortunately, yes.

Having a better way to replace or extend existing functions is hopefully one of the priorities for future versions.
Title: Re: Implementing a Custom Dialog GUI [SOLVED]
Post by: maximusfink on Mon 15/10/2012 16:27:27
ok thanks Khris. Good to know, my game is very short so that's not the most tedious thing in the world by any means. I'll mark this as solved.