dialogic icon indicating copy to clipboard operation
dialogic copied to clipboard

Unique numeric ID for DialogicCharacter resources

Open juliohq opened this issue 1 month ago • 5 comments

Is your feature request related to a problem? Please describe. I'm working on a project where I have custom resources for characters (a set of .tres files where each one has a unique numeric ID for referring to them) and a Dialogic character resource for each (.dch files from the DialogicCharacter class).

It would be interesting to get my custom character resources from the Dialogic character resources. I could, for example, store all my character resources into a dictionary with their IDs as the keys and then I could do something like that:

Dialogic.get_subsystem("Text").speaker_updated.connect(_speaker_updated)


func _speaker_updated(character: DialogicCharacter) -> void:
        var my_character: Character = characters.get(character.id)

Describe the solution you'd like Export an id property for the Dialogic Character resource and add some validation to make sure they're unique.

Describe alternatives you've considered I could use the DialogicCharacter resource UUID somehow, though I found it not to be very reliable.

Additional context N/A

juliohq avatar Jun 26 '24 17:06 juliohq