Save system & Trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Monsta
Posts: 8
Joined: Fri Mar 14, 2025 11:38 am

Save system & Trigger

Post by Monsta »

Hello! I've been studying hard lately. DS for Unity has so many systems, and I'm amazed by it!

and... I'm stuck on something related to the save system.

I'm working with the 'Tutorial Example' you created before and testing different things.
https://www.pixelcrushers.com/phpbb/vie ... 172#p44172

I followed the forum and DS manual to add a save system.
and added a Blue button.
tested it by resetting the save data I pressed only one of the Red or Blue buttons and then saved.
However, when It Replayed, the other button also appears as if it has already been clicked.
No conversations, but an alert appears saying "Set 'Clicked Red(or blue) Button' true."
the debug log shows that the variables were set to false when saving.
As a result, the conversation isn’t progressing properly.

What I want to achieve,
  1. When playing for the first time, the "Get Player Name Tutorial" should run only once, then transition to the Prologue story.
    After that, the "Get Player Name Tutorial" should never show again.
    Is there a function that destroy only the 'Get Player Name Tutorial' conversation from the database?
    Would it be better to save only the variable and destroy the 'Get Name tutorial' conversation?Or... Do you have any better Idea?
  2. When replaying the Prologues, it should start from the last saved point.
    (There are 5 different Prologues.)
    - The Prologue should continue from the last saved state.
    - Once the player has viewed all the Prologues, a button should appear to replay each one.
    this Newbie is crying. keep looking for solutions, but sometimes I get confused about what to create as a script and what is already provided by the Dialogue System. :D
  3. During or after watching the Prologue story, players should be able to freely navigate to the Main Menu scene.
    - Made a script to transition to Main Menu Scene, but how can I control when the move button appears?
    - How about using 'Set GameObjects Active/Inactive' in the DS trigger?
  4. another question, Is it possible to use 2 standard Dialogue UI?
    - I want to use both a VN dialogue panel and a Basic dialogue panel that I made

    To solve point 1, I used 'On Save Data Applied' in a DS trigger, and it was properly checked in Check Tutorials Obj.
    But, the problem is that other buttons also act as if their conversation has already been triggered.
    I feel a bit embarrassed for asking so many questions :roll: , I’d really appreciate your help!
    Thank you in advance.
User avatar
Tony Li
Posts: 22874
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save system & Trigger

Post by Tony Li »

Hi,

> 1. When playing for the first time, the "Get Player Name Tutorial" should run only once, then transition to the Prologue story.
> After that, the "Get Player Name Tutorial" should never show again.

Please see: How To: Run a Conversation Only Once


> 2. When replaying the Prologues, it should start from the last saved point.

Add a Conversation State Saver component to the Dialogue Manager. Set a unique Key value such as "conversationState".


> 3. During or after watching the Prologue story, players should be able to freely navigate to the Main Menu scene.

You could add an Active Saver component to the menu button. (Assign a unique Key.) Set the menu button inactive. At the beginning of the Prologue conversation, use the SetActive() sequencer command to activate it.


> 4. another question, Is it possible to use 2 standard Dialogue UI?

Yes. Use an Override Dialogue UI component, or assign an override dialogue UI to any Dialogue System Trigger's Actions > Start Conversation > Override Dialogue UI field.
Monsta
Posts: 8
Joined: Fri Mar 14, 2025 11:38 am

Re: Save system & Trigger

Post by Monsta »

Thank you for your quick response. By the way, I want to make sure that the name input tutorial comes out automatically, not by clicking a button.
I did "On Save Data Applied" on Trigger And I used the storage system together
but when I play it again, the same tutorial will be repeated. Is the variable status not saved?
Script.png
Script.png (38.24 KiB) Viewed 761 times
DSSave.png
DSSave.png (82.14 KiB) Viewed 761 times
condit.png
condit.png (40.25 KiB) Viewed 761 times
BlueTu.png
BlueTu.png (127.94 KiB) Viewed 761 times
It works because I rebooted the Unity editor!
But when I reset the data and run it again, the conversation should trigger right away, but it doesn't work again. It doesn't trigger ...
User avatar
Tony Li
Posts: 22874
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save system & Trigger

Post by Tony Li »

Hi,

Set the Dialogue Manager's Other Settings > Debug Level to Info, and tick the PlayerPrefs Saved Game Data Storer component's Debug checkbox. This will log detailed info to the Console. You can check what data it's restoring (dig through the JSON save data in the Console to find your variable name) and when it does the condition checks. When the Dialogue System Trigger tries to run and checks its Conditions, it will show a green (Last Check: True) or red (Last Check: False) to tell you whether the conditions were true or not.
Monsta
Posts: 8
Joined: Fri Mar 14, 2025 11:38 am

Re: Save system & Trigger

Post by Monsta »

Hi,
I still have a lot to learn, so thank you. Can I ask one more basic question?
In DS Trigger, does 'Run Lua Code' force the execution of that code state immediately, or does it change to that Lua code when executed?
User avatar
Tony Li
Posts: 22874
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save system & Trigger

Post by Tony Li »

Hi,

In a Dialogue System Trigger, the code in "Run Lua Code" runs when the Dialogue System Trigger is triggered. For example, if you set the Dialogue System Trigger's Trigger dropdown to OnStart, the Lua code will run when the scene starts. If you set the Trigger dropdown to OnUse, the Lua code will run when the Dialogue System Trigger is used (e.g., interacted with by Selector or Proximity Selector).
Post Reply