New to Unity and the Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

I confirmed that the Visual Novel Framework's saving and loading works correctly. But it's only designed to work in the Visual Novel Framework. If you're making a visual novel and you want to use the framework, I recommend using the entire Visual Novel Framework, following all the steps starting on page 3 of the included manual: "How to Make Your Own Visual Novel".

If you don't want to use the Visual Novel Framework, you can still add slot-based saving and loading to your game by using the Dialogue System Menu Template which is also available on the Dialogue System Extras page.

Either way, I recommend following whichever package's manual from page 1 on. The first part of each manual tells you how to set up the example scene(s) so you can see how the package works. It only takes a minute or two, and it will give you a better understanding when you move on to the instructions for setting it up for your own game.

If you get stuck, I'm here to help! Just let me know which package you're using and what's going on. Also feel free to send an example project to tony (at) pixelcrushers.com and let me know what version of Unity to use. The best way to send a project is to zip up the Assets and ProjectSettings folders into a zip file. If it's under 5 MB, send it in an email. Otherwise use a service like Dropbox, or let me know and I'll send you information for the Pixel Crushers FTP upload service.
UnWrecker
Posts: 13
Joined: Thu Jul 21, 2016 6:29 am

Re: New to Unity and the Dialogue System

Post by UnWrecker »

Good day!
I'm very grateful for your support!

I have another misunderstanding with Dialogue System Menus. Maybe you have more detailed guidу for it? Because I can't understand how it works.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

Hi,

The Dialogue System Menu Template's manual is the most detailed guide available.

Let's step through the setup together. Please try the steps below. If you get stuck on any step, or if my instructions aren't clear, please let me know.

These instructions will explain how to set up your game in one scene. We'll use the scene that you've already set up with your map and buttons.

1. Open the Asset Store window. Download and import Unity's Game Jam Menu Template.

2. Import the DialogueSystem_Menus_2016-06-20.unitypackage downloaded from the Dialogue System Extras page. To import it, select Asset > Import > Custom Package. Then select the .unitypackage file.

3. Open your scene.

4. Inspect the Dialogue Manager GameObject. Then select Component > Dialogue System > Save System > Level Manager.

5. Drag the UI prefab from Assets/Dialogue System Menus/Prefabs into the scene.

At this point, the menu system should be set up. It will use generic placeholder graphics for now. I recommend getting it working first, and then changing the appearance later.

The menu system has two menus: a Start menu and a Pause menu.

The Start menu appears when the game starts. It disappears after the player chooses an option such as Start, Continue, Restart, or Load.

The Pause menu appears when the player presses Escape during gameplay.

Play the scene and click the Start button. The Start menu should disappear, and you should be able to play your game. If you get that far, press Escape to make sure it opens the Pause menu. If the Start menu doesn't appear, inspect the UI GameObject. Find the Canvas component, and set its Order in Layer property to 99. Then try again.

If that works, you can modify the Start menu panel to cover the whole screen. This will hide the map and buttons until the Start menu disappears.

If you get stuck, please feel free to send me a copy of your project.
UnWrecker
Posts: 13
Joined: Thu Jul 21, 2016 6:29 am

Re: New to Unity and the Dialogue System

Post by UnWrecker »

Thank you for help!

It works, but not correct. When I saved the game, mouse cursor dissapeared. And after I quit and load the game, the Dialogue Manager doesn't work.

And I found another question: how can I make backgrounds to change in one location but in different conversation?
Maybe I can set Script in start of Conversetion that makes active GameObject? And make active some Locations after the end of Conversetion?
For example: I entered the BoyLocation talked to Boy and after that I can enter the GirlLocation and talk to Girl.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

UnWrecker wrote:It works, but not correct. When I saved the game, mouse cursor dissapeared. And after I quit and load the game, the Dialogue Manager doesn't work.
These issues are probably related. Is everything in one scene, or are you using more than one scene? Can you send me a copy of your project?
UnWrecker wrote:And I found another question: how can I make backgrounds to change in one location but in different conversation?
Maybe I can set Script in start of Conversetion that makes active GameObject?
Yes, using the SetActive() sequencer command is a good way. As a first step, set this up without worrying about saving and loading games. Once it's working, you can incorporate saving and loading, which will use variables and Persistent Active Data components. I can explain how to use those. When you get to that point, just let me know.
UnWrecker wrote:And make active some Locations after the end of Conversetion?
For example: I entered the BoyLocation talked to Boy and after that I can enter the GirlLocation and talk to Girl.
You can also use SetActive() to make the button active, or you can configure the button to always start a conversation. If it always starts a conversation, define a variable to remember whether the location is locked or unlocked. If it's locked, branch the conversation to a dialogue entry node that says, "This location is currently locked." If it's unlocked, continue the conversation.
UnWrecker
Posts: 13
Joined: Thu Jul 21, 2016 6:29 am

Re: New to Unity and the Dialogue System

Post by UnWrecker »

Tony Li wrote:These issues are probably related. Is everything in one scene, or are you using more than one scene? Can you send me a copy of your project?
Hi! There's the example of my project.
Tony Li wrote:Yes, using the SetActive() sequencer command is a good way. As a first step, set this up without worrying about saving and loading games. Once it's working, you can incorporate saving and loading, which will use variables and Persistent Active Data components. I can explain how to use those. When you get to that point, just let me know.
Thank for advise. I tried to make as in example, but i don't understand how to make Active/inActive in it.
Tony Li wrote:You can also use SetActive() to make the button active, or you can configure the button to always start a conversation. If it always starts a conversation, define a variable to remember whether the location is locked or unlocked. If it's locked, branch the conversation to a dialogue entry node that says, "This location is currently locked." If it's unlocked, continue the conversation.
Can you please show how I can use SetActive() in Condition in dialogue node?

And i have another question with Int Variable.
I made a new Variable "Relationship" with inital number = 0. At the end of conversetion I added script:

Code: Select all

Variable["Relationship"] = Variable["Relationship"] + 5
1.jpg
1.jpg (51.59 KiB) Viewed 1726 times
And in MainBoyConv that links to 3rd conversation if your Relationship greater equal 5 I added Condition:

Code: Select all

Variable["Relationship"] >= 5
2.jpg
2.jpg (71.58 KiB) Viewed 1726 times
But it doesn't work. The 3rd conversation doesn't start.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

What version of Unity should I use?

(I removed the link from your post so others on the Internet can't download it.)
UnWrecker
Posts: 13
Joined: Thu Jul 21, 2016 6:29 am

Re: New to Unity and the Dialogue System

Post by UnWrecker »

I'm using 5.3.5 now.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

Thanks! I'll open the project now and take a look.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: New to Unity and the Dialogue System

Post by Tony Li »

Hi,

Please import this package:

DialogueSystemTest2_UnWrecker_2016-08-01.unitypackage

It will add 3 files:
  • Scene: DialogueSystemTest2
  • Dialogue Database: DialogueDatabase2
  • Script: Editor/ClearPlayerPrefs.cs (optional utility)
In DialogueSystemTest2, I made these changes:

UI GameObject:
  • Activated the GameObject
  • Unticked Start Options > Change Scenes since the menu is in the same scene as gameplay.
  • Set More Pause > OnUnPause() event to MorePause.ShowCursor. This guarantees that the cursor remains onscreen.
  • Note: The Dialogue System Menu Template assumes that you will use a title scene (containing the UI) and a separate gameplay scene. For this reason, the Restart button will not work until you add a separate gameplay scene. If you have saved a game and want to restart from the beginning, I included a script Editor/ClearPlayerPrefs.cs that adds a menu item Tools > Clear Player Prefs to delete your saved games. Another solution, if you will not have a separate gameplay scene, is to change the button UI > MenuPanel > ConfirmRestartPanel > ConfirmRestartConfirm's OnClick() to StartOptions.StartButtonClicked instead of SaveHelper.RestartGame.
Player: Created a Player GameObject. (You can call this GameObject anything; I just chose to name it "Player".)
  • Moved Set Active On Dialogue Event from Dialogue Manager to Player. This is the reason: When you reload a game, it reloads the scene. This means it creates new instances of all of the scene's GameObjects -- except for the Dialogue Manager GameObject. The Dialogue Manager always survives scene changes (unless you untick Don't Destroy On Load). This means the Loc1 and Loc2 buttons (which are new) will not point to the correct Dialogue Manager (see below).
Map > Loc1 GameObject:
  • Added a Conversation Trigger. Pointed it to the Player GameObject, since this is guaranteed to be in sync with Loc1, whereas Dialogue Manager will not be the same.
  • Changed the first item in OnClick() to call the ConversationTrigger.OnUse() instead of Dialogue Manager > DialogueSystemController.StartConversation.
Map > Loc2 GameObject:
  • Similar to Loc1.
Created a BackLoc1 > Girl Portrait GameObject to demonstrate using SetActive() to show images:
  • Used SetActive(Girl Portrait) in GirlConv's "Hi! I'm Girl!" entry. Also used SetActive(Girl Portrait, false) in the next entry just to demonstrate it.
  • Removed Conditions & Script from GirlConv START: Location["Loc1].... If you want to use Location["Loc1"], make sure to define it on the Locations tab first.
BoyConv2 Conversation:
  • This conversation now demonstrates how to check and increment a variable. I also added the variable "Relationship" to the dialogue database.
I wasn't sure how you wanted to use PersistentActiveData, so I didn't include it. If you have questions about any of this, please let me know.
Post Reply