Don't Trigger OnConversationEnd() event just once.
-
- Posts: 4
- Joined: Tue Oct 29, 2024 5:28 am
Don't Trigger OnConversationEnd() event just once.
I have an OnConversationEnd event on my player; however, there are very few situations in which I do not want it to trigger. Is it possible to add an exception in the conversation somewhere?
Re: Don't Trigger OnConversationEnd() event just once.
Hi,
I suppose you could set a variable. For example, in that special conversation set a DS variable true:
Then check that variable in your OnConversationEnd() handlker and set it back to false. If you're using a script:
If you're using a Dialogue System Events component, you could replace it with two Dialogue System Triggers set to OnConversationEnd. In the first, set Conditions > Lua Conditions to check if "SkipEndEvents" is true. If so, run Action > Run Lua Code to set it false. In the second, set Conditions > Lua Conditions to check if "SkipEndEvents" is false. If so, do your regular event handling.
I suppose you could set a variable. For example, in that special conversation set a DS variable true:
Code: Select all
Variable["SkipEndEvents"] = true
Code: Select all
void OnConversationEnd(Transform actor)
{
if (DialogueLua.GetVariable("SkipEndEvents").asBool == true)
{
DialogueLua.SetVariable("SkipEndEvents", false);
return;
}
// Here, do your end event handling.
}
-
- Posts: 4
- Joined: Tue Oct 29, 2024 5:28 am
Re: Don't Trigger OnConversationEnd() event just once.
Oh, yeah, that's a good way to handle it.
If I'm on my Player Movement script, and I want to access a bool in the variable section of my dialogue system database, how do I do that?
If I'm on my Player Movement script, and I want to access a bool in the variable section of my dialogue system database, how do I do that?