luascript

Lua language support for Godot Engine
授权协议 Apache-2.0 License
开发语言 C/C++
所属分类 游戏/娱乐、 游戏模拟器/工具/引擎
软件类型 开源软件
地区 不详
投 递 者 冀俊良
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

LuaScript

Lua 5.4 language support for Godot Engine 3.x (4.0-dev too unstable to work with for now)

WIP (heavily updated so you can expect constants changes - no commitment with feature freezing at this moment)

Current progress:

  • I decided to use the Antlr4 library to do the parsing of Lua code. I am in the process of integrating it with the LuaScript module. With this in place it will be possible to start answering engine call backs, like for example, _ready(), _process() etc.

Features

  • Full Godot's gameplay API implementation (feature complete on par with GDScript)
  • Configurable API sandbox
  • Object Oriented Programming based on Lua's tables and metatables
  • Support for inheritance from Lua base class and file
  • Support for inheritance from native base class and file
  • Support for properties
    • Getters, setters and default values
    • Editing properties values in the property editor
  • Support for signals
    • Signal connect, emit and receive from code
    • Signal connect from the editor (currently not well supported by Godot)
  • Lua language coding in Godot's built in editor
    • On the fly source code linting and static analysis
    • On the fly source code syntax highlighting
    • Source code beautifier
      • Format the entire active file
      • Format the selected text
      • Format automatically when saving
    • Source code refactoring (currently not supported by Godot)
    • Code editor color theme (Icemoon)
  • Lua language coding in external editor (possibly with the same capabilities as the built in editor)
  • Support for multiple Lua runtimes (PUC Rio Lua 5.4 and LuaJIT)
  • Debugging tools (possibly with all Godot's debugging capabilities)
  • Tool creation to extend the built in editor functionalities
  • Support for advanced package assembling
    • Dead code elimination throught tree-shaking
    • Code uglifier and minifier
    • Compilation into binary bytecode
    • Compression or encryption
  • Export for all Godot's supported platforms

How to Build

My development environment is based primarily on Linux and Mac so I don't know if it will work on Windows. Shouldn't be a problem though as I'm only making use of standard C++17 code and the available Godot C++ API. If you experience any problem when building on Windows please report an issue and I'll be glad to work on solving it.

So first of all you have to have Godot successfully built in your system, which is beyond the scope of this simple how to.

Now, assuming you can git clone from GitHub, just clone LuaScript into Godo's source code 'modules' folder and then, build Godot again adding to the command line the following options

module_luascript_enabled=yes

If everything has gone well, you'll have a running Godot with Lua support!

Keep watching the development as I'm slowly but steadly adding more features.

Have fun!

Issues and Support

Have a bug? Please create an issue here on GitHub!

https://github.com/perbone/luascript/issues

Versioning

For transparency and insight into our release cycle, releases are be numbered with the semantic versioning format: <major>.<minor>.<patch> and constructed with the following guidelines:

  • Breaking backwards compatibility bumps the major
  • New additions without breaking backwards compatibility bumps the minor
  • Bug fixes and misc changes bump the patch

Contributors

License

Copyright 2017-2021 Paulo Perbone

Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License

  • 获取redis连接 public class RedisHelper { private static readonly string ConnectionString = ConfigurationManager.ConnectionStrings["RedisConnection"].ConnectionString; private static Co

  • Unknown Redis command called from Lua script出现问题,我看到StackOverflow上说config什么出了问题,后来,我在写redis的lua脚本的时候,发现是我的问题, redis.call("SETEX", key, 1, 10); 但是我写成了 redis.call("SETEX ", key, 1, 10); 多了一个空格,记录下,防

  • 问题 -ERR bad lua script for redis cluster, all the keys that the script uses should be passed using the KEYS arrayrn 上线遇到一个阿里云Redis集群的坑,特地写出来,供各位遇到此问题的道友参考,这是因为阿里云的Redis集群对Lua脚本调用的时候做了限制: #Lua使用限制 为了保

  • EVAL、EVALSHA命令 Redis从2.6.0版本开始提供了eval命令,通过内置的Lua解释器,可以让用户执行一段Lua脚本并返回数据。因为Redis单线程模型的特点,可以保证多个命令的原子性(因为最近的项目需要用到简单的分布式锁,所以会用到lua来释放锁) 脚本性能 Redis保证了脚本执行的原子性,所以在当前脚本没执行完之前,别的命令和脚本都是等待状态,所以一定要控制好脚本中的内容,防

  • 阿里云的redis使用lua脚本报错 ERR bad lua script for redis cluster, redis.call/pcall, wrong number of arguments for ‘pexpire’ command. channel: org.redisson.client.RedisException: ERR bad lua script for redis cl

  • 我最近学习游戏脚本编程。接触到的第一个脚本编程语言就是Lua。我使用的Lua版本是5.1。遗憾的是,我学习脚本编程的那本书中使用的版本是老版本的Lua,由于Lua在新版本中,对很多函数调用作了改变,我发现根据书中的介绍,很难成功地编译程序。经过自己的研究,终于可以正常地使用Lua提供的基本功能了。所以我把我的解决方法写出,和大家分享,希望对其他使用新版本Lua遇到麻烦的朋友有所帮助。   下载安装

  • 有些新手,比如我 会直接使用jedisCluster.eval()操作lua语句,导致出现这种问题 我个人理解是集群的solt问题,自己也理解的马马虎虎的 eval的本质跟直接的set一样,会导致slot不在一个redis节点上(菜狗言论,别喷我) 要是有大佬为我解惑就好了 我自己之前也因为key的slot问题报错过 我自己的key前面是有加{}的,让所有必要的key存放在一个节点 然后解决方法就

  • 从 Redis 2.6.0 版本开始,通过内置的 Lua 解释器,可以使用 EVAL 命令对 Lua 脚本进行求值 Redis2.6内置的Lua Script支持,可以在Redis的Server端一次过运行大量逻辑。 • 整个Script默认是在一个事务里的。 • Script里涉及的所有Key尽量用变量,从外面传入,使Redis一开始就知道你要改变哪些key。 • EVAL每次传输一整段Scri

  • lua script filename: test.lua local key=KEYS[1] local val=ARGV[1] return redis.call('SET', key, val) go code package main import ( "fmt" "io/ioutil" "time" "github.com/gomodule/redigo/redis" )

相关阅读

相关文章

相关问答

相关文档