A dialog mod Construction, for easy use anywhere

Favourite 54 favourites
Tutorial written by GuizmusOriginally published on 27th, January 2014 - 11 revisions

Introduction

What we are going for

Dialog is a crucial part of lot's of games, especially RPGs. It seems simple at first, but if you want to make a solid structure that can support multiple dialog types, different interactions, or a dialog editor, you need to have a good method. I'll explain here how I did tackle this problem and we will build a Dialog System that can be integrated in any game.

This tutorial will provide along the road all that you need to build your own, or modify mine. Here are the specifications that we will keep at all time :
- dialog database will be stored in CSV, and so will be updatable using Excel for example.
- one dialog has a maximum of 3 screens of text. If there is more to display, we will need a second dialog.
- we want to be able to start a dialog with only the call of 1 function.

We will in a first part build the basic structure and display simple dialog with no answer ("Speach").
In a second part, we will focus on new types of dialog : multiple choices with a callback per choice, and random dialog.
In the last part, we are going to see how to integrate this system with your game and expend it with more functionalities : quest triggers, default dialog for a PNJ, expand on the output of the text (effects, sounds, ....), unskipable dialog, skipable dialog, ... I'll try to keep this part up over time depending on how the comments go, so if there is something you are curious about, just ask, and I'll try to make it happen.
Based on this structure, this tutorial will come out one part at a time.

What you need first

CSV plugin from rexrainbow. This tutorial won't focus on CSV's use, so I highly suggest you take a minute to read the tutorial (same link).

Share and Copy this Tutorial

You are free to copy, distribute, transmit and adapt this work with correct attribution. Click for more info.

Comments

0
Lordshiva1948 40.6k rep

Very nice tutorial. I shall try this with something I am thinking for my grandson. Thank you so much for sharing

Tuesday, January 28, 2014 at 7:08:28 AM
1
jastrazz 3,535 rep

Thanks, great tutorial. Await the next part.

Tuesday, January 28, 2014 at 1:46:02 PM
1
Tedg 9,884 rep

Thank you for share this it is a very good tutorial, and me await for the next part.

Tuesday, January 28, 2014 at 3:23:41 PM
2
Guizmus 6,157 rep

Next part should be up by the end of the week. The code is done, the explanation isn't yet. Only problem I got into for now is the Choice type of dialog, as its implementation could be done lots of ways, more or less easy to use in a real game. I did go with text based cursor, you'll tell me what you think ^^

Tuesday, January 28, 2014 at 5:29:56 PM
3
AllanR 17.6k rep

Thanks for sharing! :)

I know making tutorials is a lot of work - the ones I have done have taken way more time than I expected. But it would be nice to see a demo of the project in action without having to get the plugin (or if someone is reading on a device that doesn't have C2 installed on it).

Tuesday, January 28, 2014 at 6:49:22 PM
0
Guizmus 6,157 rep
Thanks for sharing! :)

I know making tutorials is a lot of work - the ones I have done have taken way more time than I expected. But it would be nice to see a demo of the project in action without having to get the plugin (or if someone is reading on a device that doesn't have C2 installed on it).
quoted from AllanR

Eared you ! It's now up for the part 1 here : guizmus.fr/C2/DialogsP1/ (tutorial is also up to date with this)

Wednesday, January 29, 2014 at 11:26:06 AM
2
Neirith 521 rep

I just figured out that "PNJ" is French (and Spanish) for NPC (Non-Player Character)

Could you please revise so future puzzled users know what you're talking about? :P

Tuesday, March 25, 2014 at 4:15:15 PM
0
rep2d 752 rep

Thank you so much, I really appreciate your work here. Fills a lot of holes with dialogues, much simpler that it seems when you start looking at the code. Helps to bring a better workflow and understanding of functions and expressions in a smart way. Waiting for the next part! Maybe multiple dialogs and speakers in different scenes?

Tuesday, May 06, 2014 at 9:32:08 PM
0
Squeakydave 828 rep

Ah. I have been looking for something like this for ages. Many, many thanks for all your hard work it is very much appreciated.

Wednesday, May 14, 2014 at 1:21:04 PM
0
Evdog 3,100 rep

When I try to replicate Part 1, or even copypaste everything over to a new project, the list options end up with this: i.imgur.com/jTilHSl.png

Does anyone know why this is happening?

Wednesday, May 18, 2016 at 5:32:38 AM
0
KoolEcky 16.2k rep

Excellent tutorial - good work Guizmus

Tuesday, September 27, 2016 at 6:47:02 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.