How to add an Action to a DialogueSystemTrigger componenet threw scripting

Announcements, support questions, and discussion for the Dialogue System.
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 »

Let's simplify it and find out where the problem is.

Here's an example scene. It doesn't use VR. It uses a simplified version of your setup script. Would you please confirm that this works correctly in your project?

DS_TestDSTriggerFromScript_2022-01-05.unitypackage
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 works
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 »

After some more test it seems that when not setup beforehand and adding all component threw code, the OnConversationStart method on my moveDialoguePanel script is never called
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,

Message such as OnConversationStart are only sent to the Dialogue Manager GameObject and the two primary participants (actor and conversant). This table explains which GameObjects receive which messages:

Script Messages
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 but when i set it up before hand it is called and everything works, but when i add component threw code, it's like its not called, it never goes in.
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 »

If you temporarily set the Dialogue Manager's Other Settings > Debug Level to Info, confirm that it reports the correct actor and conversant GameObjects in:

Dialogue System: Starting conversation 'title' with actor=X and conversant=Y
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 confirm it does says the correct thing
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 »

Please try this:

1. Set up the Dialogue System Trigger in the inspector so that it works correctly for your needs. Change the Inspector view to Debug mode. (From the triple-dot menu in the upper right, select Debug.) Make a note of the component's values (e.g., take a screenshot).

2. Let your script create a Dialogue System Trigger. Inspect it in the Inspector view. Compare it with the screenshot of the working Dialogue System Trigger.
Post Reply