You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Dialogic for a bit in my hybrid GDScript/C# project (making use of a modified version of the QueenOfSquiggle's wrapper class) and so far things have been going smoothly. My game is a tactical RPG where multiple player units might try to speak to an individual character. This means I'd like to dynamically load them into an otherwise pre-made timeline, so I only have to set their character file once and do the timeline for each event once.
There doesn't seem to be a feature for this in the Dialogic editor, which is fine, so I thought I could somehow make use of the custom portrait feature and inject the character to be called during _update_portrait(). My thought was to do something like the following:
Create a RuntimeCharacter extends DialogicCharacter class (e.g., runtime_character.gd)
Create a PackedScene from a Node2D with the runtime_character.gd script (e.g., RuntimeCharacter.tscn)
RuntimeCharacter would have a load_character(character: DialogicCharacter) method that can be called by the unit that wants to enter the conversation.
When starting that conversation, the unit would pass a reference to their character resource Unit.dch to the load_character() method, which would then call apply_character_and_portrait(Unit.dch, Unit.default_portrait)
I would then have a character RuntimeCharacter with my PackedScene as the portrait, which would update when called
Start the timeline and my dynamic character is in there.
However, the character does not seem to load properly; it just fails blankly and silently. This might be user error on my part (I'm still debugging) but I'm wondering if the above logic makes sense. In particular, I'm trying to understand the _update_portrait() override method the docs keep referencing and wondering if I need to be going through there somehow. The docs say it is called "when the scene is instanced" but isn't entirely clear on which scene--the timeline? the custom portrait? The examples also don't seem to match the docs--despite the docs saying it has to inherit DialogicPortrait only one of the examples actually does (I don't know if this matters but it is something I noticed).
So those are the two spots I'm looking for some help on. 1) is the outlined approach for dynamically loaded characters possible and/or correct? and 2) What is the expected flow for these override methods for controlling the displayed characters/portraits? Can I control when they're called or at least do I have a window between instantiation and their being called to inject data into my custom portrait?
There is a related discussion at #703 which seems to imply that this sort of thing is not possible, but I'm hoping that's out of date or the answerer didn't think to abuse custom portraits in this way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I've been using Dialogic for a bit in my hybrid GDScript/C# project (making use of a modified version of the QueenOfSquiggle's wrapper class) and so far things have been going smoothly. My game is a tactical RPG where multiple player units might try to speak to an individual character. This means I'd like to dynamically load them into an otherwise pre-made timeline, so I only have to set their character file once and do the timeline for each event once.
There doesn't seem to be a feature for this in the Dialogic editor, which is fine, so I thought I could somehow make use of the custom portrait feature and inject the character to be called during _update_portrait(). My thought was to do something like the following:
RuntimeCharacter extends DialogicCharacter
class (e.g.,runtime_character.gd
)runtime_character.gd
script (e.g.,RuntimeCharacter.tscn
)RuntimeCharacter
would have aload_character(character: DialogicCharacter)
method that can be called by the unit that wants to enter the conversation.Unit.dch
to theload_character()
method, which would then callapply_character_and_portrait(Unit.dch, Unit.default_portrait)
However, the character does not seem to load properly; it just fails blankly and silently. This might be user error on my part (I'm still debugging) but I'm wondering if the above logic makes sense. In particular, I'm trying to understand the
_update_portrait()
override method the docs keep referencing and wondering if I need to be going through there somehow. The docs say it is called "when the scene is instanced" but isn't entirely clear on which scene--the timeline? the custom portrait? The examples also don't seem to match the docs--despite the docs saying it has to inheritDialogicPortrait
only one of the examples actually does (I don't know if this matters but it is something I noticed).So those are the two spots I'm looking for some help on. 1) is the outlined approach for dynamically loaded characters possible and/or correct? and 2) What is the expected flow for these override methods for controlling the displayed characters/portraits? Can I control when they're called or at least do I have a window between instantiation and their being called to inject data into my custom portrait?
There is a related discussion at #703 which seems to imply that this sort of thing is not possible, but I'm hoping that's out of date or the answerer didn't think to abuse custom portraits in this way.
Beta Was this translation helpful? Give feedback.
All reactions