Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.
/ AchivementLoader Public archive

A loader of sorts for things of the achievement varitey

License

Notifications You must be signed in to change notification settings

dakkhuza/AchivementLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Riks 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 the .dll from either Thunderstore or from the Releases page and place it into your Bepinex plugins folder.

You'll know it's working if you see this in the output console Image of it working correctly

How to make a Custom Achievement

To make a custom achievement just follow these simple steps.

  1. Add "AchievementLoader" as a dependency to your project
  2. Add a class to your plugin that inherits from BaseAchievement
  3. Decorate your class with the [RegisterAchievement] attribute
  4. Override OnInstall and OnUninstall with whatever you need to check for your challenge
  5. Call Grant() when the criteria is met
  6. (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
    1. Decorate your achievement class with a [CustomUnlockable] attribute
    2. Add tokens to the language file for your challenge in the format ACHIEVEMENT_NAMEINCAPS_NAME and ACHIEVEMENT_NAMEINCAPS_DESCRIPTION

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 wiki

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • I'd like to thank the Harmony devs for making this so straight forward

About

A loader of sorts for things of the achievement varitey

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages