Exdilin
  • Initial page
  • Coloring Text (speech bubble)
  • Concepts
    • Initialization orders
  • Lua Mods
    • Introduction
    • Adding Blocks
    • Custom Textures
    • Sound of Mods
  • Glosarry
    • Rarity Levels
    • Texture Mappings
Powered by GitBook
On this page
  • Prerequisites
  • Creating a mod
  • Pre-Initialization

Was this helpful?

  1. Lua Mods

Introduction

PreviousInitialization ordersNextAdding Blocks

Last updated 4 years ago

Was this helpful?

Prerequisites

To create a mod, you first need to learn Lua. If you don't know Lua, you can either search video tutorials on websites like YouTube or just search a text tutorial using a search engine.

The page or a Lua Tutorial (maybe ?), once you get a grasp of Lua, you can start modding Blocksworld!

You don't need to install any software to code in Lua, just open Notepad (or better, Notepad++) and you're ready to go!

Creating a mod

Each Lua mod is in a directory. So to create a mod, you will have first to create a directory, the directory's name can only contain alphabetical characters (A to Z, upper case and lower case), digits (0 to 9) and underscores.

Once it is created you MUST move it to (Documents)/blocksworld_develop/user_[somenumber]/user/lua_mods

Where (Documents) is your Documents folder.

To name the file init.lua do not forget to .

To create a mod you just have to create an init.lua file:

name = "Tutorial Mod"
dependencies = {
    {"exdilin", ">0.5.0"}
}

As you learnt Lua, you might have spoted that name and dependencies are global variables. This is necessary and they should not be set as local variables.

As you might have guessed, the name variable is the mod's name, dependencies is something we will see later, all this mean for now is that the mod needs to run on Exdilin 0.5.0 (the first version to support Lua mods).

Now to make actual modding requires you to grasp the Modding Concepts.

Pre-Initialization

Let's add a pre-init function, replace the file content's with the following:

name = "Tutorial Mod"
dependencies = {
    {"exdilin", ">0.5.0"}
}

function pre_init()
    
end

Great! In the next chapter, we will add blocks.

Pre-initialization (see ) is an important step and is where we will register most things.

Get Started
Tutorialspoint's tutorial
enable file extensions in Windows Explorer
Initialization orders