Achievements Plugin

Achievements Plugin v1.4
By Winthorp Darkrites/WinterDream Games Creator​

This plugin allows you to add Achievements to your game. Those Achievements will be stored in a JSON and will be shared among all plays and savegames of your project

Be sure to have installed the .js file in the js/plugins folder of your project and the .JSON file in the data folder of your project.

If at any time you want to wipe your achievements data, just open the JSON and write []



PRO TIP: As the Achievments changes are PERMANENT it's useful to keep a hidden event in that adds all the achievements, once you are ready to distribute your game you can whipe and re-add the achievements to reset them.





This plugin comes with the following features:

  • Pictures or Icons: You can use pictures (48x48 px) or RMMZ icons for your achievements
  • AutoGray Feature (only pictures): If you use pictures and you enable Autogray, the plugin will turn pictures to grayscale if the achievement is locked
  • Fulfillments: You can add up to 3 fulfillments per Achievement and you can decide how every each of them is displayed (text, gauge or combination of both). If ALL active fulfillments are met, the plugin will auto-unlock the achievement
  • Hidden achievements: You can set Achievements to "Hidden", they will use a standard format and will hide fulfillments and rewards in the menu
  • PopUp Window: You can choose to show a popUp message when the achievement is unlocked, it can also play a Sound Effect when popping. PopUp window have a built in queque and will display multiple unlocked achievements one by one
  • JSON Auto-Encryption: The plugin offer the option to soft encrypt the JSON file, it's nothing a programmer can't decrypt but it should stop average users from just changing "false" with "true" in the isDone field
CALLING THE PLUGIN FROM EXTERNAL SOURCES:
The achievement completion can be also called from outside the plugin, for example you could call it from the Title Screen if you want to create a "Start the game" achievement! To do so, just write the script call: window.WD_Interplugin_Achievements.complete(id);
Where "id" is the ID of the achievement!
Please make sure the database is ready and plugins are loaded before the external script call commence.

KNOWN COMPATIBILY ISSUES:
  • VisuStella Core: Error when you use "Battle Test" in the editor, for some reason with VisuStella it searches for Test_WD_Achievements.json in the data folder (only for Battle Test). Simply create a dummy file with that name and you are good to go
Terms of use

Please refer to the Terms of Use. By using this plugin you accept WinterDream terms

Version, bugs and further development

VERSION 1.0:
  • Initial Release
VERSION 1.1:
  • Hotfix for a problem reported by Rizky Fauzy Ananda. The save/load feature of the JSON would crash on web distribution. Added a check to control if the game is played on a local machine and added a new save/load method by key foraging in the event the game is a web distribution. Thanks to Aerosys and caethyril for the help with this fix!
VERSION 1.2:
  • Added two Quality of Life plugin commands: Re-Hide an achievement (useful if you manually de-hidden an achievement) and Reset all Achievements to Not Done, you can simply hit this command to undo all achievements, hopefully this will speed up the pre-distribution process of your project
VERSION 1.2.1:
  • Fixed a minor bug in the data load that shouldn't have caused any issues anyway
  • Removed a couple of dead variables that were implemented but never used

VERSION 1.3:
  • Fixed pictures misplacements if using a different Screen vs UI resolution
  • Investigated the possible issue of teleporting to another map while popping the achievement complete window, no issues have been recorded
  • Investigated the possible issue of changing scene (menu, save, game over, title screen) while achievement windows is popping. No fatal error, but it would be better to avoid such simultaneous events or the pop window might be lost
  • Investigated the possible issue about giving out rewards while not in the game. The game will IGNORE all the rewards, there is no way to recover them. That said, popping an achievement outside the game need the special external script call to be doable. So shame on you if you pop a rewarding achievement outside the game!
  • Added a script call to run the "Complete Achievement" command outside the plugin (see instructions in the description). Be sure to have the database and plugins ready before doing so.
VERSION 1.4:

  • Fixed a problem that would save achievements in both format (encrypted and clear) if the dev switched Encryption flag while adding them, this would result in a fatal crash once the plugin tries to load the JSON with both encrypted and clear data. The new load method now prevents another fatal crash that would happen when adding an achievement right after wiping the JSON. Thanks to F.O.X. Development for the report.
  • Changed the sprite generation function for the achievements pictures, now they anchor to the windows instead of the scene, this should solve once for all the misplacement bug when the UI resolution is different from screen resolution. Plus it should avoid conflict with other plugins that manipulate the windows behaviour (but this is something I can only guarantee to an extent)

Future released will aim to allow text translation and more automation


Download

It can be downloaded for free on Itch
VERSION 1.1 is out:

  • Hotfix for a problem reported by Rizky Fauzy Ananda. The save/load feature of the JSON would crash on web distribution. Added a check to control if the game is played on a local machine and added a new save/load method by key foraging in the event the game is a web distribution. Thanks to Aerosys and caethyril for the help with this fix!

Edit: about 20 minutes after this post I re-uploaded the file for a minor tweak, if anyone has downloaded the plugin right away after the v1.1 announcement please re-download it has it might lead to a crash
Wow! I just checked out your Itchi.io page and started following you. Your plugins look very nice.

I haven't really experimented with any plugins other than a couple that come with MZ. But part of my goals for 2024 is to actually invest time in learning what plugins are available and what they do.

I will definitely be checking yours out.

Thanks for your hard work!
Wow! I just checked out your Itchi.io page and started following you. Your plugins look very nice.

I haven't really experimented with any plugins other than a couple that come with MZ. But part of my goals for 2024 is to actually invest time in learning what plugins are available and what they do.

I will definitely be checking yours out.

Thanks for your hard work!

Thanks, much appreciated ^-^
VERSION 1.2 is out:
  • Added two Quality of Life plugin commands: Re-Hide an achievement (useful if you manually de-hidden an achievement) and Reset all Achievements to Not Done, you can simply hit this command to undo all achievements, hopefully this will speed up the pre-distribution process of your project
Achievements Plugin v1.2
By Winthorp Darkrites​

This plugin allows you to add Achievements to your game. Those Achievements will be stored in a JSON and will be shared among all plays and savegames of your project

Be sure to have installed the .js file in the js/plugins folder of your project and the .JSON file in the data folder of your project.

If at any time you want to wipe your achievements data, just open the JSON and write []



PRO TIP: As the Achievments changes are PERMANENT it's useful to keep a hidden event in that adds all the achievements, once you are ready to distribute your game you can whipe and re-add the achievements to reset them.





This plugin comes with the following features:

  • Pictures or Icons: You can use pictures (48x48 px) or RMMZ icons for your achievements
  • AutoGray Feature (only pictures): If you use pictures and you enable Autogray, the plugin will turn pictures to grayscale if the achievement is locked
  • Fulfillments: You can add up to 3 fulfillments per Achievement and you can decide how every each of them is displayed (text, gauge or combination of both). If ALL active fulfillments are met, the plugin will auto-unlock the achievement
  • Hidden achievements: You can set Achievements to "Hidden", they will use a standard format and will hide fulfillments and rewards in the menu
  • PopUp Window: You can choose to show a popUp message when the achievement is unlocked, it can also play a Sound Effect when popping. PopUp window have a built in queque and will display multiple unlocked achievements one by one
  • JSON Auto-Encryption: The plugin offer the option to soft encrypt the JSON file, it's nothing a programmer can't decrypt but it should stop average users from just changing "false" with "true" in the isDone field
Terms of use

Please refer to the Terms of Use. By using this plugin you accept WinterDream terms

Version, bugs and further development

VERSION 1.0:
  • Initial Release
VERSION 1.1:
  • Hotfix for a problem reported by Rizky Fauzy Ananda. The save/load feature of the JSON would crash on web distribution. Added a check to control if the game is played on a local machine and added a new save/load method by key foraging in the event the game is a web distribution. Thanks to Aerosys and caethyril for the help with this fix!
VERSION 1.2:
  • Added two Quality of Life plugin commands: Re-Hide an achievement (useful if you manually de-hidden an achievement) and Reset all Achievements to Not Done, you can simply hit this command to undo all achievements, hopefully this will speed up the pre-distribution process of your project

POSSIBLE ISSUES V1.2:
  • Rewards achievements should be unlockable only in game, not in external menu (Ex: Title Screen), didn't have the time to test what happens but I'm pretty sure an error will be thrown
  • PopUp work fine in game, didn't have the time to test what happens if the player changes scene while it's still popping
Future released will aim to investigate the above issues, allow text translation and more automation


Download

