To create a new cheat, you can use newcheats.lua
Code: Select all
local newcheats = require("game/newcheats")
-- when the cheat "mycustomcheat" is typed on the keyboard, set the background of the section player 1 is in to the smb3 pipe background and sets the music to smb3 cave
newcheats.register("mycustomcheat", {onActivate = function()
player.sectionObj.backgroundID = 5
player.sectionObj.musicID = 4
end})
You can look at newcheats.lua to see all the basegame cheats and how they're implemented. There are different events like onActivate, onToggle, onTick and onKeyDown for the cheats, which trigger under different circumstances as long as the cheat is active. Making the cheat logic will require some knowledge of lua though - like with that player.sectionObj stuff up there.
I derive the background IDs from the editor (they are the same numbers as in the section settings there) and the music ids from the data/_templates/music.ini file.
The code above would go into a file called luna.lua, located in your
episode or level folder.