Dialog Systems & Can Esc (Escoria Scripting Language) be used without the rest of the Escoria framework?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LeMilonkh
:warning: Old Version Published before Godot 3 was released.

Hey there,
I’m currently building a top-down rogue-lite with Godot and am currently searching for a good way to include dialog with NPCs into the game. I want multiple branching paths and also to be able to set variables and behaviour based on the choices the player makes.

I found Escoria and am kind of into the concept of the Esc scripting language for dialog, but I’m not exactly developing a point-and-click adventure game, so it seems kind of limited in that aspect (especially the inventory system since I plan on procedurally generating at least some of the items, so a static scene for all the items won’t do).
I do like the ability to write out cut scenes in Esc instead of having to do all of it in an AnimationPlayer or in GDscript.

Can I use just Esc without the rest of the Escoria framework? The Escoria documentation doesn’t really specify anything of the sorts. Are there better alternatives for managing branching dialog in Godot? Or would it be more useful to use external programs that export JSON (e.g. Twine) and write a custom parser (which I guess would also be useful to others)?

Thanks in advance :slight_smile:

Not a lawyer but Escoria is under MIT license, I think you can do whatever you want with it or with parts of it.

eons | 2017-02-02 01:47

I’m sorry if I worded my question unclearly, but it wasn’t really about the legal feasibility.
I’m more concerned about the right integration of Esc into the escoria framework and if I’d have to rewrite larger parts of Escoria if I wanted to use my own inventory system and UI etc.

LeMilonkh | 2017-02-02 08:24

:bust_in_silhouette: Reply From: Julian Murgia

AFAIK, Escoria allows you to use only a portion of its features. However, certain nodes (and their attached scripts) will be mandatory :

  • Game node (linking globals/game.scn) because it links your scene do the backend stuff (global_vm, esc_compile, etc)
  • item.gd script for items/NPCs

Concerning the inventory scene, keep in mind that it is only a container. You can (and you should) modify it to fit your need in terms of graphics, and you are still able to add new nodes as children of the inventory or make it a child of one of your nodes to add new features to it, make it more specific.

Anyway, I am not certain that Escoria’s inventory is mandatory ; anyway, you are still able to modify the framework to fit your needs :wink:
Of course, if you end up with new, generic features, feel free to give them back to the community with a couple PRs :wink:

That’s good to hear. I’m actually currently writing a parser and renderer for Twine and using that as a dialog system in my game. I’m also porting the Tracery lib for dynamic text generation (using context-free grammars written in JSON) fom JavaScript to C++ so that I can use it in Godot (see the TraceryCpp project on GitHub). Once this port is done I’ll write a wrapper for GDscript and integrate it into the Twine solution (which I’m currently doing in GDscript).

The thing I haven’t yet figured out is setting global variables and starting animations from Twine story passages, maybe I’ll look into the parser that Escoria has and adapt it to my needs…

Also the API for RegEx was changed in Godot 2.2 (e.g. search instead of find, different return types) and I’m having some trouble with it, but I guess that’s a minor problem (and will most likely be fixed by Godot 3, right?)

Thanks for your answer anyways :slight_smile:

LeMilonkh | 2017-02-24 15:11

:bust_in_silhouette: Reply From: LeMilonkh

For anyone interested, this is the solution I’ve come up with. I use Twine (with the Snowman syntax) to write a story, dialogs, choices etc. I then export it to a JSON file using the npm package twine_to_json. This is then loaded into Godot and parsed using this plugin (work in progress):

If you need something specific, just add an issue or PR there :slight_smile: