Page 3 of 14
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 1:05 pm
by Tony Li
CHOPJZL wrote: ↑Wed Mar 10, 2021 10:06 amHow to set the Actor's subtitle color if there is no Dialogue Actor component of him in the scene?
You can define a custom field for the actor's color, or even use the existing Node Color field. Then add an OnConversationLine method to your Dialogue Manager that checks the field and wraps the text in a rich text color code. Example:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
Actor actor = DialogueManager.masterDatabase.GetActor(subtitle.speakerInfo.id);
string fieldValue = Field.LookupValue(actor.fields, "Subtitle Color");
var color = Tools.WebColor(fieldValue);
subtitle.formattedText.text = UITools.WrapTextInColor(subtitle.formattedText.text, color);
}
CHOPJZL wrote: ↑Wed Mar 10, 2021 10:06 amAbout "Typed" message, If there are 2 conversation running at the same time, will the "Typed" message be conflict?
Yes. You can find a way to use the typewriter effect's OnEnd() UnityEvent instead.
CHOPJZL wrote: ↑Wed Mar 10, 2021 10:06 amIs it possible to start 2 entry at the same time as a group, or start the second entry before the first finishes, and the first entry's sequence don't need to stop. As for UI, let's take 2 different NPC panel for an example.
Not with the default UI scripts, but you can subclass them or replace them, so it's quite possible if you do that with your own code.
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 6:52 pm
by CHOPJZL
Not with the default UI scripts, but you can subclass them or replace them, so it's quite possible if you do that with your own code.
I know I need to do some work on the UI, How about the control part? Or is it controled by the UI, too?
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 7:30 pm
by Tony Li
A bit of code, too. The default UI scripts stop the previous subtitle's typewriter effect when it moves to the next subtitle. If you make a subclass or replacement of the dialogue UI scripts, you can make your version not stop the previous subtitle's typewriter effect.
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 7:59 pm
by CHOPJZL
I saw this
post about override FinishSubtitle(), but how to write the "async command" that starts the next entry?
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 8:10 pm
by Tony Li
You can use the Continue() sequencer command. For example, to move to the next entry after 2 seconds, set the Sequence field to:
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 8:23 pm
by CHOPJZL
But won't it stop the sequencer of the first entry?
Re: About Dialogue Actor component
Posted: Wed Mar 10, 2021 8:28 pm
by Tony Li
Yes, but it won't stop the typewriter if you've overridden that method.
If you want to play audio or animations that don't stop when the sequence is stopped, use Audio() instead of AudioWait() and AnimatorPlay() instead of AnimatorPlayWait().
Re: About Dialogue Actor component
Posted: Thu Mar 11, 2021 6:14 am
by CHOPJZL
Like the "Typed" message, will Continue() be conflict If there are 2 conversation running at the same time?
Can we set some of the variable to only save by quit game so that it won't change by loading a saved game? Like an achievement to remember a conversation branch has been passed, If I load a save before the branch choice, the branch become false or a new branch's condition become true. This is not quite common in normal games but often used in VN games.
If I use a custom sequencer command to call "DialogueManager.PlaySequence()", the newly added sequencer is not controled by Continue(), am I right? I am kind of hoping it to work in this way, as I want to try to write my own controller to control sequences.
Re: About Dialogue Actor component
Posted: Thu Mar 11, 2021 7:37 am
by Tony Li
CHOPJZL wrote: ↑Thu Mar 11, 2021 6:14 amLike the "Typed" message, will Continue() be conflict If there are 2 conversation running at the same time?
Good point. Yes, it does tell all conversations to continue.
No need for Continue(), though. Just set the sequence to run for a specific duration. For example, to play the audio "hello_world" and then advance after 2 seconds:
Or, if you really need to continue a specific conversation, you can write a custom sequencer command to do that.
CHOPJZL wrote: ↑Thu Mar 11, 2021 6:14 amCan we set some of the variable to only save by quit game so that it won't change by loading a saved game? Like an achievement to remember a conversation branch has been passed, If I load a save before the branch choice, the branch become false or a new branch's condition become true. This is not quite common in normal games but often used in VN games.
No. You should do that separately from dialogue database variables.
CHOPJZL wrote: ↑Thu Mar 11, 2021 6:14 amIf I use a custom sequencer command to call "DialogueManager.PlaySequence()", the newly added sequencer is not controlled by Continue(), am I right? I am kind of hoping it to work in this way, as I want to try to write my own controller to control sequences.
Yes, that's correct.
Re: About Dialogue Actor component
Posted: Thu Mar 11, 2021 9:19 am
by CHOPJZL
Is there any other command that I should pay attention to when using simultaneous conversations?
I saw the "mmGetQuantity(string inventoryName, string itemID)" in InventoryEngineLua returns a double value. Why is it not int?