Page 1 of 1

Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Tue Oct 26, 2021 4:47 pm
by Vomdrache
Hey there,

I've recently come into an issue where the Dialogue System Trigger component is firing off before the game has fully loaded.
  • I have a Gameobject with a Dialogue System Trigger attached
  • The Dialogue System Trigger toggles between 3 different states depending on what value exists on another script
  • On Start the Dialogue System Trigger is checking the value on the other script before the saved value is applied to it
This issue does not seem to happen when saving/loading while transitioning between two scenes, only when loading into the game from the start menu - I assume this is because the Gameobject storing the data is persistent though scenes.

I believe the proper solution would include having a "loading scene" before where all of the data is settled before any On Start events are fired off - but I was hoping there was a temporary work around.

Thanks in advance,
- Frank

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Tue Oct 26, 2021 6:37 pm
by Tony Li
Hi Frank,

Try setting your Dialogue System Trigger to OnSaveDataApplied instead of OnStart.

Alternatively, if there's another reason the game isn't fully loaded yet, such as non-Dialogue System components still initializing, set the Dialogue System Trigger to OnUse. Add a Timed Event component to the same GameObject. Set the time duration in frames or seconds, and configure the OnTimeReached() event to call DialogueSystemTrigger.OnUse.

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Thu Oct 28, 2021 1:00 am
by Vomdrache
Hey Tony,

Thanks for the quick reply. The OnSaveDataApplied would be ideal but it doesn't show up as an option on the component. Any idea why that might happen?
Screen Shot 2021-10-27 at 9.58.17 PM.png
Screen Shot 2021-10-27 at 9.58.17 PM.png (127.18 KiB) Viewed 713 times

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Thu Oct 28, 2021 8:16 am
by Tony Li
Hi,

It's a fairly new addition. You'll need to update to a newer version of the Dialogue System to see it. (If you do, please back up your project first just to be safe, as when importing any package or asset.)

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Sun Oct 31, 2021 6:14 pm
by Vomdrache
Package Manager says I'm running version Version 2.2.21 of the Dialogue System, is that the latest?
Would I need to re-import the package after updating? I'm still not seeing that trigger in the dropdown options.

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Sun Oct 31, 2021 7:30 pm
by Tony Li
Hi,

Please see How To: Download Updates With Broken Package Manager

It's possible that you're still using an older version. To verify, select menu item Tools > Pixel Crushers > Dialogue System > Welcome Window or open the file Plugins / Pixel Crushers / Dialogue System / _README.txt and check the version number.

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Tue Nov 02, 2021 1:04 pm
by Vomdrache
The reimport has brought up a good amount of bugs to keep me busy with, but the trigger is now showing up and does work as intended lol.

Thanks for the assistance!

Re: Wait for objects to load before firing off Dialogue System Trigger On Start

Posted: Tue Nov 02, 2021 3:06 pm
by Tony Li
Glad to help! If you get stuck on anything related to the update/reimport, just let me know.