Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Superman95 on Sun 21/12/2003 04:30:30

Title: Dialog boxes
Post by: Superman95 on Sun 21/12/2003 04:30:30
Okay, I have another question that seems like it should be simple.

I set up some dialog, assigned talking views to my characters and in the game options set dialog to a specific GUI and set the style to Sierra-style/wbackground.  It works, but it displays it in the top left corner.

How can I center it in the screen?
Title: Re:Dialog boxes
Post by: Pumaman on Sun 21/12/2003 18:09:37
By default, Sierra style speech always displays at the top of the screen.

You can use DisplaySpeechAt to display it elsewhere.
Title: Re:Dialog boxes
Post by: Superman95 on Sun 21/12/2003 18:52:57
So, If I use the dialog engine built into AGS, I can't center the dialog?  Or do I just need to call the topic differently.

If not, I'd like to add this as a feature request.

Thanks.
Title: Re:Dialog boxes
Post by: Pumaman on Sun 21/12/2003 18:57:16
Okey, sounds reasonable enough, I'll add it to my list.

However, I think the reason people don't generally want this is that it looks a bit odd having the dialog picture and text in the centre of the screen when doing it Sierra-style.

Try it out with DisplaySpeechAt and see what you think.
Title: Re:Dialog boxes
Post by: Superman95 on Sun 21/12/2003 19:15:47
Speaking of this, I have one other request.

when you want to call a script from the dialog you would say:
 run-script 1 // or whatever number
and then it's handled in the script like this:
 function dialog_request(int parameter)
 {
   if(parameter == 1)
     // do something
   else if(patameter == 2)
     // do something else
   // and on and on.
   ...
   ...
 }

I think it would be very helpful to also pass the topic number...then you have fewer numbers to keep straight.  You could say instead:

function dialog_request(int topic, int parameter)
{
  if(topic == 0)
  {  // option list
     if(parameter==1) {}
     if(parameter==2) {}
     if(parameter==3) {}
  }
  else if(topic == 2)
  {  // option list
     if(parameter==1) {}
     if(parameter==2) {}
     if(parameter==3) {}
  }
}

I realize this is difficute for backward compatiblity.  But one option would be, if the user was passing the topic call
dialog_requestex() instead of dialog_request()
I realize this could be done with global varibles, but this seemed cleaner.


And one last thought, you can't pass a 0 as the parameter, you get an error, which is just a bit of an annoyance.

You know, for an American, my English sucks.  I hope this made sense.
Title: Re:Dialog boxes
Post by: Pumaman on Sun 21/12/2003 19:33:18
Yeah, that sounds reasonable to me, and it could well help the script look a bit cleaner. Good idea, I'll add it to me list.
Title: Re:Dialog boxes
Post by: Superman95 on Sun 21/12/2003 21:50:14
There's one other thought.  How about giving the room a chance to run the dialog before the global.  This would help clean up the global script, expecially for characters that never change rooms.

Just use the same ClaimEvent() function.  If you pass the topic number, it would be really useful.  Just a thought.
Title: Re:Dialog boxes
Post by: GarageGothic on Mon 22/12/2003 08:30:43
CJ, I just though this was a good time to remind you of something I brought up a while ago: custom location and size of text windows (http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=8945;start=msg108839#msg108839)

There are a lot of speech/text window related suggestions in the future.txt file, and I hope you'll take this into consideration the next time you make changes to the text display code. I think that a more customizable system would solve many of the problems that have been mentioned. There are a LOT of great adventures that use non-standard display modes, which are currently rather difficult to emulate in AGS  (TLJ and GK1 spring to mind).

Thanks for your time,
GG
Title: Re:Dialog boxes
Post by: Rui 'Trovatore' Pires on Mon 22/12/2003 10:13:09
While I'm at it, I'd like to remind you of my suggestion some weeks ago, about an X/Y offset for the text windows in games which have "frames", like Phantasmagoria 1 or Darkseed. I think that'd settle everything satisfactorily for everyone.
Title: Re:Dialog boxes
Post by: Pumaman on Mon 22/12/2003 20:46:07
GarageGothic: ah yes, that would indeed solve this problem. I'll bump that suggestion up my list.

QuoteThere's one other thought. How about giving the room a chance to run the dialog before the global. This would help clean up the global script, expecially for characters that never change rooms.

That sounds reasonable enough to me - I don't know why I didn't add that originally with on_key_press room script support, actually.

QuoteWhile I'm at it, I'd like to remind you of my suggestion some weeks ago, about an X/Y offset for the text windows in games which have "frames", like Phantasmagoria 1 or Darkseed. I think that'd settle everything satisfactorily for everyone.

Do you mean for speech (which would be covered by GarageGothic's suggestion) or for normal Display commands?
Title: Re:Dialog boxes
Post by: Rui 'Trovatore' Pires on Mon 22/12/2003 20:55:41
I meant it for speech, but the more flexibility the merrier. Sure, we can DisplayAt, but we also have to specify the witdh, which can be a variable, which is not always handy. Or am I missing something?

Speaking of which - I noticed one can't DisplaySpeechAt over a GUI, the text is drawn behind. I suppose this happens to all text. Could that be costumizable, too? In the instance I need, it's fairly easy to work around that, but, you know...   ::)
Title: Re:Dialog boxes
Post by: Pumaman on Mon 22/12/2003 21:13:45
Well, if you're specifying the X/Y, then it's reasonable to specify the width as well - otherwise, what should AGS assume? Should it just stretch the text box all the way over to the right hand side of the screen? But yes, GarageGothic's suggestion, if properly implemented, would I think cover your request.

As for the Z-order - currently GUIs are always in front of overlays (of which speech is one). However, it's on my to-do list to allow setting the z-order for that too.
Title: Re:Dialog boxes
Post by: Ginny on Tue 23/12/2003 17:42:16
Yes, I second that, it would be very helpful to make text display above GUIs such as inventory. I encountered this problem when I was displaying descriptions for inventory items. I solved it at the time by displaying messages instead of speech, because DisplaySpeechAt was too problematic in my case.
Anyway just mentioning that it's a good idea :)