How to make dialog boxes with display name. No image

Started by imperialdr, Mon 19/06/2023 21:56:31

Previous topic - Next topic

imperialdr

Hello, I'm new to AGS and working on my first project.
I want to have dialog boxes for each time a character speaks, with a custom appearance. I'd like a box to open at the bottom of the screen, displaying the character's name and their dialogue text. For appearance, I'd like the box's edges to be rounded (curved rectangle). Is it also possible to have different coloured boxes for different characters?

Any tips are much appreciated, ty!

Snarky

Welcome!

This is not super-easy to do in AGS. (Though recent improvements have made it easier—I'll assume you're using the latest version of AGS, 3.6) You will have to write your own custom Say function that handles the display of the text and then waits to proceed until the line of dialog is over.

There are two basic alternative approaches:

1. Write something completely from scratch, probably using a GUI and a couple of labels to display the text (but you can also render it yourself as an Overlay), and one of the Wait functions (probably WaitInput) to pause while the dialog is displayed.
2. Write a helper function "around" a normal Say call (or more likely SayAt, to position the text): in this helper function you display the dialog box background and the speaker name, call SayAt (which then displays the text on top of the box), and once SayAt completes, removes the dialog box and name.

Which approach is easiest depends on a number of other factors. Will you have animated speech views? Will you have voiced speech? If so, will you have lip-sync? Should the text auto-advance after some period (depending on the length of the text, or on the length of the voice clip if you use voiced speech). Do you want a "typewriter" effect where the text appears letter by letter? Basically, the more of the features offered by the standard Say functionality you want—speech animation, voice, auto-advance, lipsync—the more it makes sense to build on top of the built-in functions, so you don't have to reimplement it yourself. While on the other hand if you need to dynamically manipulate the text, such as for typewriter animation, it probably makes more sense to build it from scratch.

My SpeechBubble module, although it doesn't allow you to set up this particular format, provides an example of how you can display speech in a different format (with things like different background colors for different characters). I'll also refer you to this post, which explains how you would do something similar using the second approach (a helper function).

Good luck!

SMF spam blocked by CleanTalk