-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Well, we need to start from somewhere.
- Loading branch information
Showing
13 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,71 @@ | ||
# Dialogue Plugin for Godot Engine | ||
[![Godot Engine](https://img.shields.io/badge/Godot%20Engine-Plugin-blue?style=flat-square&logo=godot-engine&logoColor=white&logoWidth=20)]() [![GitHub license](https://img.shields.io/github/license/AnidemDex/Godot-DialogPlugin?style=flat-square)](https://github.com/AnidemDex/Godot-DialogPlugin/blob/main/LICENSE) | ||
[![GitHub issues](https://img.shields.io/github/issues/AnidemDex/Godot-DialogPlugin?style=flat-square)](https://github.com/AnidemDex/Godot-DialogPlugin/issues) | ||
[![Godot Engine](https://img.shields.io/badge/Version-0.1.0-red?style=flat-square)]() | ||
|
||
![Banner](.images/banner_animation.gif) | ||
|
||
An user-friendly dialog system for Godot Engine, with timelines, characters, text boxes, dialog bubbles and many more (planned) features for your games. | ||
|
||
A tool that will help you create dialogues and timelines with characters for your games. | ||
> Be creative 💬 | ||
# ⚠Warning⚠ | ||
## ⚠Warning⚠ | ||
|
||
> This plugin is not yet ready for use. | ||
> This plugin is **not** ready for use, yet. | ||
You can try it anyway, but be sure to make a copy of your dialog files. The format will not change, but, just in case. | ||
|
||
# Installation | ||
|
||
Download the lastest release and extract the ZIP file. Move the `addons` folders to the root of your project. It's that easy! | ||
|
||
If you want more information about installing plugins in Godot, please refer to [official documentation page](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html). | ||
|
||
# How to use it | ||
|
||
That's a good question. | ||
|
||
1. First, create a timeline, inside the Dialog Editor tab. | ||
|
||
After activating the plugin, go to Dialog Editor tab. It should be next to `AssetLib` tab. | ||
![Godot View Tabs](.images/godot_view_tabs.png) | ||
|
||
Then, click on `Timelines` button and `New` button. | ||
![New Timeline](.images/godot_new_timeline.png) | ||
|
||
2. Add some events to that timeline. A timeline without events will not work, and will halt your game if you try to use it. | ||
|
||
![New event](.images/godot_new_event.png) | ||
3. Create a new `Dialog` node, and `start` it with your recently created timeline. | ||
|
||
You had 2 options: | ||
1. Create it from code: | ||
```gdscript | ||
# ... | ||
# inside any node in the scene | ||
# ... | ||
# Create the node first and start it with your timeline | ||
var dialog_node = Dialog.start(<your_timeline>) | ||
# Add that node to the scene | ||
add_child(dialog_node) | ||
``` | ||
`your_timeline` can be the name of your timeline (the name that you used when you created it), the absolute path to that timeline or a `DialogTimelineResource`. | ||
|
||
2. or Instantiate it in the scene editor: | ||
|
||
![Instance dialog](.images/godot_instance_dialog_node.png) | ||
Then, select the node: | ||
![Dialog Node](.images/godot_scene_tree.png) | ||
|
||
And, inside the Inspector tab, select the timeline: | ||
![Inspector](.images/godot_inspector_tab.png) | ||
|
||
That's it, it's fair simple. | ||
|
||
> For now, there's only 3 events. They'll be more, and you can create your custom events if you want. | ||
# Documentation | ||
|
||
Please refer to [DOCS.md](/docs/DOCS.md) (WIP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
class_name Dialog | ||
## Hello, traveler | ||
## | ||
## | ||
|
||
## Default TextBox Scene path | ||
const DefaultDialogTextBox:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_box/ingame_dialogue_node.tscn" | ||
|
||
## Default Bubble Scene path | ||
const DefaultDialogBubble:String = "res://addons/dialog_plugin/Nodes/ingame_dialogue_bubble/dialog_bubble.tscn" | ||
|
||
|
||
const _DialogDB = preload("res://addons/dialog_plugin/Core/DialogDatabase.gd") | ||
|
||
|
||
static func start(timeline, dialog_scene_path:String="", use_bubble:bool=false) -> DialogBaseNode: | ||
var _dialog_node = null | ||
if dialog_scene_path: | ||
var _dialog_scene:PackedScene = load(dialog_scene_path) as PackedScene | ||
_dialog_node = _dialog_scene.instance() | ||
|
||
if not(_dialog_node is DialogBaseNode): | ||
_dialog_node = null | ||
|
||
if not _dialog_node: | ||
_dialog_node = get_default_dialog_textbox() if not use_bubble else get_default_dialog_bubble() | ||
|
||
|
||
if timeline is String: | ||
(_dialog_node as DialogBaseNode).timeline = _DialogDB.Timelines.get_timeline(timeline.get_basename().get_file()) | ||
elif timeline is DialogTimelineResource: | ||
(_dialog_node as DialogBaseNode).timeline = timeline | ||
return _dialog_node | ||
|
||
|
||
static func get_default_dialog_textbox() -> DialogBaseNode: | ||
var _dialog_textbox_scene:PackedScene = load(DefaultDialogTextBox) as PackedScene | ||
var _dialog_textbox_node:DialogBaseNode = _dialog_textbox_scene.instance() as DialogBaseNode | ||
return _dialog_textbox_node | ||
|
||
|
||
static func get_default_dialog_bubble() -> DialogBaseNode: | ||
var _dialog_bubble_scene:PackedScene = load(DefaultDialogBubble) as PackedScene | ||
var _dialog_bubble_node:DialogBaseNode = _dialog_bubble_scene.instance() as DialogBaseNode | ||
return _dialog_bubble_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters