Page 4 of 4
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Thu Jan 05, 2023 9:33 pm
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
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 10:15 am
by ChaChaCHAT
yes it works
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 10:34 am
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
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 10:36 am
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
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 10:48 am
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.
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 12:26 pm
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
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 12:36 pm
by ChaChaCHAT
yes I confirm it does says the correct thing
Re: How to add an Action to a DialogueSystemTrigger componenet threw scripting
Posted: Fri Jan 06, 2023 11:27 pm
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.