Page 1 of 1

Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 1:39 am
by fkkcloud
Hi,

How do I get a speaker or listener's Actor name in custom SequencerCommand c# class?

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 3:46 am
by fkkcloud
I just used

Code: Select all

speaker.GetComponent<DialogueActor>().actor 
since I am using DialogueActor to specify all actors in conversation.
but let me know if this is the right way!

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 9:30 am
by Tony Li
Hi,

I recommend using:

Code: Select all

string speakerName = DialogueManager.currentConversationState.subtitle.speakerInfo.Name;
If the speaker or listener's Display Name contains Lua code, the Name property above will contain the final, processed version of the Display Name.

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 1:40 pm
by fkkcloud
perfect. exactly what I need

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 1:41 pm
by Tony Li
Glad I could help!

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 2:48 pm
by fkkcloud
12345555.png
12345555.png (131.48 KiB) Viewed 754 times
somehow, my speakerInfo is not accessible!

Re: Speaker or Listener actor name in custom c# SequenceCommand class?

Posted: Mon Oct 12, 2020 3:03 pm
by Tony Li
Sorry, I had a typo. Use:

Code: Select all

DialogueManager.currentConversationState.subtitle.speakerInfo
(I just fixed it in my previous reply above, too.)