-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
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_HOMEenvirenment 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/crogueAnd 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 notCreate a new directory for your plugin. And create these files:
init.lua
metadata.json
pack_name.txtPick a name for your plugin. And put it inside pack_name.txt:
my_pluginEdit 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.
Build it with crogue pm build:
crogue pm buildNote
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_pluginBut 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.gitAnd if you change something they can update plugin version with crogue pm update my_plugin:
crogue pm update my_plugin-
Getting Started
-
Metadata
-
Variable Types and Variables
-
Game Status
-
TUI