It can be downloaded for free on Itch

I love this plugin but i can't use it with visual stella sadly 🙁
I love this plugin but i can't use it with visual stella sadly 🙁

Can you provide more informations on the conflict? This plugin operates on his own (except for the title menu where there is a compatibility option to enable) so it's stange that it doesn't work with another plugin
This is awesome! Thank you so much

@Winthorp do you mind assisting me with using this plugin? Not sure how to go about creating the achievements?
@Winthorp do you mind assisting me with using this plugin? Not sure how to go about creating the achievements?

Sure, no problem!
My advice is to decide beforehand if you want to use encryption or not and set it into the Plugin Parameters, it's the most critical, everything else can be decided later

To add the Achievements create a temporary event in your game and use the "Add Achievement" plugin command, run a test game and run the event. The plugin will register the achievements in the JSON and they will be permanently added to the game (unless you wipe the JSON)

My advice is to keep a secret map during game development with a single event that adds all the achivements you need 🙂
Sure, no problem!
My advice is to decide beforehand if you want to use encryption or not and set it into the Plugin Parameters, it's the most critical, everything else can be decided later

To add the Achievements create a temporary event in your game and use the "Add Achievement" plugin command, run a test game and run the event. The plugin will register the achievements in the JSON and they will be permanently added to the game (unless you wipe the JSON)

My advice is to keep a secret map during game development with a single event that adds all the achivements you need 🙂
OK I see so but where would i set the requirements for the achievement?
OK I see so but where would i set the requirements for the achievement?

If you want to set visible requirements you can use the "fulfillment" section of the "add achievement" command and then the "change fulfillment" plugin command.

Otherwise you can simply mark as done an achievement at a certain point / event of the campaign
I see thank you. Is there a option to enable a achievements option the party menu?
I see thank you. Is there a option to enable a achievements option the party menu?

If you mean in the game menu, yes, it's in the plugin parameters 🙂
Awesome thank you I found it. Didnt realise it was called a command. Thank you im all set!

Ok made an achievement, set it up but its not triggering? Am I doing something wrong?

I made a basic event that gives an achievement with the event touch trigger. But when the player runs over the tile, nothing triggers?

◆Plugin Command:WD_Achievements, Add an Achievement
: :ID = 0
: :Achievement Pictures = {"unlockPic":"","lockPic":"","hidden…
: :Achievement Icons = {"unlockIco":"84","lockIco":"0","hidden…
: :Achievement Titles = {"unlockSmallT":"Welcome!","lockSmallT…
: :Achievement Descriptions = {"unlockSmallD":"Thank you for p…
: :Achievement Fulfillment = {"achiFulfill1":"{\"isActive\":\"…
: :Achievement Rewards = {"achiExpRew":"[]","achiGoldRew":"[]"…
: :is Hidden? = false
"Add Achievement" is a developer command, i just adds the Achievement to the list

You should be able to see it in the Achivement menu once the event has been activated

To trigger (complete) the achievement you need to use "Complete Achievement" plugin command 🙂

Remember that "Add an Achivement" doesn't need to be triggered at each play, is permanent, you can do it in a test play and it will be permanent
Double-post notice: @VamperiX I’ve merged them all together but there were multiple instances in this thread.
Aha! Thank you got it! Thank you for everything

@Winthorp Alright so I made the event add and trigger the complete achievement. Now unless I misunderstood the explanation, must i remove the add achievement command event as its already saved in the JSON file?

The achievement triggered and all working btw, thank you 🙂

@Ms Littlefish I will make sure to edit instead of more posting. Sorry about that.
Compatibility issue reported by Rijj Gacria:
  • VisuStella Core: Error when you use "Battle Test" in the editor, for some reason with VisuStella it searches for Test_WD_Achievements.json in the data folder (only for Battle Test). Simply create a dummy file with that name and you are good to go
While working on a new plugin I spotted a couple of minor issues in this one! Nothing that really impacts the workflow but here it is!

VERSION 1.2.1:
  • Fixed a minor bug in the data load that shouldn't have caused any issues anyway
  • Removed a couple of dead variables that were implemented but never used
Hi im having a little trouble, when i use this on a 1280x720 project the tiny images look like this:
¿How can a fix it?
capturada.jpg

Original thread: https://forums.rpgmakerweb.com/threads/achievements-plugin.164134/