I have a lua script that will be run on the end of the dialogue. First I had it on the last node, it ran fine, but it got executed before the dialog line was completed.
Then I tried to add an empty node with the script. It runs, but it seems like it doesn't invoke
DialogueManager.instance.conversationEnded and the conversation ends up in a state where the player is unable to do things as it's waiting for the conversation to end.
Is this something you have any tips for?
Script after dialog ends?
Script after dialog ends?
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Re: Script after dialog ends?
Hi,
Even if you add it to an empty node at the end, the Script will run before DialogueManager.instance.conversationEnded.
If you want it to run after/during DialogueManager.instance.conversationEnded, add a Dialogue System Trigger to a GameObject. If you only want it to run when a specific NPC's conversation ends, add it to the NPC. If you want it to run after every conversation, add it to the Dialogue Manager. Set the trigger to OnConversationEnd. Select Add Action > Run Lua Code. Then put your script in the Lua Code field.
Even if you add it to an empty node at the end, the Script will run before DialogueManager.instance.conversationEnded.
If you want it to run after/during DialogueManager.instance.conversationEnded, add a Dialogue System Trigger to a GameObject. If you only want it to run when a specific NPC's conversation ends, add it to the NPC. If you want it to run after every conversation, add it to the Dialogue Manager. Set the trigger to OnConversationEnd. Select Add Action > Run Lua Code. Then put your script in the Lua Code field.
Re: Script after dialog ends?
Hmm.. thanks, but i'm not sure that would work. I want to run it only for a specific conversation, not for every conversation that ends with this npc.
It's a script that makes the NPC move to a specific location for the intro of the game after a dialogue.
Any suggestions?
It's a script that makes the NPC move to a specific location for the intro of the game after a dialogue.
Any suggestions?
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Re: Script after dialog ends?
Assuming the NPC is used as the Conversation Conversant, can you add another Dialogue System Trigger? Set it to OnConversationEnd. Then select Add Action > Run Lua Code if you want to run Lua code, or Add Action > Play Sequence to play a sequence, etc.