Cannot find dialog behavior I really want for 2d Game

Announcements, support questions, and discussion for the Dialogue System.
ChefGamer
Posts: 5
Joined: Tue Nov 22, 2016 12:49 am

Cannot find dialog behavior I really want for 2d Game

Post by ChefGamer »

I have bought this dialog system for a long time. now, I have some questions.
1. How to change actor texture icon during dialog? I try to use this in sequence
SetContinueMode(true);
SetPortrait(Mr.Kidney,pic=#1)
I want to have continues button and have different actor portraits as I add multiple texture in "Actor" tab in dialog database and it gives me this
NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.Sequencer.HandleSetPortraitInternally (System.String commandName, System.String[] args)
PixelCrushers.DialogueSystem.Sequencer.HandleCommandInternally (System.String commandName, System.String[] args, System.Single& duration)
PixelCrushers.DialogueSystem.Sequencer.ActivateCommand (System.String commandName, System.String endMessage, System.String[] args)
PixelCrushers.DialogueSystem.Sequencer.PlayCommand (System.String commandName, Boolean required, Single time, System.String message,
System.String endMessage, System.String[] args)
PixelCrushers.DialogueSystem.Sequencer.PlaySequence

2. how to make player actor dialog's behavior like npc? because sometime player have only one response that don't have to show as choice selection.
My attempt solution is to create another dummy actor and set its boolean "isPlayer" to false but then the name of player actor is messing up. I can't call it the same name and It show player's name as "Player Dummy" since I use that dummy actor as conversant with npc. any idea?

3. how can I use multiple dialog style during conversation? for some reason, I want to switch from a border dialog style to a border-less dialog style that i have set up both as children of canvas. For example, imagine I have set up these two "JRPG Dialogue UI" and "JRPG2 Dialogue UI" with a little different style, during game play conversation, suddenly I want to switch from JRPG Dialogue UI to JRPG2 Dialog UI. is it possible?

4. Are those dialog database scriptable object? Do I need to put them in Resource folder when build the game?

Thanks.
Invoice No. 301464646
Date 01-Apr-2014
Due Date 01-Apr-2014
Order No. OR301464646
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cannot find dialog behavior I really want for 2d Game

Post by Tony Li »

Hello,

Thanks for using the Dialogue System!
ChefGamer wrote:1. How to change actor texture icon during dialog? I try to use this in sequence
SetContinueMode(true);
SetPortrait(Mr.Kidney,pic=#1)
I want to have continues button and have different actor portraits as I add multiple texture in "Actor" tab in dialog database and it gives me this...
Try this:

Code: Select all

SetContinueMode(true);
SetPortrait(Mr. Kidney,pic=2)
If the actor is named "Mr. Kidney" (with a blank space between "Mr." and "Kidney"), the sequencer command needs to match this exactly. Also, you don't need the "#" in the "pic=2" part.
ChefGamer wrote:2. how to make player actor dialog's behavior like npc? because sometime player have only one response that don't have to show as choice selection.
My attempt solution is to create another dummy actor and set its boolean "isPlayer" to false but then the name of player actor is messing up. I can't call it the same name and It show player's name as "Player Dummy" since I use that dummy actor as conversant with npc. any idea?
Untick the Dialogue Manager's Display Settings > Input Settings > Always Force Response Menu checkbox. When the player only has one response, the Dialogue System will automatically play that response instead of showing it as a choice selection menu. If you want to force a single response to appear in a menu, put the "[f]" (force) tag in its Dialogue Text.
ChefGamer wrote:3. how can I use multiple dialog style during conversation? for some reason, I want to switch from a border dialog style to a border-less dialog style that i have set up both as children of canvas. For example, imagine I have set up these two "JRPG Dialogue UI" and "JRPG2 Dialogue UI" with a little different style, during game play conversation, suddenly I want to switch from JRPG Dialogue UI to JRPG2 Dialog UI. is it possible?
Yes. If you add an Override Dialogue UI component to an NPC, you can a different dialogue UI that the NPC will use.

If you want to change the dialogue UI for all conversations, call the DialogueManager.UseDialogueUI() method.
ChefGamer wrote:4. Are those dialog database scriptable object? Do I need to put them in Resource folder when build the game?
They are ScriptableObjects. You do not need to put them in a Resources folder.
ChefGamer
Posts: 5
Joined: Tue Nov 22, 2016 12:49 am

Re: Cannot find dialog behavior I really want for 2d Game

Post by ChefGamer »

Thanks for the reply.
To my number 2 question, everything work fine with default setting. When I untick the "Always Force Response Menu" check box in the inspector of Dialogue Manager, the npc shows dialogue, but the pc don't show anything but blank. when I remove the sequence "SetContinueMode(true), it just skip the pc dialogue :roll: And when I check it back the "Always Force Response Menu", the dialogue start working strange like having a blank dialogue from nowhere and continue my dialogue and then a blank dialogue and so on. not sure how to change it back. :?:

note that:
I put all " SetContinueMode(true)" into every dialogue note no matter if it is npc or pc since i want to have the "continue" button
I open up the "Demo Using Proximity Selector" in 2d plateformer demo and In the dialogue database, I just add another conversation without creating a new dialog database. I choose the conversation I just added for the npc "Conversation trigger -> conversation" and It show my dialog right, just not working right with the untick the option you told me.

Thanks.
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cannot find dialog behavior I really want for 2d Game

Post by Tony Li »

Hi,

You don't have to add "SetContinueMode(true)". Inspect your Dialogue Manager, and:
  • Tick Display Settings > Subtitle Settings > Show PC Subtitles During Line
  • Set Display Settings > Subtitle Settings > Continue Mode to Always or Optional Before Response Menu
ChefGamer
Posts: 5
Joined: Tue Nov 22, 2016 12:49 am

Re: Cannot find dialog behavior I really want for 2d Game

Post by ChefGamer »

Wow Work Wonderful!

Still trying to download "Dialog UI Animation Example"
For some reason the link is broken
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cannot find dialog behavior I really want for 2d Game

Post by Tony Li »

ChefGamer wrote:Still trying to download "Dialog UI Animation Example"
For some reason the link is broken
Strange; I wonder if our hosting provider was doing maintenance or something. Anyway, it works now. Here's a direct link, too:

DialogueUIAnimation_2016-10-25.unitypackage
ChefGamer
Posts: 5
Joined: Tue Nov 22, 2016 12:49 am

Re: Cannot find dialog behavior I really want for 2d Game

Post by ChefGamer »

Thanks
I have read the forum "Animated Portrait" which is awesome.
I don't know if the follow described behavior is feasible.

1. It starts with a speaking animation portrait, and then when the line end, it switches to idle animation portrait while waiting for player to press continue button assuming that I have set Display Settings > Subtitle Settings > Continue Mode to Always, and I created two animations, one is speaking and the other is idle animation, in the Animator controller. How to switch portrait animation?

2. The "void OnConversationLineEnd" is not working as I expected when I have set Display Settings > Subtitle Settings > Continue Mode to Always because when the line end, I need to press the continue button to trigger this "void OnConversationLineEnd" method which is not helpful since I can detect continue button pressed by putting a script on the continue button itself or use unity event "OnClick". Is there any message method that will surely trigger when the line end without pressing the continue button?

That is what I am going to do the research later, but if I can have solution now, that's would be great!

Thanks.
you have been very helpful :D
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cannot find dialog behavior I really want for 2d Game

Post by Tony Li »

Hi,

Here's an example: TalkingPortraitExample_2016-11-23.unitypackage

It uses the special sequencer keyword "{{end}}". The value of this keyword is a duration based on the length of the Dialogue Text.

The NPC (Private Hart) has an animator controller with two states: Idle and Talking.

I set the Dialogue Manager's Camera Settings > Default Sequence to:

Code: Select all

AnimatorPlay(Talking,NPC Portrait Image); 
AnimatorPlay(Idle,NPC Portrait Image)@{{end}}
This plays the Talking immediately. After {{end}} seconds, it plays Idle.

If your Subtitle Line has a Unity UI Typewriter Effect and you want a callback when the typewriter has finished, inspect the Unity UI Typewriter Effect. It has a UnityEvent "OnEnd()".
ChefGamer
Posts: 5
Joined: Tue Nov 22, 2016 12:49 am

Re: Cannot find dialog behavior I really want for 2d Game

Post by ChefGamer »

Thanks! That's helpful with a demo example :P
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cannot find dialog behavior I really want for 2d Game

Post by Tony Li »

Happy to help! :-)
Post Reply