How to add an Action to a DialogueSystemTrigger componenet threw scripting

Announcements, support questions, and discussion for the Dialogue System.
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

Yes, I have a dialogue manager on the scene, the trigger is set to onUse, there's no condition and no error. It's a really basic setup.
User avatar
Tony Li
Posts: 21959
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by Tony Li »

From what you've described, that will work. As a test, if you manually set up a Dialogue System Trigger in the inspector (instead of through code), does it work correctly?

If the inspector-configured Dialogue System Trigger works, then we can narrow down the issue to the code.

If the inspector-configured Dialogue System Trigger doesn't work, then the issue is elsewhere, such as the dialogue UI. In this case, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log activity. Make sure the Dialogue System Trigger logs that it is firing, and that the conversation logs that it is starting.
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

Ok I've tried the info debug mode like you said, really useful, didn<t know it was there! So the onUse Method is being fire by the trigger, so it may be the UI. Seems it doesnt move the panel, the panel stays off also, and the conversation seems to not be given to the ui. the dialogue manager is refenrencing the good ui script.
User avatar
Tony Li
Posts: 21959
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by Tony Li »

Hi,

Do you see a log like this?

Dialogue System: Starting conversation 'title' with actor=X and conversant=Y

If so, then the trigger is trying to start the conversation. If this is the case, check the dialogue UI.

If you do not see that log, then the trigger is not starting the conversation.
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

yes, i see it, but i noticed that when i click the button the npc start a conversatin with himself?
says this : Dialogue System: Starting conversation 'xyz', actor=npc (UnityEngine.Transform), conversant=npc (UnityEngine.Transform). So now it is Fixed, i put the player transofrm, but ui still doesnt move to location and it stays desactivated any idea why? Fun fact Everythin works when using onStart.....
Last edited by ChaChaCHAT on Thu Jan 05, 2023 1:25 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 21959
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by Tony Li »

Does the Console contain any error or warning messages?

Is the correct UI assigned to the Dialogue Manager's Display Settings > Dialogue UI field?

Remember that VR UIs must be in Screen Space - Camera or World Space canvases. VR cannot render Screen Space - Overlay canvases. See the example VR scenes on the Dialogue System Extras page for examples.
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

Yes eveything is set up like in the example scene. Fun Fact eveything works when using onStart... but not onUse....
User avatar
Tony Li
Posts: 21959
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by Tony Li »

When you use OnUse, does it log "Dialogue System: Starting conversation..."?
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

yes it does
ChaChaCHAT
Posts: 24
Joined: Mon Aug 01, 2022 7:58 am

Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting

Post by ChaChaCHAT »

Im also having another weird bug, when using onStart, even tho the database is set on mine, it will play Sergent Private Heart audio on my dialogue... the audio source is automaticlly added to my npc. ihave no reference at all or condition or anything set on that...
Post Reply