So, Ladies and Gentlemen, I added Lua to WSE.
This is meant as a replacement/supplement to the module system.
If you don't already know, Lua is the de facto standard for scripting in the gaming industry - countless games utilize it. It's a powerful tool, especially compared to the module system.
While the MS gets the job done, using it is cumbersome and leaves a lot to be desired.
Now you don't have to rely on the module system anymore for most purposes. My goal was that you never have to touch a single line of MS code again. It's not quite there yet, but it's going in the right direction.
Lua is superior in many ways. Proper functions (with return values!), native arrays/tables, easy string manipulation, easy math, (re)loading code on the fly, incredible flexibility, ...
It's based on a modified version of LuaJIT 2.0.4, a JIT compiler for Lua 5.1. A JIT compiler translates script code to machine code at runtime, which results in a massive performance boost compared to traditional script interpreters. So, if you've ever dreamed about high performance computing inside M&B, your dreams have come true. I added a sandbox that restricts file system access to a root folder, disables execution of anything except Lua files and disables bytecode (could contain exploits). This is important to prevent harm from end users and could be a requirement for hosting providers.
Features include:
A detailed guide is included in the download (WSESDK\luaGuide.html).
This is the first version I deemed worthy a release, but I'm sure there are bugs left. If you find one, please make a post here which includes:
Once it's stable, it will be included into main WSE. Now included in main WSE.
If you give it a try, please leave some feedback here.
Download:https://bitbucket.org/Kumpuu/warband-script-enhancer/downloads/WSE_LUA_0.3.zip Merged into main WSE
Source Code: https://bitbucket.org/Kumpuu/warband-script-enhancer/src
Thanks to:
-EmielRegis , for testing and finding a crapton of bugs
-Real Human Bean, for technical support
This is meant as a replacement/supplement to the module system.
If you don't already know, Lua is the de facto standard for scripting in the gaming industry - countless games utilize it. It's a powerful tool, especially compared to the module system.
While the MS gets the job done, using it is cumbersome and leaves a lot to be desired.
Now you don't have to rely on the module system anymore for most purposes. My goal was that you never have to touch a single line of MS code again. It's not quite there yet, but it's going in the right direction.
Lua is superior in many ways. Proper functions (with return values!), native arrays/tables, easy string manipulation, easy math, (re)loading code on the fly, incredible flexibility, ...
It's based on a modified version of LuaJIT 2.0.4, a JIT compiler for Lua 5.1. A JIT compiler translates script code to machine code at runtime, which results in a massive performance boost compared to traditional script interpreters. So, if you've ever dreamed about high performance computing inside M&B, your dreams have come true. I added a sandbox that restricts file system access to a root folder, disables execution of anything except Lua files and disables bytecode (could contain exploits). This is important to prevent harm from end users and could be a requirement for hosting providers.
Features include:
- Easy way of calling game engine operations
- Game register access
- Adding/removing module triggers on the fly
- Game loops (try_for_agents, ...)
- Native position/rotation "class"
- Module operations to call lua from the module system
A detailed guide is included in the download (WSESDK\luaGuide.html).
This is the first version I deemed worthy a release, but I'm sure there are bugs left. If you find one, please make a post here which includes:
- Exact error message
- Steps/Code to reproduce
- latest entry in wse_crash_log.txt, if existent
If you give it a try, please leave some feedback here.
Download:
Source Code: https://bitbucket.org/Kumpuu/warband-script-enhancer/src
Thanks to:
-EmielRegis , for testing and finding a crapton of bugs
-Real Human Bean, for technical support