Achievements

版本 v1.0.0·更新於 2024-03-26

An API for adding achievements. Includes an achievement browser and a happy little popup whenever you unlock one.

模組介紹 作者原文

Achievements for Kaycee's Mod

This is an Achievement Management API. On its own, it doesn't do much other than allow you to browse the 8 Kaycee's Mod achievements and get a pop-up notification whenever you unlock one of them. The main draw of this API is that other mods can use this to add their own achievements which players can track in a dedicated achievement tracking screen.

The upshot is that you probably won't ever need to install this on by itself. Instead, other mods that want to add achievements will make this one of their dependencies.

This is in beta! Bugs are to be expected. @ me on discord if you need to.

Browsing Achievements

Achievements can be viewed in the Kaycee's Mod section of the game, in a new screen under "UNLOCKS". Browse to UNLOCKS >> ACHIEVEMENTS to browse all currently available achievments.

NOTE: To protect the immersive nature of the default Inscryption experience, only base game achievements specifically for Kaycee's Mod have been made compatible with this API. Achievements related to the main story of Inscryption will not be "unlocked" using the achievement popup and will not be browseable in the Achievements screen.

Achievement Groups

All achievements must belong to an achievement group. Achievements will be displayed as part of their group on the achievement browser screen. All achievements in the same group will share the same "locked" icon and unlock sound. If you don't provide an unlock sound, this API will use a default (see the Credits section for a link to the sound); however, you must provide an unlock icon. All achievement icons must be a 22x22 Texture2D instance.

The unlock sound can either be an instance of AudioClip (most easily loaded through the API's SoundManager class), or it can be the name of a preloaded audio clip. The game loads all clips in the Resources/Audio/SFX folder at launch, so if you've unpacked the game's file you can browse through them and look for an existing audio clip to use - just supply the name of the wav file.

You will need to keep a reference to the ID of the achievement group that was generated for you when you call the NewGroup method. This ID will be used to link the achievements you create to that group.

using Infiniscryption.Achievements;

using InscryptionAPI.Helpers;

using InscryptionAPI.Sound;

// Creating a group with an unlock sound loaded from a wav file

var groupId = ModdedAchievementManager.NewGroup(

"my.plugin.guid", // plugin guid

"Example Achievements", // achievement group name

SoundManager.LoadAudioClip("achievement_default.wav"), // unlock sound

TextureHelper.GetImageAsTexture("achievement_locked.png", typeof(MyPlugin).Assembly) // lock icon

).ID;

// Creating a group with an unlock sound that re-uses an existing game asset

var groupId = ModdedAchievementManager.NewGroup(

"my.plugin.guid", // plugin guid

"Example Achievements", // achievement group name

"VO_yes", // unlock sound - Luke Carder shouting "YES!"

TextureHelper.GetImageAsTexture("achievement_locked.png", typeof(MyPlugin).Assembly) // lock icon

).ID;

// Creating a group without an unlock sound (which uses the default)

var groupId = ModdedAchievementManager.NewGroup(

"my.plugin.guid", // plugin guid

"Example Achievements", // achievement group name

TextureHelper.GetImageAsTexture("achievement_locked.png", typeof(MyPlugin).Assembly) // lock icon

).ID;

Achievements

Once you have created an achievement group, you can start creating new achievements. Each achievement needs a name, a description, an icon, and an indicator as to whether or not it is a "secret" (secret achievements will not display their description on the achievement screen until they have been unlocked).

As with the locked icon, the achievement icon must be a 22x22 Texture2D instance.

You will need to keep a reference to the achievement IDs that were created for you so you can write code to unlock them later:

using Infiniscryption.Achievements;

using InscryptionAPI.Helpers;

internal static Achi

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

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

BepInEx-BepInExPack_InscryptionAPI_dev-API

檔案與校驗

檔案名稱
Achievements-1.0.0.zip
檔案大小
543.6 KiB