About Dialogue Actor component

Announcements, support questions, and discussion for the Dialogue System.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

There maybe chances that I use a coroutine in StandardUIMenuPanel in the future, so I think it is still needed to add a ref of the Record to Response just in case.

About the Sequencer. Earlier I said I thought about making my own sequence manager by creating a new sequencer in Sequencer command. I will need a ref of Record in the new sequencer to control it, and I want to pass the ref by the conversation sequencer. So I personally need a ref of the Record in Sequencer.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

I'll look into that to make sure there won't be any issues with adding it to the sequencer.

In the meantime, if you use a coroutine in StandardUIMenuPanel, just record DialogueManager.instance.activeConversation at the beginning of the coroutine.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Hi,

Today I tried to import Nlua, But there are errors in DialogueSystemSaver and PersistentDataManager. It seems there are several methods that is missing in Nlua's wrapper. Did I miss some steps?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Since so many optimizations were added for LuaInterpreter, NLua is no longer supported and will be removed in an upcoming release.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Is it still able to use other Lua Implementations as said in the manual?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Yes, with some work. But I'm planning to remove that ability. Is there a reason you want to use another implementation?
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

I have to say the performance of Lua Interpreter is a little low. When Evaluatelinks, it will cost 20kb gc and 1 ms for each link. But I tried a Implementation called "Xlua", for just running a line of lua code, and it is far more performant. I don't know if it will be different if I inplement it to the dialogue system, so I wanted to try Nlua to have a comparison.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

I'll take a look tomorrow at what needs to be done to make it easier to enable NLua again. Edit: It should be a relatively quick update tomorrow. There's just a few things in one script (PersistentDataManager) that I'll update tomorrow to make it so you don't have to touch any code to enable NLua support.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Hi,

Here's the patch. It's just 1 file.

DS_NLuaPatch_2021-03-21.unitypackage

Here are the setup steps, which I'll update in version 2.2.16's documentation, too.

(Import the patch first.)

1. Download the Lua 5.4 binaries: http://luabinaries.sourceforge.net/download.html
  • Put them in Plugins/x86_64/, etc.
2. Download KeraLua: https://github.com/NLua/KeraLua
  • Add the 'src' folder to your project, somewhere in the Plugins folder, such as Assets/Plugins/KeraLua/src
  • Delete the Properties subfolder.
3. Download NLua: https://github.com/NLua/NLua
  • Add the 'src' folder to your project, somewhere in the Plugins folder, such as Assets/Plugins/NLua/src
  • Delete the Properties subfolder.
4. Select menu item Edit > Project Settings. In the Player section, add these symbols to Scripting Define Symbols:

Code: Select all

NETSTANDARD;USE_NLUA
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Great! Now the Evaluatelinks is 10x times faster and gc become 1/10, too :D
Post Reply