
You are viewing a potentially older version of this package. View Latest Version
AchievementLoader
A loader of sorts of the achievement varietyRiks of Rain 2 Achievement Loader
A loader of sorts of the achievement variety
IMPORTANT
To the EXTENT OF MY KNOWLEDGE this don't corrupt save files when uninstalled.
HOWEVER
You should ALWAYS be safe and BACK UP YOUR SAVES!!
It's better to be safe than sorry!
Installing
Download then drag and drop the "plugins" folder into your bepinex folder
You'll know it's working if you see this in the output console

How to make a Custom Achievement
To make a custom achievement just follow these simple steps.
- Add "AchievementLoader" as a dependency to your project
- Add a class to your plugin that inherits from BaseAchievement
- Decorate your class with the [RegisterAchievement] attribute
- Override OnInstall and OnUninstall with whatever you need to check for your challenge
- Call Grant() when the criteria is met
- (Optionable) If you don't do these, the challenge will still work but text related to it will be broken and it won't unlock anything when completed
- Decorate your achievement class with a [CustomUnlockable] attribute
- Add tokens to the language file for your challenge in the format ACHIEVEMENT_NAMEINCAPS_NAME and ACHIEVEMENT_NAMEINCAPS_DESCRIPTION
- The AssetPlus api makes this easy
Here's an example of what a valid achievement class looks like
[CustomUnlockable("Example.Example", "ACHIEVEMENT_EXAMPLEACHIEVEMENT_DESCRIPTION")]
[RegisterAchievement("ExampleAchievement", "Example.Example", null, null)]
public class ExampleAchievement : BaseAchievement
{
public override void OnInstall()
{
base.OnInstall();
RoR2Application.onUpdate += AutoGrant;
}
public override void OnUninstall()
{
base.OnUninstall();
RoR2Application.onUpdate -= AutoGrant;
}
public void AutoGrant()
{
Grant();
}
}
For more details check out the (WIP) wiki
Changelog
V 2.1.0
Breaking Change(s)
None!
New Feature(s)
Reworked how achievements are registered, old system still works but using the new system supports custom icons.
Added support for custom achievement icons! You can now load in icons using unity bundles and the Asset API
Wiki will be updated soon with more info
V 2.0.0
Breaking Change(s)
Moved all classes relating to making custom achievements from "Dak.AchievementLoader" to "Dak.AchievementLoader.CustomAchievement"
New Feature(s)
Custom achievements can now override vanilla achievements with [OverrideAchievement(TypeOfAchievementToOverride)]
V 1.0.0
Initial release
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Thanks
- I'd like to thank the Harmony devs for writing good docs that don't make me want to commit unalive