Skip to content

Commit

Permalink
Merge branch 'coppolaemilio:main' into hotkey-support-dialogic-godot#577
Browse files Browse the repository at this point in the history
  • Loading branch information
zaknafean committed Oct 17, 2021
2 parents b10bca4 + c73e285 commit 67a057e
Show file tree
Hide file tree
Showing 46 changed files with 445 additions and 464 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
![Hero Image](https://coppolaemilio.com/images/dialogic/dialogic-hero-1.3.png?v1)
![image](https://user-images.githubusercontent.com/2206700/133774754-8ab47c3a-ae94-414d-b5c7-84ea878cd55b.png)
![github-cover](https://user-images.githubusercontent.com/2206700/136808110-7caa2d2c-44c0-4d8e-a272-fd01b990c6ba.png)

Create dialogs, characters and scenes to display conversations in your Godot games.

Expand All @@ -12,27 +11,26 @@ Create dialogs, characters and scenes to display conversations in your Godot gam




# Version 1.3 - BETA ![Godot v3.3](https://img.shields.io/badge/godot-v3.3-%23478cbf)
# Version 1.4 - Work in progress 🛠️ ![Godot v3.4](https://img.shields.io/badge/godot-v3.3-%23478cbf)

## Getting started

This video will teach you everything you need to know to get started with Dialogic: [https://www.youtube.com/watch?v=sYjgDIgD7AY](https://www.youtube.com/watch?v=sYjgDIgD7AY)
You can read a step by step guide on how to use [Dialogic here](https://github.com/coppolaemilio/dialogic/blob/main/addons/dialogic/Documentation/Content/Tutorials/BeginnersGuideStepByStep.md)

## 📚 Documentation
You can check the documentation from inside the plugin or [here](https://github.com/coppolaemilio/dialogic/blob/main/addons/dialogic/Documentation/Content/Welcome.md)

## Installation

To install a Dialogic, download it as a ZIP archive. All releases are listed here: [releases](https://github.com/coppolaemilio/dialogic/releases). Then extract the ZIP archive and move the `addons/` folder it contains into your project folder. Then, enable the plugin in project settings.

If you want to know more about installing plugins you can read the [official documentation page](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html).
If you want to know more about installing plugins you can read the [Godot docs page](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html).

You can also install Dialogic using the **AssetLib** tab in the editor, but the version here will not be the latest one available since it takes some time for it to be approved.

## ⚠ IMPORTANT
If you encounter any issue when exporting your game, try having at least 1 theme in your project.

## 📚 Documentation
You can check the documentation from inside the plugin or [here](https://github.com/coppolaemilio/dialogic/blob/main/addons/dialogic/Documentation/Content/Welcome.md)

---

## 📃 Credits
Expand Down
6 changes: 5 additions & 1 deletion addons/dialogic/Documentation/Content/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## v1.3 - (WIP)
## v1.4
- Wait seconds event can now be set to be skipped with the user's action [[SimonLammer](https://github.com/SimonLammer)]
- Added: `Autofocus choices` in the settings [[Jowan-Spooner](https://github.com/Jowan-Spooner)]

## v1.3 - Save me some time
#### General Editor Stuff
- **Builtin documentation** [[Jowan-Spooner](https://github.com/Jowan-Spooner)]
- Added a button to open the documentation from the nav bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,81 +27,76 @@ All of the files that are used for creating a custom Event Block and Handling Sc
# Making your first custom event in 6 steps
Let's now create a simple event that will print some text to the Output panel in Godot.

### You can avoid the manual copy-pasting part. Go to Dialogic's settings and use the Custom events section [new] button to create and rename an event for you. Make sure to read the guide so you know what is happening in the process.

## 1. Create the folder
First you should create a new folder in `res://dialogic/custom-events` and give it a name that is descriptive and unique.
## Create the event
Go to the `settings page` and in the `custom events section` hit the `New` button.
Fill in a name for your event, a folder name and an id. For the id's I recommend using your name or a string unique to you followed by a number.
**The id has to be different for every event!!!**
This is why I recommend the unique string, because it will enable you to share the event with others without breaking their games.
![Creating](./Images/CreationProcess.PNG)

For this print event let's call it `print-event`.
When you are ready, hit `Create`. You will see the folder appear in the `FileSystem` under `res://dialogic/custom-events/`.

If you go to the `timeline editor` now, you should already be able to see your event in the event list.

## 2. The folders content
Now you should go to `res://addons/dialogic/Example Assets/CustomEvents` and copy all the files from there and paste them into your new folder (In this case: `res://dialogic/custom-events/print-event`)
### What happened
This little menu already created a number of things for you:
- The `EventBlock` (EventBlock.tscn)
- An example `EventPart` (EventPart_Example.gd/.tscn)
- The `event handling script` (event_+EVENTID+.gd)
- A `stylebox` for your event (Stylebox.tres)


## 3. The EventBlock (EventBlock.tscn)
This is a scene that inherits `res://addongs/dialogic/Editor/Events/Templates/EventTemplate.tscn`.
When you open the scene you can see that all except the root node are grayed out.

**IMPORTANT!!! This file needs to be named `EventBlock.tscn`!!! DO NOT RENAME**
## What next
The automatic process already setup a lot. But it didn't know the purpose of our event.
So we will have to add that.

### Setting the EventBlock values
Now select the the root node of that scene. In the inspector you will see a couple of variables to set.
### | Adding the data
First we want to open the `EventBlock.tscn` scene. (Do not rename this scene!)

#### EventName and icon
For now let's set the `Event Name`. I will set mine to `Print Event`.
Select its root node and look at it's exported variables in the inspector.

#### The Event Data
Next you also need to think about the data that your event should save/handle.
We will need to add all the data, that our event can have to the `event_data`.
You can see, that it alread contains your event id. This needs to be there, do not delete it!

As said before it has to contain an `event_id`. These ids mostly consist of your "name" and a number. My event_id will be `rabloe_000`.
*We decided to move away from the actual names so that renaming wouldn't cause lots of rework.*
*Make sure your "name" is as unique as possible, so you can share custom events with others without trouble.*
I want to be able to set a text that will be printed, when my event is activated, so I'll add an information slot for that:
![EventData](./Images/EventBlock_EventData.PNG)

For the rest of the data I just want to store a string to print. Create the default data as a dictionary in the `event_data` in the inspector.
### | Icon and Stylebox
You can also change your events icon in the inspector. Just drag an image into the `Event Icon`.

#### Style and Icon
Now there is also already a stylebox. You can edit it (mainly the background color) to give it a unique style.
You can also select an icon for your event. The default Dialogic icon size and format is: 22x22 `svg`. You can find the icons used for the built-in events here: `res://addons/dialogic/Images/Event Icons/Main Icons`
Below that, you can open the Stylebox and change its background color, to give your event a unique look.



## 4. The Event Blocks Content (EventParts)
### | The Event Blocks Content (EventParts)
Right now your event block will be empty so let's change that (if you want to).

The content of an EventBlock is separated as `EventParts`. This allows for some reuse.
There are two places EventParts can be in an EventBlock: The Header (always visible) and the Body (can be hidden).
*EventParts can also contain other EventParts, but it wont be necessary for most custom events.*

*An EventBlock does not have to have a body nor a header EventPart.*
*An EventBlock does not have to have a body nor a header EventPart. For example the End Branch event has none.*

There is already a simple example `EventPart` (Script and Scene) included. You can change it as much as you want.

### Loading the data
In `load_data()` you will need to set the values of your control nodes.
#### | Loading the data
In `load_data()` you will need to set the values of your control nodes. This function is called when the event is added to the timeline editor.

### Saving changes to the data
#### | Saving changes to the data
When the values get changed (listen to it via signals) set the according value in the `event_data` dictionary and call `data_changed()`.

This is pretty much all you need to know.
*If you want to find more examples you can go to `res://addons/dialogic/Editor/Events/Parts/` and look at the EventParts that shape Dialogic's default blocks.*

### Using the EventPart
### | Using the EventPart
Once you finished everything in your EventPart(s) you need to go into the `EventBlock` scene and set the `header`/`body` variable in the inspector to the new scene(s).

Here is how the EventBlock's settings look for me now:
![EventPartAdded](./Images/EventBlockSettingsFilled.PNG)



## 5. The event handler script (event_yourname_000.gd)
### | The event handler script (event_yourname_000.gd)
Once you have your `EventBlock` finished, you need to add the event handling logic.

### The correct name
Dialogic will search your handler script following the format `event_` + your event id.
So in our case, since the `event_id` is `rabloe_000` the handler scripts needs to be called **exactly** `event_rabloe_000.gd`

### The handle_event() function
#### | The handle_event() function
If you open the script you will see, that there is only one function by default, the `handle_event()` function.

It comes with two usefull pieces of information: the `event_data` and a reference to the `dialog_node`.
Expand All @@ -112,21 +107,16 @@ there. But of course you can do a lot more.


Some more stuff is already explained in the script:
#### Continue
##### Continue
Use `dialog_node.load_next_event()` to continue with the next event.

#### Waiting
##### Waiting
If you don't want the player to interrupt your event, set `dialog_node.waiting` to `true` while your event is handled.
Don't forget to set it back to `false`.



## 6. Using your event
You are as good as done. Just enable custom events in dialogics settings menu.
Then go into a timeline. Scroll down to the custom events section. There it should be, otherwise you should hit the refresh button.

*Go ahead and try it out!*


## And done!
Great, you've created your first custom event for dialogic.

*Make sure to check Emilio's Discord server just in case someone has already created the custom event that you need. They are super easy to [import](./ImportCustomEvents.md)!*
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions addons/dialogic/Documentation/Content/Reference/001.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Methods:
#### start()
`start(timeline: String, reset_saves: bool=true, dialog_scene_path: String="res://addons/dialogic/Nodes/DialogNode.tscn", debug_mode: bool=false, use_canvas_instead=true)`
`start(timeline: String, default_timeline: String, dialog_scene_path: String="res://addons/dialogic/Nodes/DialogNode.tscn", debug_mode: bool=false, use_canvas_instead=true)`
Starts the dialog for the given timeline and returns a Dialog node.
You must then add it manually to the scene to display the dialog.

Expand All @@ -17,7 +17,7 @@ you can drag and drop the scene located at /addons/dialogic/Dialog.tscn
and set the current timeline via the inspector.

@param timeline The timeline to load. You can provide the timeline name or the filename.
@param reset_saves True to reset dialogic saved data such as definitions.
@param default_timeline If timeline == '' and no valid data was found, this will be loaded.
@param dialog_scene_path If you made a custom Dialog scene or moved it from its default path, you can specify its new path here.
@param debug_mode Debug is disabled by default but can be enabled if needed.
@param use_canvas_instead Create the Dialog inside a canvas layer to make it show up regardless of the camera 2D/3D situation.
Expand Down
34 changes: 17 additions & 17 deletions addons/dialogic/Documentation/Content/Reference/Theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@ The settings are sorted into different sections. Most of the settings are self-e
## Dialog Text
Here you can set the look and behaviour of the text inside the dialog box.

#####Behaviour>Speed
##### Behaviour>Speed
Using this setting you can change the speed at which the text is shown, where bigger values will result in a slower speed.
Setting this to 0 will result in the text being shown instantly.

#####Behaviour>Single Portrait Mode
##### Behaviour>Single Portrait Mode
If you enable this mode, there will always only be one portrait visible, the one of the character currently speaking.

## Dialog Box
### Visuals
For the background of the box you will have to choose between a solid color or a texture. For the texture you can also change it's modulation.

#####Visuals>Full width
##### Visuals>Full width
If you enable this setting the box will be stretched from left to right.

#####Visuals>Box padding
##### Visuals>Box padding
The padding between the border of the box and the text inside the box.

#####Visuals>Bottom gap
##### Visuals>Bottom gap
How far the box is from the bottom.

### Next indicator
The next indicator is the little icon that appears once the text is completed.

### Behaviour
#####Behaviour>Action Key
##### Behaviour>Action Key
If you do not want to use the same action as the default one (in the settings) for advancing the dialog, you can select a different one for the current theme.

#####Behaviour>Fade in time
##### Behaviour>Fade in time
This sets how long the theme takes to fade in. Fading only happens on dialog load and is not triggered by the `Set Theme` event.

## Name Label
The `Name label` is the section above the text box that displays the name of the currently speaking character.

#####Text>Use character Color
##### Text>Use character Color
If you enable this, the name label will always use the color of the currently speaking character. The characters color can be edited in the [Character Editor](./Character.md).

### Box
As for the text box, you can choose between a solid color or a texture.

#####Box>Box Padding
##### Box>Box Padding
The padding between the texture border and the text.

### Placement
Expand All @@ -58,16 +58,16 @@ Here you can set the alignment of the `Name label` as well as setting some addit
#####Advanced>Use Custom Buttons
If you enable this, you can select a scene that will be used as the buttons. Make sure the scene has a 'pressed', 'focus_entered' and 'mouse_entered' signal.

#####Advanced>Use Native Buttons
##### Advanced>Use Native Buttons
ToDo: Find out if this works in any way.

## Glossary
Here you can define how the box looks, that appears when you hover a glossary entry.

#####Visuals>Word color
##### Visuals>Word color
This is the color, that glossary entries have in the text.

#####Behaviour>Show
##### Behaviour>Show
If this is disabled, the glossary info box won't be shown and glossary entries won't be colored.

## Audio
Expand All @@ -76,18 +76,18 @@ This sections allows you to set audio that plays at different moments. Each of t
You can decide to select a single audio file or a folder where one file will be picked.
You can set a range for the `volume` (a random one in that range will be picked each time). Likewise you can set a range for the `pitch`. `Allow interrupt` decides whether the sound can be interrupted by a new sound of that type.

#####Typing Sound Effects
##### Typing Sound Effects
This sound will be played for each appearing character.

#####Next Sound Effects>Waiting
##### Next Sound Effects>Waiting
This is played once the text is completed.

#####Next Sound Effects>Passing
##### Next Sound Effects>Passing
This is played when the player continues.

#####Choice Sound Effects>Hovered
##### Choice Sound Effects>Hovered
When a choice button is hovered.

#####Choice Sound Effects>Selecting
##### Choice Sound Effects>Selecting
When a choice is selected.

0 comments on commit 67a057e

Please sign in to comment.