Skip to content

Tutorial: Getting started with Modding

ValgoBoi edited this page May 19, 2021 · 3 revisions

Setting up a new mod for LuckyAPI was designed to be as easy as possible. You only need 2 files, mod.gd and mod.json, in a specific directory. To start, you'll want some sort of IDE/Code Text Editor. If you aren't sure what to use, I recommend VSCode, it's a really nice general-purpose Code/Text editor.

First, you will need to create a new folder in your mods folder. To find your mods folder, start the game and press F8 to open up your run logs folder, which is named run_logs. Go into the parent folder of the run_logs folder, which should be named Luck be a Landlord. There should be a mods folder, which is the folder we are looking for. Go into this folder.

Now, you'll need to pick a mod ID for your mod. It should be similar to the name of your mod. If you aren't sure what to call your mod, I recommend just calling it <insert your gamertag>'s mod. For your mod ID, make sure it's all lowercase, and uses either underscores or dashes instead of spaces, such as valgos-mod or valgos_mod. Once you pick an appropriate mod ID, create a new folder, named after your mod ID exactly. If your mod ID is some-awesome-mod, your folder will be called some-awesome-mod.

Once you create a folder, you'll need to create a file called mod.json. This essentially contains a bunch of basic information about your mod, such as its id, version, and description. Paste this code into the file:

{
    "id": "<your mod id>",
    "version": "1.0.0",
    "authors": ["<your name here>"],
    "name": "<display name for your mod>",
    "description": "<description for your mod>",
    "dependencies": [],
    "load-after": []
}

Replace <your mod id> with the mod ID, or the folder name. Give yourself credit for your mod by replacing <your name here> with your name or gamertag. Replace <display name for your mod> with the display name for your mod, and <description for your mod> with your mod's description.

Next, you'll need to create a mod.gd file - the central script for your mod. This is where you will register all your mod symbols and other content. You can paste this code in:

extends Reference

func load(modloader: Reference, mod_info, tree: SceneTree):
    print(mod_info.name + " is loading!")
    # ...

Any code in the load function will be run when your mod loads. You will register all your mod's content here.

Mods are automatically reloaded when the game is started. If you want to change something in your mod, just make the change, exit, and reopen the game!

This is actually everything you need to start making a mod! If you want to start adding your own symbols, view the tutorial to do so here! Good luck with your modding adventure! Remember, if you ever need help with making mods, feel free to join our Discord Server and ask for help!

Clone this wiki locally