SMO_Valadorn

Villager
Member
Joined
Aug 31, 2019
Messages
28
Reaction score
51
First Language
Portuguese
Primarily Uses
RMMV
Hi, @ravenhood. I have this two problems exactly too.
The progress bar don't unlocked and only displaying 99% I resolved it turn "Global" in "Local".
EDIT: I Resolved it already! The error was in Global because I don't have a Achievements.json empty file in the data folder. I read the plugin help and I found my error. You only need if turn it in global, create an empty file "Achievements.json" in the data folder and solved!

I want to ask too how resolve the second trouble about plugins of Yanfly (Message Core and the other ones, not only Mess.Pack1, also EvalText and Macros). Don't look to be compatible... Hope that SMO_Valadorn can help us. This is a very amazing plugin! :D MerryXMas! And sorry for the bad english, is not my first language.
I'm working on a way to create the json file automatically in case it doesn't exist.
I added compatybility with YEP_MessageCore, it'll surely be on the next version but I'll need to take a look at EvalText and Macros.

Happy holidays everyone!:kaoluv:
 

Marianna

Queen of wolves
Member
Joined
Sep 2, 2018
Messages
26
Reaction score
13
First Language
Spanish
Primarily Uses
RMMV
I'm working on a way to create the json file automatically in case it doesn't exist.
I added compatybility with YEP_MessageCore, it'll surely be on the next version but I'll need to take a look at EvalText and Macros.

Happy holidays everyone!:kaoluv:

Oh, really? That's wonderful! I will waiting for this! I really love this plugin. I think is the most complete plugin about achievements, with a lot of cool functions. So... I will waiting for the next update! Because I need YEP_MessageCore and others, but I don't want to say good bye to this one either. Thank you very much for your fast reply @SMO_Valadorn, and thanks too for @ShadowDragon. :D
 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMVXA
For some reason I can't fathom, I can't get achievements to be "remembered", even though I have 'Global' enabled.

Here's what I've done:

1) I created a blank text file named Achievements.json in my data folder (0kb).

2) Played my game and unlocked a couple of achievements. Checked and they showed up in the achievements screen as unlocked correctly.

3) Exited the game. Restarted it and checked the achievements screen... no achievements had been unlocked!

4) I checked the Achievements.json file and it was now 1kb with a string of letters and numbers as the contents when opened in a text editor (encrypted achievements, presumably).

I have fiddled with this for hours and still can't figure out what is causing achievements to reset when the game is exited.

Any help from anyone at all is GREATLY appreciated!

Strangely, it seems to work when I use "test play" but NOT when I run game.exe normally (that is, it "remembers" any achievements earned during test play but never those from normal run or created deployment). I checked and Achievements.json gets written to during test play but not when the game is run via game.exe (tested with a fresh file each time, and only with test play did the file get text written to it and its size increase).
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,445
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
@Banjo if you deploy the game and test it, and work, do you exacly "save"
the game and continue? or save and new game (not continue).

if you do continue from save file and not unlocked, it is strange indeed.
I didn't test the deployment part yet, so I cannot tell though for sure.
 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMVXA
@ShadowDragon
Saving or loading doesn't make a difference. Whenever I run the game from a deployed version or from the source folder using Game.exe (i.e. with RPG Maker MV not first running), the achievements don't save to Achievements.json when I unlock one. If I play in "test mode", any achievements unlocked save, and will be visible no matter how I start the game.

SOLUTION!
One of my awesome beta playtesters found the bug!

It seems to be a path issue, and changing:
Code:
SMO.AM.saveGlobalAchievements = function() {
    var achievs = JSON.stringify(SMO.AM.GlobalAchievements);
    var fs, path;
    fs = require('fs');
    path = 'data/Achievements.json';
    if (fs.existsSync(path)) {
        achievs = btoa(achievs);
        achievs = 'S' + achievs;
        fs.writeFileSync(path, achievs);
    }
}
to:
Code:
SMO.AM.saveGlobalAchievements = function() {
    var achievs = JSON.stringify(SMO.AM.GlobalAchievements);
    var fs, path;
    fs = require('fs');
    path = 'www/data/Achievements.json';
    if (fs.existsSync(path)) {
        achievs = btoa(achievs);
        achievs = 'S' + achievs;
        fs.writeFileSync(path, achievs);
    }
}
... makes achievements save properly now when the game is run via Game.exe (deployed or source).

the "www/" was needed because deployed versions (and the source folder too) put the game in a subfolder "www" below Game.exe. Presumably test run within RPGMMV doesn't check and runs the game straight from the "www" folder, hence why it worked.

