A way to universally delay Conversation stop?
A way to universally delay Conversation stop?
Hi there,
I've just identified an issue in my game engine, where I encounter all kids of problems caused by a DS conversation starting and stopping in the same frame.
I'm using some convos, not as conversations per se, but to check variables and setup the scene accordingly, so they start and stop extremely fast. And that seems to be a problem with the rest of my logic.
Now, I know I could just add a delay node on those convos, but I'm wondering if I could do that in a "universal" way by modifying DS scripts related to how conversations are stopped. (?)
Thanks.
I've just identified an issue in my game engine, where I encounter all kids of problems caused by a DS conversation starting and stopping in the same frame.
I'm using some convos, not as conversations per se, but to check variables and setup the scene accordingly, so they start and stop extremely fast. And that seems to be a problem with the rest of my logic.
Now, I know I could just add a delay node on those convos, but I'm wondering if I could do that in a "universal" way by modifying DS scripts related to how conversations are stopped. (?)
Thanks.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: A way to universally delay Conversation stop?
Hi,
Can you identify what problems it's causing with the game's logic? You may be able to hook into a different C# event or script method to make it work the way you want without having to modify DS scripts.
Can you identify what problems it's causing with the game's logic? You may be able to hook into a different C# event or script method to make it work the way you want without having to modify DS scripts.
Re: A way to universally delay Conversation stop?
Heh, I'd wish!
My game is kind of a "put all together and pray" kind of thing. And I do 90% of the logic with PlayMaker, which doesn't offer a much convenient way to debug, tbh.
Anyway, what's causing the various issues is that I'm running actions triggered by Conversation Start and Conversation End, and both run on the same PlayMaker FSM, so I suspect Conversation End logic doesn't run at all when a conversation starts and ends in the same frame (the FSM is still running the start actions and doesn't "hear" the end event).
That's why I need to make sure every conversation lasts for at least 0.1 seconds after it's started.
My game is kind of a "put all together and pray" kind of thing. And I do 90% of the logic with PlayMaker, which doesn't offer a much convenient way to debug, tbh.
Anyway, what's causing the various issues is that I'm running actions triggered by Conversation Start and Conversation End, and both run on the same PlayMaker FSM, so I suspect Conversation End logic doesn't run at all when a conversation starts and ends in the same frame (the FSM is still running the start actions and doesn't "hear" the end event).
That's why I need to make sure every conversation lasts for at least 0.1 seconds after it's started.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: A way to universally delay Conversation stop?
Do you think it would help if I were to send you a version of the Dialogue System Events To PlayMaker component that waits one frame before raising the OnConversationEnd event if OnConversationStart happened on the same frame?
Re: A way to universally delay Conversation stop?
That would be great but I'm actually not sure if waiting another frame would be enough.
If it could be a configurable amount, or even better, a fixed real-time delay, that would do the trick in the worst case scenario.
If it could be a configurable amount, or even better, a fixed real-time delay, that would do the trick in the worst case scenario.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: A way to universally delay Conversation stop?
Is there a specific event it could wait for? If it waits for a realtime duration in seconds, it's possible that the OnConversationEnd event could still happen too early on a very slow computer.
Re: A way to universally delay Conversation stop?
I just need to make sure all actions in that FSM are done, so when the OnConversationEnd event is sent to it, it's again in the Listener state.
So, if there was a way to communicate the FSM is now in that state, by running an action when it's back there, for example, that would work.
But now that I think about it... I'm actually using the plain Dialogue System Events, not the "...To PlayMaker" version.
Is that a problem?
So, if there was a way to communicate the FSM is now in that state, by running an action when it's back there, for example, that would work.
But now that I think about it... I'm actually using the plain Dialogue System Events, not the "...To PlayMaker" version.
Is that a problem?
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: A way to universally delay Conversation stop?
No problem at all. They're equivalent.
How do we know that the FSM is in the Listener state?
How do we know that the FSM is in the Listener state?
Re: A way to universally delay Conversation stop?
Each PlayMakerFSM component has the .ActiveStateName string property, it seems. But I guess it would need to be polled each frame.
Sounds like a complex thing to do because you'd need to get the FSM component from the Dialogue System Events, no?
Well, maybe just a configurable number of frames before sending the event will do.
Sounds like a complex thing to do because you'd need to get the FSM component from the Dialogue System Events, no?
Well, maybe just a configurable number of frames before sending the event will do.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: A way to universally delay Conversation stop?
Hi,
Import this updated PlayMaker integration:
DS_PlayMakerSupport_2023-06-03.unitypackage
And this custom subclass:
DS_CustomDialogueSystemEventsToPlayMaker_2023-06-03.unitypackage
Then add CustomDialogueSystemEventsToPlayMaker to your Dialogue Manager.
Set "Frames To Wait Before Conversation End Event" to whatever value works.
Configure your FSM to listen for the event "OnConversationEnd" instead of "Stop".
Import this updated PlayMaker integration:
DS_PlayMakerSupport_2023-06-03.unitypackage
And this custom subclass:
DS_CustomDialogueSystemEventsToPlayMaker_2023-06-03.unitypackage
Then add CustomDialogueSystemEventsToPlayMaker to your Dialogue Manager.
Set "Frames To Wait Before Conversation End Event" to whatever value works.
Configure your FSM to listen for the event "OnConversationEnd" instead of "Stop".