Multiple SMS interface

Announcements, support questions, and discussion for the Dialogue System.
metaevar
Posts: 17
Joined: Tue Apr 12, 2022 6:27 am

Multiple SMS interface

Post by metaevar »

Hi there !
I just recently get Dialogue System and i have a some questions for a project i'm working on.
I'm working on a project where the player have a phone SMS interface, and can received messages.

I've used the SMS Dialogue UI and it work fine, but i'd like to have multiple characters, each with their own Dialogues. And that's where i'm struggling, howdo i setup multiple UI linked to a specific character and allowing the player to switch between dialogues ?

Thanks in advance !
(what i'm aiming for)
Image
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple SMS interface

Post by Tony Li »

Hi,

The Dialogue System Extras page has an example:

DS_MultiCharacterSMSExample_2021-10-08.unitypackage

You can also examine the Lobby example scene in the Textline example project available on the Dialogue System Extras page. It works this way, too.
metaevar
Posts: 17
Joined: Tue Apr 12, 2022 6:27 am

Re: Multiple SMS interface

Post by metaevar »

thx for the help !

But when i open the demo scene i have several errors :/
Image
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple SMS interface

Post by Tony Li »

Hi,

Does your project have another script (unrelated to the Dialogue System) that is also named DialogueManager? If so, can you put it in a proper namespace?
metaevar
Posts: 17
Joined: Tue Apr 12, 2022 6:27 am

Re: Multiple SMS interface

Post by metaevar »

thank you !
it was that indeed (a remnant of a previous attempt) it work fine now !

Ok last question i swear !
Is there a way to trigger a node (read next line of dialogue) with a trigger box ?
Like the character go throught the first trigger and it start the dialogue (that work fine) , but how do i keep it from reading all and send the next message when the player trigger a triggerBox later ?
(here is a graphic of what i want to do )
Image
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple SMS interface

Post by Tony Li »

Hi,

Configure the first node's Sequence to wait for a sequencer message, which is a string of your choosing. Example:
  • Dialogue Text: "Walk to the trigger area."
  • Sequence: WaitForMessage(WentThere)
If your conversations normally wait for the player to click a continue button, change the Sequence to:
  • Dialogue Text: "Walk to the trigger area."
  • Sequence: Continue()@Message(WentThere)
In either case, add a Dialogue System Trigger to the trigger collider. Set it to OnTriggerEnter. Select Add Action > Play Sequence, and use the SequencerMessage() command to send the message:
  • Actions > Play Sequence: SequencerMessage(WentThere)
metaevar
Posts: 17
Joined: Tue Apr 12, 2022 6:27 am

Re: Multiple SMS interface

Post by metaevar »

Sorry for the late response !

It work just fine, thank you so much!
quick question, is there a way to start all conversation at the start of the game ? right now it start only if you press the button, but i'd like it to always "play" the conversation in the background, even if the player don't "start" the conversation.
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple SMS interface

Post by Tony Li »

Hi,

Yes. Set the Dialogue System Trigger to OnSaveDataApplied. This value (OnSaveDataApplied) works just like setting it to OnStart, except it works better in case you're loading a saved game.
metaevar
Posts: 17
Joined: Tue Apr 12, 2022 6:27 am

Re: Multiple SMS interface

Post by metaevar »

Hi !

So i put all my trigger that were on "onTriggerEnter" to "OnSaveDataApplied" ? or just one ?
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple SMS interface

Post by Tony Li »

If you're using the script provided in DS_MultiCharacterSMSExample_2021-10-08.unitypackage (linked above), set it up like the example in that package.

If you want to start conversations when starting a scene, without using a script, you can set all of their Dialogue System Triggers to OnSaveDataApplied. Make sure to set the "Conversation" variable before loading that scene. Set each Dialogue System Trigger's Conditions > Lua Conditions to check the value of the "Conversation" variable.

For example, say we have a button that starts/resumes a conversation with "Bob". In the conversation selection scene, set up a Dialogue System Trigger like this to set the variable and load the conversation scene, and configure the button's OnClick() to call its OnUse() method:

sms1.png
sms1.png (28.43 KiB) Viewed 1408 times

In the conversation scene, set up your Dialogue System Trigger similarly to this:

sms2.png
sms2.png (46.64 KiB) Viewed 1408 times

Note: This is just a suggestion. You don't have to do it this way. You can start or resume conversations however you want.
Post Reply