dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
3.54k stars 215 forks source link

Cannot quick load DialogicCharacter .dch custom resource file #2226

Open hsandt opened 1 month ago

hsandt commented 1 month ago

The problem

Describe the bug I reference a DialogicCharacter from my own script: @export var dialogic_character: DialogicCharacter

but using Quick Load in the inspector doesn't list it.

image

Load, however, works (but I must navigate to the file and select it).

image

Interestingly, *.dch seems automatically added to the list of recognized files in Godot (maybe it scans all files, or was it manually registered from the plugin?)

image

Anyway, using either All Recognized or .dch, I could select and assign the file properly.

image

I wonder if it's a limitation from Godot. According to this closed issue: https://github.com/godotengine/godot/issues/67119

custom resources should now support Quick Load (since 4.0), however it says nothing of custom extensions like .dch. Is it the source of the issue?

I searched through the doc (https://docs.dialogic.pro/), but I found no page showing how to use register_character to pass a DialogicCharacter so the bubble shows this character's portrait. Only enough, only the sample bubble (text_bubble_base.tscn, shown when calling Dialogic.start('timeline') alone) mentions this method:

layout.register_character(load("res://path/to/my/character.dch"), $BubbleMarker)

The sample code gives a hardcoded path to simplify, so there is no such issue, but in production I would export such a variable. But then I cannot Quick Load the exported DialogicCharacter var. I also checked in code how the Dialogic Panel worked, but it does some custom scan of all .dch files (we could do the same to implement a custom Quick Load maybe?).

Otherwise I could export a String var to use as path to resource; but then again I wouldn't benefit from resource type filtering and I would have to navigate and select the file anyway.

In practice it's OK because all my characters are put in the same folder and I don't have many of them, so it would really matter for a bigger project.

To Reproduce Steps to reproduce the behavior:

  1. Create a script with @export var dialogic_character: DialogicCharacter
  2. Create some character in Dialogic panel, saved as .dch file
  3. In Inspector, try to Quick Load dialogic_character with that file
  4. See that file doesn't show

Expected behavior Character resource files should be shown

System (please complete the following information):

Solutions

Workaround

Do a classic Load and select file in popup

Possible fixes

It may only be possible on Godot side, waiting for diagnostic from dev

hsandt commented 1 month ago

On a side note, it may be nice to add the corresponding page to the documentation "Register character to play timeline/dialogue". Then we could add all the caveats there, such as the need to classic Load the .dch file.

Jowan-Spooner commented 1 month ago

Hey, I've noticed this before, it's the same with timelines (.dtl) files. I assume that the godot QuickOpen simple lists .tres and .res files, so our custom file extension messes it up, but I'm not certain.