User Tools

Site Tools



lua_tutorial

This is an old revision of the document!


Learning Lua

by Kali#3326

This tutorial is designed with beginners in mind, but has topics suitable for advanced users as well. Even if you have no programming experience you should be able to easily follow along and grasp the concepts along the way. As someone who is self taught I understand the struggles of overcoming all the technical jargon traditional guides throw around, and while I understand the importance of that jargon, I think it is best to start simple with obtainable goals in mind.

Getting Started

You don't need any fancy software or an IDE to make scripts for Minion, in fact you already have everything you need, MMOMinion and Notepad. However, you can do a whole lot better than Notepad, so here are some of my recommendations:

There are other options out there, most people tend to go with VSCode or Notepad++. I personally prefer IntelliJ but the most important thing is that you know how to use it comfortably because you don't want to have to end up learning how to write Lua on top of how to install and use the software.

Next are online resources, use these to look up standard Lua functions. Minion uses a modified version of Lua 5.1 with some standard functions removed/modified for security purposes. Keep that in mind when using these and other resources.

Now that you have everything you need, lets get started with the traditional Hello, World!, and we don't even need any of the above to do it. We're going to need Minion's console for this, and if you've never used it before or don't even know what I'm talking about, you can access it by clicking on the MMOMinion button and selecting Console.

The console is one of your most important tools when developing, debugging, or even reporting an issue to other developers. At first glance it might seem like a bunch of nonsense, but everything in the console has been determined by that developer that it is important information and to output it into the console. The reason for this is if that information is not correct or not intended that we have a record of what Minion's Lua Interpreter executed and in what order if we have enough information.

Now with Minion's Lua instead of using the function print to “print to the console” like you normally would use, we simply use the function d, and to stick with tradition we can output to the console with our Hello World message:

d("Hello, World!")

lua_tutorial.1682432642.txt.gz · Last modified: 2023/04/25 14:24 by kali