The downside of fixing this is that achievements now *don't* save when the game is run from test mode, but in some ways I prefer this as I don't have to keep resetting achievements every time I test the game. IMO, this is preferred functionality (i.e. achievements don't persist after you exit test mode but do when playing normally).

If the dev implements a "better" fix that makes it work in both situations, I don't mind, but I'm happy with the edit I made for now.

Attached is the edited version of the plugin; only the changelog and above line was altered from 1.03. I labled it as 1.03b to avoid conflicting with future official updates.

This really is an awesome plugin, incidentally! :)
 

Attachments

  • SMO_Achievements.js
    181.5 KB · Views: 4

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,445
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
when the update comes, the save is re-coded differently.
so it works better :) but nice catch though ^^
 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMVXA
Thanks! Glad to know it will be fixed.

I just needed to fix my own game ASAP as testers were freaking out about achievements not saving! I thought about making it so both test mode and deployed mode works (i.e. recode the whole save function), but decided to stick with "only deployed mode saves" for reasons explained in my post above.

Will swap out my edited version for the official 1.04 when it comes, though.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,445
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
I think it will be higher, but I would recommend BEFORE you swap, what things are
changed, while the GUI will be there as well, so check first, because some things
might be changed or differently, or backup the game before adding, to see
if everything still works the way you set it up :)
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
371
Reaction score
104
I like how it looks like genshin impact.. Is it possible the rewards are claimed in the scene and not auto added to inventory? Also, is it possible to have rewards that increase variable or EXP, i did not find example in the demo.. i dont know how to use the Custom(Advanced)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,445
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
@xabileug it might be possible to claim the rewards if you combine it
with eventhing, like turning on the switch, and a npc somewhere, to
claim it when the switch is on.

you can add exp, not sure about increasing variables, but is possible
with a bit eventing on it.

while there is a tiny bug fixed on his side, but not updated, I know he
is busy and redo some parts to get the GUI working to make them.

I also know he is also busy on some other things, so I dont know how
high prioritize this plugin, where some things are fixed and added,
so maybe he take this feature in it as well, as well as the saving
problem that will be fixed there.

I hope he is doing well, it's been a while he is online.
 

SMO_Valadorn

Villager
Member
Joined
Aug 31, 2019
Messages
28
Reaction score
51
First Language
Portuguese
Primarily Uses
RMMV
Hi everyone!

@DarkSearinox92 Don't worry I'm still working on this plugin and recently got more time to work on it, I'm currently working on the editor of achievements to make the achievements' creation more user friendly, it also adds options to edit the menu.

@xabileug Claiming rewards is a mechanic that I've already considered and I'm gonna add it on the next update (it'll be an optional mechanic), I just need to finish the achievements' editor first but currently you can use the advanced option to increase a variable and add EXP to your actors, you just need to choose the "Custom(Advanced)" type and write the script on the "Advanced" field, I'll give you some examples of scripts:

var value = 1; var variableId = 10; var newValue = $gameVariables.value(variableId) + value; $gameVariables.setValue(variableId, newValue);
The code above will add 1 to the variable 10.

Adding 50 exp to the actor 2: $gameActors.actor(2).gainExp(50);

Adding 20 exp to the party leader: $gameParty.leader().gainExp(20);

I'll try and make it simpler to do with the editor, I'm just not sure yet when it'll come out :kaodes:

@ShadowDragon Yo, good to see you SD! I'm great, thanks, I hope your are doing well too! :biggrin:

Bye everyone! :kaoluv:
 

SMO_Valadorn

Villager
Member
Joined
Aug 31, 2019
Messages
28
Reaction score
51
First Language
Portuguese
Primarily Uses
RMMV
Yo! How are you guys doing?
SMO_Achievements.js v1.04 is out! Though I think I should call it v2.0 because I changed it a lot... Anyways, here are some of the new stuff:
  • Added the ACHIEVENATOR, which includes an editor for the achievements, for the menu and for the categories;
  • Added option to collect the reward manually, check out the "Collect Reward" parameter;
  • Rewards are now optional, check out the "Use Rewards" parameter;
  • You can now reveal secret and hidden achievements before the player unlocks it or turn other achievements into secret/hidden ones, take a look at the new script calls (10-14);
  • Compatibility with YEP_MessageCore and some translation plugins: SRD_TranslationEngine, KDTools_Localization and Iavra Localization - Core;
  • Necessary files are automatically created, "data/Achievements.json" is now on "save/achievs.rpgsave", the old data is automatically imported and the old file deleted;
  • Auto-refresh after transfer is now optional, check out the "Refresh After Transfer" parameter;
  • Fixed error where achievements unlocked on global mode were not being saved on deployed projects;

Please, leave a message if you find any bug or if you have any sugestion, I'll try not to take another year for the next version haha:kaoblush:


Cheers everyone! :kaoluv:
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,969
Reaction score
4,553
First Language
English
Primarily Uses
RMMZ
Yo! How are you guys doing?
SMO_Achievements.js v1.04 is out! Though I think I should call it v2.0 because I changed it a lot... Anyways, here are some of the new stuff:
  • Added the ACHIEVENATOR, which includes an editor for the achievements, for the menu and for the categories;
  • Added option to collect the reward manually, check out the "Collect Reward" parameter;
  • Rewards are now optional, check out the "Use Rewards" parameter;
  • You can now reveal secret and hidden achievements before the player unlocks it or turn other achievements into secret/hidden ones, take a look at the new script calls (10-14);
  • Compatibility with YEP_MessageCore and some translation plugins: SRD_TranslationEngine, KDTools_Localization and Iavra Localization - Core;
  • Necessary files are automatically created, "data/Achievements.json" is now on "save/achievs.rpgsave", the old data is automatically imported and the old file deleted;
  • Auto-refresh after transfer is now optional, check out the "Refresh After Transfer" parameter;
  • Fixed error where achievements unlocked on global mode were not being saved on deployed projects;

Please, leave a message if you find any bug or if you have any sugestion, I'll try not to take another year for the next version haha:kaoblush:


Cheers everyone! :kaoluv:
One thing I'll warn you about that someone pointed out to me before (not sure if it's still the case): apparently require('fs') doesn't work in deployed projects because it's an nwjs feature and deployment doesn't support anything that's nwjs-exclusive.

