Skip to content

Getting Started

github-actions[bot] edited this page Aug 21, 2026 · 6 revisions

Data Directory Location & Structure

Default data directory location depending on your system:

Windows:

  • if %APPDATA% environment variable defined: %APPDATA%\crogue
  • if not defaults to: %USERPROFILE%\AppData\Roaming\crogue

POSIX:

  • if XDG_DATA_HOME envirenment variable defined: $XDG_DATA_HOME/crogue
  • if not default to ~/.local/share/crogue

You can also learn it with --where-is-my-data (or -w) CLI flag:

$ crogue --where-is-my-data
/home/melon/.local/share/crogue

And you can set it with --data (-d) option:

$ crogue --data /path/to/custom_data_dir/

Directory Structure:

├── plugins                 # Plugins directory
│   └── my_plugin           # A plugin
│       ├── init.lua        # Lua code
│       ├── metadata.json   # Plugin metadata
│       ├── pack_name.txt   # Plugin's name
│       ├── settings.json   # Settings of the file generated from metadata
│       └── git_repo.json   # Exists if plugin is installed from git, contains repo url and current commit
│
├── saves                   # Saves directory
│   └──  4342664553149908956_1785512851.json
│
└──  settings.json         # Main game settings, contains plugins enabled or not

Note

You can get current data directory location using cr.get_data_dir() function. It returns the data directory path.

Creating your first plugin

Create a new directory for your plugin. And create these files:

init.lua
metadata.json
pack_name.txt

Pick a name for your plugin. And put it inside pack_name.txt:

my_plugin

Edit your metadata.json:

{
    "name": "My Plugin",
    "description": "This is my first plugin"
}

Then write put some code inside init.lua:

cr.create_card({
        count = 5,
        name = "Skeleton",
        id = "my_plugin:skeleton",
        type = cr.card_type.ENEMY,
        level_ids = {},    -- appears on every level
        logmsg = "Last words of the Skeleton was \"AAA!\"",
        ttl = 3,            -- time-to-live
        power = 1,
        event = function()
                return -1   -- -1 health
        end
})

Congrulations you created your first plugin.

Sharing with others

Create a .crogueignore file at top of your project directory:

my_plugin.zip

Note

crogue pm build command supports .gitignore like ignoring with .crogueignore files. Every subdirectory can have their own .crogueignore file. .crogueignore files under subdirectories has lower priority.

Build it with crogue pm build:

crogue pm build

Note

You can manualy create a .zip file but this commands checks is your plugin is valid.

Now you can share the .zip file with anyone. They will install plugin with this command:

crogue pm install -f my_plugin

But sharing file is not a good way to share, upload your plugins source files to a git repository. Lets say your repository is https://github.com/my_name/my_plugin.git. Installation command:

crogue pm install -g https://github.com/my_name/my_plugin.git

And if you change something they can update plugin version with crogue pm update my_plugin:

crogue pm update my_plugin

Clone this wiki locally