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

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

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

Post by fkkcloud »

Hi,

How do I get a speaker or listener's Actor name in custom SequencerCommand c# class?
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

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

Post 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!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

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

Post by fkkcloud »

perfect. exactly what I need
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Glad I could help!
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

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

Post by fkkcloud »

12345555.png
12345555.png (131.48 KiB) Viewed 753 times
somehow, my speakerInfo is not accessible!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.)
Post Reply