Edit: looks like you only use that in things that will only be used in test play anyway, so it's a moot point.
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
371
Reaction score
104
thank you so much! so exciting!

done with the demo! i like it a lot.. the smooth window appearance like its tween.. the reward claim indicator, manual collect reward!
1642546229835.png
1642546508406.png
 
Last edited:

SMO_Valadorn

Villager
Member
Joined
Aug 31, 2019
Messages
28
Reaction score
51
First Language
Portuguese
Primarily Uses
RMMV
One thing I'll warn you about that someone pointed out to me before (not sure if it's still the case): apparently require('fs') doesn't work in deployed projects because it's an nwjs feature and deployment doesn't support anything that's nwjs-exclusive.

Edit: looks like you only use that in things that will only be used in test play anyway, so it's a moot point.
Actually, it works on deployed projects too, RPGMaker MV's StoreManager uses require('fs') to save and load files, but it doesn't work on browser, then you'd need to call the localStorage.
The old bug where you couldn't save global achievements on deployed projects was related to the fact that, on deployed projects, the main folders are placed inside another folder, called www, all I needed to do to fix that was copy the function StorageManager.localFileDirectoryPath (which works for the save folder) and use it to get the data folder.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,969
Reaction score
4,553
First Language
English
Primarily Uses
RMMZ
Actually, it works on deployed projects too, RPGMaker MV's StoreManager uses require('fs') to save and load files, but it doesn't work on browser, then you'd need to call the localStorage.
The old bug where you couldn't save global achievements on deployed projects was related to the fact that, on deployed projects, the main folders are placed inside another folder, called www, all I needed to do to fix that was copy the function StorageManager.localFileDirectoryPath (which works for the save folder) and use it to get the data folder.
Ah, good to know! I had no intention of making any of my projects available on browser, so turns out I've been given erroneous advice. XD
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,445
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
making errors, just make you human after all :)
but I hope the people love this achievement system and got trouble
before, are happy on this release and have the patience untill it's
release to use it alot :)

the nice thing as well is that you can move the windows to make it
how you see fit :)

Well done SMO for the amazing achievement update =)
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi, I'm a new and upcoming Indie Developer, and I could really use some help when it comes to system programming. Explorers can only go so far before needing a map, you know?
I made a comic strip with the characters of my game.Flor en la cola eng.jpg
Hey, what does it mean in settings, privacy, where it says allow users to: view your identities??????????
I have returned yet again. No reason for my hiatus; just got distracted by video games and stuff. I figured out how to make a bootleg Ys 1 Battle system using in engine scripting (The only plugin enabled is the HUD thing).
Unfortunately I have no idea how to program but-stabbing as a crit without it being even more complicated to program so this is it.

Kickstarter successful!! I'm gonna have a Hot GameDev Summer in the trenches!

Forum statistics

Threads
122,050
Messages
1,146,128
Members
160,320
Latest member
BraveHeartBrony
Top