Branching Dialogue using JSON

15

Index

Features on these Courses

Attached Files

The following files have been attached to this tutorial:

.c3p

branching-dialogue.c3p

Download now 170.7 KB

Stats

8,347 visits, 19,028 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 7 Apr, 2020. Last updated 21 Apr, 2022
.C3P

branching-dialogue.c3p

Download now 170.7 KB

Welcome to what will probably be the final instalment of these JSON Dialogue tutorials. This tutorial is going to cover adding branching dialogue and event dialogue.

The project file included in this tutorial builds on those used previously, but the JSON file and NPC code have undergone a bit of work. This will be covered more in the Project Overview section, but you may find that if you’ve been building these ideas into one project as we go along, you may have to make some changes!

  • 10 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Hi Laura_D

    This has been a great tutorial series, I've been slowly going over it the last couple of days and it's greatly helped my understanding of JSON files.

    Not sure if you noticed, but in the final example the text effects are disabled (think it's Steve's dialogue).

    Anyway, one thing that I'm still trying to get my head around is organising large projects and how that might look like with a system like this. Currently, it feels like the larger a JSON file is, the more difficult it becomes to follow. I'm wondering if it would be best to have separate JSON dialogue files for each layout and have them loaded at the start of each layout, essentially parsing a new file on each level transition. This should allow for a more manageable system, but as I'm still very new to this, I'm wondering if this is a good idea or not.

    Anyway, if you have an idea around this, I'd love to hear it.

    Thanks

      • [-] [+]
      • 2
      • Laura_D's avatar
      • Laura_D
      • Construct Team Community Manager
      • 2 points
      • (2 children)

      The point of having one dialogue file is to keep the dialogue events cleaner. In my main game file, I have the dialogue events stored on my 'global' event sheet to make sure it can be called from wherever. I suppose you could use separate JSON files, but you then end up with a lot of AJAX requests etc for each file, and things will probably start getting a little complicated when you come to call each specific file.

      I started in my game having about 3 different systems and files for dialogue and quickly came to the conclusion that I'd prefer having just the one.

      The large JSON may get complicated, but I find having a separate spreadsheet with all the data in (including IDs, where they link etc) really helps.

      • Thanks for the reply. A spreadsheet sounds like a good idea. Do you manually convert it to JSON format? I guess I just need to spend more time working with it to build familiarity.

        Anyway, thanks for the great tutorial :)

          • [-] [+]
          • 2
          • Laura_D's avatar
          • Laura_D
          • Construct Team Community Manager
          • 2 points
          • *
          • (0 children)

          Essentially yes - I write the dialogue in the spreadsheet so I can assign the IDs, and any other data I may need down the line, then I add the dialogue lines to the JSON file.

          I may be giving myself more work, but it suits my style of thinking.

  • Hi!

    I started an open source Game Dialogue Maker project (still very much in alpha) based on this very tutorial. The idea is to offer a node-based system of planning branching dialogue and then you can export it to a JSON file that you can drop to your c3p project here. Everything is in JavaScript and HTML. You can check it out here (and contributors are very welcome):

    github.com/AnttiPerala/GameDialogueMaker

    I don't understand some things in the example JSON perfectly yet. For example the very first object that sets nextscene to 3. If I leave it out from the output of Game Dialogue Maker then it breaks so it seems necessary. But why is it setting nextscene to 3? Can you Laura_D expand on that part?

  • Hi Laura_D,

    To activate a function, a "Z" press is needed, is there a way to have the function activate simultaneously with a dialogue line?

    RESOLVED EDIT

    For people interested, you can make a new type "lineFunction" and call a line and a function at the same time.

  • Great tutorial, thanks!

  • Hey, thank you for tutorial, i use Construct 2 and Construct 3!

  • Load more comments (2 replies)