DialogueSystemEvents not firing...?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Pandamander
Posts: 2
Joined: Fri Jun 09, 2023 11:28 pm

DialogueSystemEvents not firing...?

Post by Pandamander »

Hi everyone! I am trying to disable character movement in my 2D game while dialogues are occurring. I am following the instructions in this tutorial video.

The tutorial recommends:
1. Adding a DialogueSystemEvents component to the player object
2. Adding + Conversation Start and Conversation End events
3. Dragging in the Player Object to the event
4. Selecting the Player Movement Component > bool enabled, to disable it

However, when I do this, then it doesn't do anything. In fact, I can't get these events to fire and change any function I add. I have tried simply doing On Conversation Start > SpriteRenderer.flipX on a object with Sprites as a test, and nothing happens.

Here is a video of me trying. In the video I add the DialogueSystemEvents component to my player, add the player to the start and end conversation events, set the bool enabled to be the function, and nothing happens.

How do I get these events to fire? Is there something else I need to do? Thank you!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogueSystemEvents not firing...?

Post by Tony Li »

Hi,

Make sure the player GameObject is being used as the conversation actor. There are two ways to do this:

1. Assign the player GameObject to the Dialogue System Trigger's Actions > Start Conversation > Conversation Actor field.

2. Or add a Dialogue Actor component to the player GameObject and set its Actor dropdown to Player. Then inspect the conversation in the Dialogue Editor and make sure the Player actor is used as the conversation's Actor.

More info: Character GameObject Assignments
Pandamander
Posts: 2
Joined: Fri Jun 09, 2023 11:28 pm

Re: DialogueSystemEvents not firing...?

Post by Pandamander »

Hi Tony, thank you so much for your reply! I was able to get this working with solution 1 - on the NPC object > Dialogue System Trigger > Actions > Conversation, I didn't add the Player GameObject as the actor. When I did, this worked. Thank you!

As extra credit, I was not able to get it working with solution 2 though.
Here is a video of me attempting option 2. I added a DialogueActor component to my Player GameObject, then I set the Actor field to Player. I then checked to make sure the conversation I tried had the Actor as Player in the <START> node.

This is a dialogue where the NPC talks, so for the other nodes the Actor is the NPC (Elderly Woman). However just to check I tried making the Player the actor for these nodes too, and it still did not disable the Player Movement Component.

I already got it working, so totally optional if you reply to this, no worries. But if you have a moment, I'd love to know why this other solution didn't work.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogueSystemEvents not firing...?

Post by Tony Li »

Hi,

If you want to get to the bottom of that, the first step is to temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then reproduce the issue. When the conversation starts, you should see a line like this in the Console window:

Dialogue System: Starting conversation 'OldWoman' with actor=HeroCharacter and conversant=Porcusius Maximus.

In the Dialogue Editor window, notice in the lower right that the conversation's Conversant is set to Porcusius Maximus. To change this to Elderly Woman, select Menu > Conversation Properties. Then set the Conversant dropdown to Elderly Woman.

This will fix the conversant, but it still doesn't answer why the HeroCharacter GameObject isn't receiving the OnConversationStart() event. If the log line above doesn't show "actor=HeroCharacter" then maybe it's finding a different GameObject for the player.
Post Reply