Cosmetics API

版本 v1.1.4·更新於 2026-05-02

Developer library to simplify adding new Crossroads cosmetics to Hades II. Does nothing by itself.

模組介紹 作者原文

Cosmetics API

Developer library to simplify adding new Crossroads cosmetics to Hades II. Does nothing by itself.

Features

Through this library, you can easily add new cosmetic items to the Crossroads, as offered by Dora.

You can add alternative versions of any existing cosmetic, both "Alt Decor" and "Extra Decor" items are supported.

Adding entirely new cosmetics (in different locations), or replacing assets that aren't already a cosmetic is not supported.

The library will automatically handle grouping cosmetics so that equipping one will unequip any other already equipped cosmetic in the same group.

You can provide names, descriptions and flavour texts for various languages, as well as customize the voicelines used when purchasing, equipping or unequipping the cosmetic.

For even more advanced usecases, you can also provide a function name that is called when your cosmetic is bought or equipped.

You can also register new Arcana Card Back packs. The API handles shop integration, animation hookup and pagination when the card back selection screen exceeds one page.

Usage

Start by adding NikkelM-Cosmetics_API as a dependency in your.toml (ensure you use the latest version):

NikkelM-Cosmetics_API = "1.0.0"

Next, include the Cosmetics API in your main.lua, alongside other dependencies:

---@module "NikkelM-Cosmetics_API"

CosmeticsAPI = mods["NikkelM-Cosmetics_API"]

Registering Packages

If your cosmetics use custom textures bundled in.pkg files, you can register those packages so the API loads them when entering the Crossroads.

Place your.pkg (and.pkg_manifest) files in your mod's plugins_data folder and call RegisterCrossroadsPackages with a table of package names (without the.pkg extension):

CosmeticsAPI.RegisterCrossroadsPackages({ "AuthorName-ModNameCosmetics" })

The API will automatically load all registered packages when the player enters the Crossroads (including the Training Grounds), regardless of which transition is used (DeathAreaRoomTransition, HubPostBountyLoad, or HubPostDreamLoad).

Duplicate package names are silently ignored.

You can alternatively also load the packages yourself within your mod code.

Registering Cosmetics

Now, you can add a new cosmetic by calling CosmeticsAPI.RegisterCosmetic(cosmeticData), where cosmeticData is of type CosmeticData.

If you have your development environment set up correctly, VS Code should offer autocompletion and type hints for this table.

Otherwise, you can always refer to the def.lua file in the Cosmetics API source, or the below example, for all available fields.

CosmeticsAPI.RegisterCosmetic({

-- REQUIRED FIELDS

Id = _PLUGIN.guid.. ".".. "Cosmetic_Pillars_Chronos",

-- At least "en" must be provided for Name, Description and FlavorText

Name = {

en = "Pillars, Timeless",

de = "...",

},

Description = {

-- "{$Keywords.CosmeticSwap}:" resolves to "Alt Decor" with a tooltip for something that replaces something, "{$Keywords.CosmeticAltAdd}:" to "Extra Decor" with a tooltip that it adds or replaces something similar, and {$Keywords.CosmeticAdd} resolves to "Extra Decor" for something that did not exist before. You should not need to use CosmeticAdd, since all cosmetics added through the Cosmetics API replace an existing cosmetic.

en = "{$Keywords.CosmeticSwap}: Time-worn monoliths that stand tall to either side of the {#BoldFormatGraftDark}Cauldron{#Prev}.",

de = "...",

},

FlavorText = {

en = "Nothing stands the test of time they say, yet these pillars beg to differ.",

de = "...",

},

-- Which of Dora's shop locations to add this cosmetic to. One of "CosmeticsShop_Tent" (Mel's Tent), "CosmeticsShop_Main" (Crossroads Main Grounds & West), "CosmeticsShop_Taverna" (Taverna & Crossroads West), "CosmeticsShop_PreRun" (Training Grounds)

ShopCategory = "CosmeticsShop_Main",

-- Which existing cosmetic the new one is a variant of

CosmeticsGroup = "Cosmetic_CauldronPillars01",

-- The in-world asset when the cosmetic is equipped

CosmeticAnimat

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。 Hades II 使用遊戲自帶的 Mod 匯入功能,解壓後的包按 readme 放入指定目錄即可。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

Hell2Modding-Hell2ModdingLuaENVY-ENVYSGG_Modding-ChalkSGG_Modding-ReLoadSGG_Modding-SJSONSGG_Modding-ModUtil

檔案與校驗

檔案名稱
Cosmetics_API-1.1.4.zip
檔案大小
146.7 KiB