Hello everyone,
I'm currently trying to execute a method in a script after the conversation ended. However, the catch is that only one Outcome of the conversation should cause the execution.
Currently, the solution attempt is to use OnExecute() in the Events inspector field in the dialogue window at the last sequence of the conversation. However, the method is executed WHILE the sequence is active, not after the conversation.
Adding an empty sequence also doesn't work because it waits for the user click.
Did anyone have the same Problem and solve it?
Execute event after ConversationEnded in only one branch
Re: Execute event after ConversationEnded in only one branch
You could add an empty node and include the Continue() sequencer command in the Sequence so the player doesn't have to click.
Or you could set a variable in the two branches -- for example setting the Script fields in the 2 possible ending nodes like this:
And adding a Dialogue System Trigger set to On Conversation End that checks the variable:
Or, if you don't want to use a Dialogue System Trigger, you can add an OnConversationEnd method to a script:
Or you could set a variable in the two branches -- for example setting the Script fields in the 2 possible ending nodes like this:
And adding a Dialogue System Trigger set to On Conversation End that checks the variable:
Or, if you don't want to use a Dialogue System Trigger, you can add an OnConversationEnd method to a script:
Code: Select all
void OnConversationEnd(Transform actor)
{
if (DialogueLua.GetVariable("LastChoice").asInt == 2)
{
// do something
}
}
Re: Execute event after ConversationEnded in only one branch
Hi,
thanks a lot! Everything worked!
thanks a lot! Everything worked!