Your first mod
Make a mod with a window, a switch, a button and an overlay.
On this page you make the window below. You also make an overlay, a small panel that stays on screen while you play.

Make a folder
Open the Wax\mods\ folder (see Installing). Make a new folder in it called MyFirstMod.
Make the file
In that folder, make a text file called init.lua. Paste this in and save it.
-- An overlay stays on the screen while you play.
local hud = ui.Overlay({ title = "My first mod", anchor = "top-left" })
hud:Field("Map", game.MapName or "none")
-- A window lives in the menu. Your mod's own key shows and hides it.
local window = ui.Window({
title = "My first mod", icon = "sparkles", width = 300, height = 170,
})
window:Label("Hello from my first mod.")
window:Toggle("Show the overlay", true, function(on)
hud:SetVisible(on)
end)
window:Button("Say hi", function()
ui.Notify("Hi from my first mod!", { kind = "good" })
end, { primary = true })Switch the mod on
Start ICARUS, or switch to it if it is running. Press F8 and open the Mods page. Your mod is listed there as new, and switched off. Flip its Enabled switch.
A small panel appears in the top left corner of the screen. That is the overlay.
Wax never starts a mod it has not seen before. You switch it on once. After that it stays the way you left it, and it loads by itself when the game starts.
Find your window
Every mod that has a window gets a key of its own. A notification tells you which one Wax picked for your mod, for example F6. It is also on the mod's card, as Show / hide.
Press that key. Your window comes up.
- Flip the switch. The overlay hides and comes back.
- Click Say hi. A green message shows in a corner of the screen.
Press the key again to hide your window. Escape closes everything that is up.
Change it while the game runs
Leave the game running. In init.lua, change "Say hi" to "Wave" and save the file.
The button in the game now says Wave. Saving the file reloaded your mod.
What each part does
| Line | What it does |
|---|---|
ui.Overlay({ ... }) | Makes a panel that stays on screen while you play. It never takes the mouse. |
hud:Field("Map", ...) | Adds a name with a value beside it. |
game.MapName | The name of the map you are on. |
ui.Window({ ... }) | Makes a window in the menu. |
window:Label(...) | Adds a line of text. |
window:Toggle(...) | Adds a switch. The function runs each time you flip it. on is true or false. |
window:Button(...) | Adds a button. The function runs each time you click it. |
ui.Notify(...) | Shows a short message in a corner of the screen. |
Give your mod a name
This step is optional. Add a second file next to init.lua, called mod.lua:
return {
name = "My first mod",
version = "1.0.0",
}The Mods page now shows that name and version. Without this file it shows the folder name.
When something goes wrong
To see what an error looks like, delete a closing bracket in init.lua and save.
- A red message tells you what is wrong, and on which line.
- The Log page of the Wax panel shows the same error.
- The Mods page marks the mod as failed.
Fix the mistake and save again. The mod loads.