Page 10 of 14

Re: About Dialogue Actor component

Posted: Fri Mar 19, 2021 9:16 am
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.

Re: About Dialogue Actor component

Posted: Fri Mar 19, 2021 9:25 am
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.

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:03 pm
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?

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:08 pm
by Tony Li
Since so many optimizations were added for LuaInterpreter, NLua is no longer supported and will be removed in an upcoming release.

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:14 pm
by CHOPJZL
Is it still able to use other Lua Implementations as said in the manual?

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:24 pm
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?

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:37 pm
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.

Re: About Dialogue Actor component

Posted: Sat Mar 20, 2021 9:38 pm
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.

Re: About Dialogue Actor component

Posted: Sun Mar 21, 2021 9:28 am
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

Re: About Dialogue Actor component

Posted: Sun Mar 21, 2021 10:11 am
by CHOPJZL
Great! Now the Evaluatelinks is 10x times faster and gc become 1/10, too :D