+1 vote

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 :)

in Engine by (34 points)

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

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.

2 Answers

+2 votes
Best answer

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 (globalvm, esccompile, 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 ;)
Of course, if you end up with new, generic features, feel free to give them back to the community with a couple PRs ;)

by (225 points)
selected by

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 :)

+2 votes

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):

https://github.com/lemilonkh/twinestory

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

by (34 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories