Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.7 KB

Participants.md

File metadata and controls

43 lines (30 loc) · 1.7 KB

Participants

Participants are game objects which have a close association with a runtime dialogue; most likely objects like your player character, and the characters they're talking to.

Participants are likely to:

  • Own the dialogue instance (one of them, probably the NPC)
  • Provide and retrieve variables from the dialogue
  • Receive events from the dialogue

In order to do this, participant objects need to implement the ISUDSParticipant interface, and override whichever methods they need to from that interface:

Participant Interface

While it's possible for any other object to do all of the things above as well, in the case of events there are matching delegates for everything in ISUDSParticipant, it's better to make a Participant in these cases, because you have more control over the order of invocation.

Participants are guaranteed to be called in a known order based on their return value from GetDialogueParticipantPriority. Also it's generally neater not to have to bind to all the separate delegates to access the hooks shown above.

Adding Participants To A Dialogue

Participants should always be added before calling Start on a dialogue instance. Either you can create the dialogue, add the participants via AddParticipant, then call Start, or you can use one of the more convenient CreateDialogueWithParticipant[s] methods, which organise it for you and can still start automatically:

Create Dialogue With Participants


See Also