Branching Dialogue using JSON

12

Index

Features on these Courses

Attached Files

The following files have been attached to this tutorial:

.c3p

branching-dialogue.c3p

Download now 170.26 KB

Stats

2,715 visits, 6,634 views

Translations

This tutorial hasn't been translated.

Tools

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.

.C3P

branching-dialogue.c3p

Download now 170.26 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!

  • 8 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Great tutorial, thanks!

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

  • 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.

  • Hi Laura_D,

    After an answer has been picked, the scene id gets set to 0, and from there the nextscene is picked. This is kind of wrong, the nextscene should be picked from the chosen answer, but the system doesn't register it even though I have put a nextscene command at the end of every answer. Been looking at it for hours and can't find a fix, any ideas? Thanks!

  • 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.