Skip to content

Core Module

STBrian edited this page Nov 9, 2026 · 10 revisions

The Core module contains functions that interact directly with the console, memory, filesystem, or with LunaCore internals.

Submodules

Debug Logging, error handling, and notifications
Filesystem SD card and extdata file/directory operations
Keyboard Software keyboard dialogs for strings, numbers, hex, and lists
Memory Process memory reading, writing, dynamic allocation, and native calling
Menu CTRPluginFramework in-game menu folders and entries integration
System System hardware state, 3D slider position, and Unix time

Constants

Core._VERSION LunaCore runtime version string

Functions

Core.getModpath Returns the root directory path of a registered mod
Core.getCurrentModname Returns the name of the mod currently being loaded
Core.getTitleId Returns the active 3DS Title ID as a hexadecimal string

Core._VERSION

Returns the current LunaCore version string.

Core._VERSION: string

Core.getModpath

Returns the absolute path corresponding to a registered mod name, or nil if not registered.

Core.getModpath(modname: string) -> string?

Example

local modPath = Core.getModpath("my_mod")
if modPath then
    Core.Debug.log("Mod located at: " .. modPath)
end

Core.getCurrentModname

Returns the name of the mod that is currently executing its load script.

Core.getCurrentModname() -> string

Core.getTitleId

Returns the title ID of the currently running application formatted as a hexadecimal string.

Core.getTitleId() -> string

Clone this wiki locally