Entity Tutorial 0: Tools Setup

From SkyCorp Global
Jump to: navigation, search

In order to compile your LUA code, you will need two programs.

Windows Lua 5.1

You must use Lua version 5.1.x as that is what the VM expects see (LUA Implementation Limitations). For reference, I am using Lua 5.1.5 Win32.

NOTE - You must use the lua compiler for windows, even if you are on another platform, due to the VM expecting windows formatted LUA. Wine/wineconsole works quite well for emulating it on other platforms.

Base64

The Luac command will created a compiled lua program, however, we need to insert this program into our mod JSON. In order to do this, we will base64 encode the resulting program.

Windows

Windows does not include a base64 command line utility. The easiest solution is to use the Notepad++ text editor along with the MIME tools plugin. The plugin is usually installed, but if not, install it via the plugin manager. Then you can open the file, select all text, and Plugins -> MIME Tools -> Base64 encode.

Other options are available as well, such as command line options. However, some of these include newline characters which will need to be manually deleted.

Mac OSX and Linux

These operating systems already include a base64 command line utility

Video Guide

See this page to see a video demonstrating the setup steps on Windows.