Page 1 of 1
OnConversationLine getting hit twice when conversation starts
Posted: Wed Sep 23, 2020 7:26 pm
by jlhacode
This is the stacktrace of the second OnConversationLine call
- Screen Shot 2020-09-23 at 4.07.42 PM.png (128.9 KiB) Viewed 688 times
Re: OnConversationLine getting hit twice when conversation starts
Posted: Wed Sep 23, 2020 9:17 pm
by Tony Li
That looks correct. What is the stack trace of the first call?
Does this also happen with DemoScene1 when you talk to the NPC?
As a test, you can add a Conversation Logger component to the Dialogue Manager. It will log every event: OnConversationStart, OnPrepareConversationLine, OnConversationLine, etc.
Re: OnConversationLine getting hit twice when conversation starts
Posted: Wed Sep 23, 2020 10:51 pm
by jlhacode
Ran a test on DemoScene1, and can confirm that OnConversationLine() is getting hit twice. Here are the traces for the first & second hits respectively.
First:
- Screen Shot 2020-09-23 at 7.47.51 PM.png (176.41 KiB) Viewed 682 times
Second:
- Screen Shot 2020-09-23 at 7.48.05 PM.png (121.72 KiB) Viewed 682 times
Re: OnConversationLine getting hit twice when conversation starts
Posted: Thu Sep 24, 2020 8:16 am
by Tony Li
Are you sure it's the same line? Remember that OnConversationLine() will also be called for the <START> node, which typically has no text.
If you're sure that the first OnConversationLine is not for the <START> node, please click on each stack trace in the Console window, press Ctrl+C to copy it to the clipboard, and then paste it into a reply. This will give me the script line numbers so I can determine exactly where it's calling OnConversationLine.
Re: OnConversationLine getting hit twice when conversation starts
Posted: Fri Sep 25, 2020 4:19 pm
by jlhacode
My mistake, it's definitely the start node causing that extra OnConversationLine. Thanks for the heads up!
Re: OnConversationLine getting hit twice when conversation starts
Posted: Fri Sep 25, 2020 5:16 pm
by Tony Li
Glad to help!