Your first mod
A mod is Lua code that Phigros++ runs inside the game. You need Node.js and, for Android, adb with the device plugged in. Get the mod script:
curl -O https://raw.githubusercontent.com/ggmolly/PhigrosPlusPlus/main/scripts/mod.mjs node mod.mjs new hello
hello/ is a mod, ready to become a GitHub repository (Publishing a mod). Its init.lua:
local loud = setting("Say hello", true, "hello") on("song", function(chart) if loud() then toast("Good luck on " .. chart.name) end end)
Send it to the device, then again each time you save a file, and follow the log in another terminal:
node mod.mjs push hello --watch node mod.mjs logs
Phigros++ sees a new or changed file within a second and reloads every mod, without restarting the game. Start a song and the toast says good luck. What a mod prints is in the log. If your mod has an error, the log names the file and the line, and the other mods keep running: fix it, save, and it reloads.
Your editor
new set up hello/ for lua-language-server, which VS Code's "Lua" extension and most editors use: it completes the whole API, shows what each function does, and warns about a misspelled field or a missing argument. node mod.mjs types brings the latest API into a mod made before.
Trying things in the game
eval runs Lua in the game as it is, without reloading anything, and prints what it gives back:
node mod.mjs eval 'il2cpp.find("Score")'
node mod.mjs eval 'il2cpp.describe(CS.ScoreControl)'
node mod.mjs eval 'stats()'Bigger mods
A mod is a folder with an init.lua inside, so its pictures and sounds sit next to it, and require("util") runs the util.lua next to it. A single hello.lua is a mod too (node mod.mjs push hello.lua). Mods load in name order, and one mod can use another with require("other").
On iOS, copy the folder to phigros++/mods/ from the Files app (On My iPhone, Phigros++): the game reloads the same way and writes its log to phigros++/log.txt.
Next
Settings: add toggles, sliders and buttons for your mod.
Reacting to the game: do something when a song starts, a note is hit or a song ends.
Publishing a mod: let players install it from the game.
Skins and hit sounds: change how notes look and sound.
Every function is listed in Mod API.