We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我们目前使用的Lua运行库为ToLua#,它使用的Lua语言版本为LuaJIT,与Lua 5.1完全兼容,Lua 5.2的特性只有一部分兼容
built_in.lua开头的地方禁止了读取没有定义的全局变量,会报错Attempt to read undeclared global variable
built_in.lua
Attempt to read undeclared global variable
我们的Lua parser支持Unicode字符。比如你把字符串'abc'外面的英文引号打错成了中文引号‘abc’,parser就会把它当成一个叫做‘abc’的变量,不会在parsing时报错,而会在运行时报变量没有定义的错
'abc'
‘abc’
由于ToLua# native plugin的跨平台编译还没完全搞定,macOS上load的行为会与Windows上不同。如果出现报错bad argument #1 to 'load' (function expected, got string),可以试试把load换成loadstring
load
bad argument #1 to 'load' (function expected, got string)
loadstring
目前preload系统使用正则表达式来识别show之类的函数,具体可以看DialogueEntryPreprocessor.cs。函数的参数如果是字符串,必须用单引号或者双引号(而不是方括号)来表示,否则无法识别
show
DialogueEntryPreprocessor.cs
The text was updated successfully, but these errors were encountered:
补充:macOS 运行报错,可以试试把 Assets/Nova/Lua/script_loader.lua 第 71 行的 load改为 loadstring 对应代码:https://github.com/Lunatic-Works/Nova/blob/master/Assets/Nova/Lua/script_loader.lua#L71
Assets/Nova/Lua/script_loader.lua
Sorry, something went wrong.
No branches or pull requests
我们目前使用的Lua运行库为ToLua#,它使用的Lua语言版本为LuaJIT,与Lua 5.1完全兼容,Lua 5.2的特性只有一部分兼容
built_in.lua
开头的地方禁止了读取没有定义的全局变量,会报错Attempt to read undeclared global variable
我们的Lua parser支持Unicode字符。比如你把字符串
'abc'
外面的英文引号打错成了中文引号‘abc’
,parser就会把它当成一个叫做‘abc’
的变量,不会在parsing时报错,而会在运行时报变量没有定义的错由于ToLua# native plugin的跨平台编译还没完全搞定,macOS上
load
的行为会与Windows上不同。如果出现报错bad argument #1 to 'load' (function expected, got string)
,可以试试把load
换成loadstring
目前preload系统使用正则表达式来识别
show
之类的函数,具体可以看DialogueEntryPreprocessor.cs
。函数的参数如果是字符串,必须用单引号或者双引号(而不是方括号)来表示,否则无法识别The text was updated successfully, but these errors were encountered: