Hello!
I've jumped on a project with some people and have been tasked with figuring out the quest system. I've been having a little trouble following some of the tutorials and examples though, regarding the increment on destroy script.
I have a cube set up with a dialogue system trigger. it is set to disable itself with OnTriggerEnter, which it does. I have the increment on destroy script run OnUse on another dialogue system trigger on a different object in the scene to spit out some debug text, but it doesn't do that.
I can get the OnUse to work straight from the cube's dialogue system trigger without disabling it, but even if I disable it there, it still won't call OnUse. is there something I'm missing?
Increment on destroy not working
Re: Increment on destroy not working
Hi,
Dialogue System Triggers will only do their thing if they're enabled. If a Dialogue System Trigger's GameObject is deactivated, all of its scripts are disabled.
Also, if the Dialogue System Trigger is not set to OnUse, then calling its OnUse() method will do nothing.
If that doesn't help, would you please describe what you want to accomplish? I may be able to suggest a good way to do it with the Dialogue System.
BTW, DemoScene2 provides an example of using Increment On Destroy. There are 5 enemies. When shot, their Increment On Destroy components increment a variable,. show an alert, and then call another GameObject's DialogueSystemTrigger.OnUse.
Dialogue System Triggers will only do their thing if they're enabled. If a Dialogue System Trigger's GameObject is deactivated, all of its scripts are disabled.
Also, if the Dialogue System Trigger is not set to OnUse, then calling its OnUse() method will do nothing.
If that doesn't help, would you please describe what you want to accomplish? I may be able to suggest a good way to do it with the Dialogue System.
BTW, DemoScene2 provides an example of using Increment On Destroy. There are 5 enemies. When shot, their Increment On Destroy components increment a variable,. show an alert, and then call another GameObject's DialogueSystemTrigger.OnUse.
-
- Posts: 3
- Joined: Sun Jan 19, 2020 10:07 pm
Re: Increment on destroy not working
The dialogue system triggers are enabled, yes. the system trigger I'm trying to call OnUse on is set to OnUse.
what I'm trying to accomplish is this:
I have a player sphere and a cube. when the player sphere enters the trigger of the cube, the cube should disable using a dialogue system trigger (set to OnTriggerEnter) and trigger an event in incremementOnDestroy (set to check for disable) that calls OnUse() on another object's system trigger to spit out debug text.
If I set up the cube to call the other object's OnUse() on the trigger enter instead of disabling, I get the debug text. When I try to set it up like the above, it does nothing after the cube is disabled.
here is the cube's ideal set up:
and here is the OnUse object's set up:
if I set the cube up like this, it spits out the debug text like I want, but does nothing for increments:
what I'm trying to accomplish is this:
I have a player sphere and a cube. when the player sphere enters the trigger of the cube, the cube should disable using a dialogue system trigger (set to OnTriggerEnter) and trigger an event in incremementOnDestroy (set to check for disable) that calls OnUse() on another object's system trigger to spit out debug text.
If I set up the cube to call the other object's OnUse() on the trigger enter instead of disabling, I get the debug text. When I try to set it up like the above, it does nothing after the cube is disabled.
here is the cube's ideal set up:
and here is the OnUse object's set up:
if I set the cube up like this, it spits out the debug text like I want, but does nothing for increments:
Re: Increment on destroy not working
As a test, please inspect the QuestUSe GameObject's Dialogue System Trigger. Select Add Action > Show Alert. Type in a test alert message. Then play the scene again. Does the alert message appear?
Here's an example scene that's set up similarly to yours. It's DemoScene1, but there's a white cube you can walk into to start the Dialogue System Trigger/Increment On Destroy process.
DS_TestIncrementOnDestroy_2020-01-20.unitypackage
Here's an example scene that's set up similarly to yours. It's DemoScene1, but there's a white cube you can walk into to start the Dialogue System Trigger/Increment On Destroy process.
DS_TestIncrementOnDestroy_2020-01-20.unitypackage
-
- Posts: 3
- Joined: Sun Jan 19, 2020 10:07 pm
Re: Increment on destroy not working
Thank you for the demo! it was very illuminating...
I had been testing as bare bones as I could, so I didn't have a Dialogue manager in the scene- since a lot of stuff wasworking, I figured it was unnecessary - looks like not! Once I put that in there it worked like a charm.
Thanks again
I had been testing as bare bones as I could, so I didn't have a Dialogue manager in the scene- since a lot of stuff wasworking, I figured it was unnecessary - looks like not! Once I put that in there it worked like a charm.
Thanks again
Re: Increment on destroy not working
Sorry, I didn't think to mention that earlier. The Dialogue Manager is the engine that runs manages everything Dialogue System-related. Typically you'll put it in your main menu scene so it's available no matter where you go from there. You can also have a copy in every gameplay scene, which makes it easy to test individual scenes in the editor. With the default settings (Don't Destroy On Load and Allow Only One Instance), when you come in from the main menu the original Dialogue Manager will survive the scene change and replace the one that's in the gameplay scene.
Anyway, glad you got it all working now!
Anyway, glad you got it all working now!