Achievements

v1.0.0·Updated 2024-03-26

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

About this mod Author’s original text

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

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack_InscryptionAPI_dev-API

File & checksum

Filename
Achievements-1.0.0.zip
File size
543.6 KiB