Introduction

It's possible to attach Lua code to entities in LOTJ by setting their lprog. Compared with traditional mud progs, Lua allows for much richer dynamic behavior. For example, you can loop over each character in a room, or echo dynamic content to players including references to other variables.

Using these Docs

The "Topics" section of this documentation will cover basic concepts and high-level guidance. Once you're ready to write a Lua prog, you can reference the sections under "Modules" on the side. If you want to know what you can do with a character variable, for example, see the "character" module.

Apart from the "Lua Basics" section, these docs are intended to be heavily example-based. Most functions will come with a basic example of what it might look like to use them.

Using an Editor

It is highly recommended to write your lua code in another program and then copy/paste it into the game. This will help a lot with syntax and formatting.

OneCompiler seems like a good tool for this. Others have used Notepad++ or other local code editors.

For learning Lua basics and practicing, you can use OneCompiler to write and execute some test code. Although any LOTJ-specific functions obviously won't work there, it can still help with syntax.

generated by LDoc 1.5.0 Last updated 2024-10-22 16:05:00