Dialog System Formating

M

Maku

Guest
Hallo,
i wrote a dialog system, and everything works fine, but importing the dialog includeds time consuming text edting.
is there any way/tool to make the text formating more easy?

from this:
Girl
Could you teach me
a heal spell?

Guy
NO!!!


to this:

if argument0 = "Test"
{
pages = 2; // number of dialog pages
switch (argument1)
{
case 1:
name[1] = "Girl"; // Name of 1. Character
emotion[1] = "Normal"; //Emotion of 1 Character
name[2] = "Guy"
emotion[2] = "Normal";
person_speaking = 1; //what character is speaking right now.
text = "Could you teach me
a heal spell?";
break;
case 2:
emotion[2] = "Angry";
person_speaking = 2;
text = "NO!!!";
break;

}
}
 

Alice

Darts addict
Forum Staff
Moderator
Ooooh, this is gonna get very inefficient, very quickly.

If you want to have any remotely flexible dialogue system that won't bury you in tons of GML code, I suggest the following options:
  • look for a premade dialogue system on Marketplace (might be a challenge to find an affordable dialogue system that you will find easy to use, but you might save yourself reinventing the wheel)
  • create a custom, somewhat flexible dialogue format that can be understood by your dialogue system (time consuming, but if you get it right, it'll be easier to add more dialogue later on; plus, if the format is easy enough, you might get other writers to write the dialogue, too)
  • make a JSON-based dialogue format, with properties such as "person" or "emotion" corresponding to different dialogue variables that are later read by your dialogue system; you can then use json_decode function to read the dialogue data (less time-consuming than custom format, but might be a little more unwieldy when writing the dialogue)
Personally, I'd pick creating a custom dialogue format, but I'm rather experienced with designing and writing parsers for my own formats. You might prefer to find a Marketplace resource or use JSON-based system instead, but sticking with what you have at the moment is pretty much a guaranteed way to get dialogue-sick when writing any remotely dialogue-based game.

Whichever option you pick, I suggest you get yourself familiar with Included Files. In the long run, I'm pretty sure getting all the dialogue hardcoded in the game will become more and more of a trouble, especially if you would like to support different languages at some point. Also, learning about Data Structures should be helpful, too (not only for dialogue systems, but in general).

(by the way, I made a free Marketplace asset Data Toolkit with a bunch of handy file-related utility scripts; in particular, you can use jobject_load function to quickly load a JSON structure from an included file)
 
M

Maku

Guest
Thank you for the fast answer,
sadly most dialog systems on the Marketplace are even more hard to import lots of text to
 
Top