Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Resource Files #1

Merged
merged 1 commit into from
Jun 20, 2020

Conversation

tomglenn
Copy link
Contributor

@tomglenn tomglenn commented Jun 20, 2020

This PR removes the requirement for the developer to create auto-loaded global.gd and characters.gd scripts. The reason for doing so is that they are both very common names which may result in clashes in some projects, and also that creating extra auto-loaded singleton classes to fuel the dialog system does not seem like the best approach.

This PR proposes a cleaner solution using custom Godot Resources.

Namely a DialogResource which contains a reference to an external Json file for the dialog, a Dictionary of key/value custom variables, and an Array of DialogCharacterResource references.

And a DialogCharacterResource which contains a Name, an Image and Color.

Instead of creating a global.gd script that returns custom variables and a characters.gd script returning a dictionary of characters, developers can now create individual resource files for each character and dialog.

Video demo here:
https://twitter.com/codewithtom/status/1274151135776051206

@coppolaemilio
Copy link
Collaborator

First of all, thank you very much for the PR! I love having the characters as resources because it is so much more user friendly than just having a dictionary. I didn't know you could do that and it is a perfect fit for the add-on.

As a goal I wanted to always have all the placeholders included so you don't have to create extra stuff, in this case we would have to create the three characters resources for the intro so it doesn't fails on a test run.

Regarding the dialog, I'm not sure if having the need for external Json files is something I would like to have. Giving the possibility to set the dialog by code is a must for me.

If having an external resource could give us the chance to create a visual editor (in a similar way to this https://github.com/EXPWorlds/Godot-Dialog-System) I would like to explore the idea of resources for dialogs, but for now I think it just makes you require using external editors to create the json files and it is less user friendly. If both systems can co-exists that could also work.

So, I'll see if I edit a couple of things here and there and commit some extra changes. Overall I really like the direction! Thanks again!

@tomglenn
Copy link
Contributor Author

Hey Emilio, yeah I totally agree with regards to the external JSON. I had ported that functionality over from the existing dialog_node.gd but agree that a much better approach would be to have a Node Graph as part of the DialogResource that lets you map out the dialog in a visual format.

@coppolaemilio coppolaemilio merged commit ebe7e3e into dialogic-godot:master Jun 20, 2020
exelia-antonov added a commit to exelia-antonov/dialogic that referenced this pull request Feb 27, 2023
exelia-antonov added a commit to exelia-antonov/dialogic that referenced this pull request Feb 27, 2023
zaknafean pushed a commit to exelia-antonov/dialogic that referenced this pull request Apr 25, 2023
zaknafean pushed a commit to exelia-antonov/dialogic that referenced this pull request Apr 25, 2023
zaknafean pushed a commit that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants