Achievements System

Resource Achievements System v1.0

Mega Mewthree

Pokémon: The World Remade Creator (In Development)
Member
Posts
3
#1

sprout

Rookie
Member
Posts
2
#2
I get this error after taking a single step in a fresh install of Essentials (I'm using v16.2). I put each script exactly where instructed.


Exception: NoMethodError

Message: undefined method `[]' for nil:NilClass

Achievements_Script:140:in `setProgress'

Achievements_Update:26

Achievements_Update:24:in `call'

Event:54:in `trigger'

Event:49:in `each'

Event:49:in `trigger'

PField_Field:1392:in `pbOnStepTaken'

Game_Player:484:in `update_old'

Walk_Run:76:in `follow_update'

EDIT: I realize this error should technically occur, but it seems inconvinient to have to save immediately in order to play. Is there any way to avoid this error? Thanks.
 
Last edited:

Wiispeed03

Novice
Member
Posts
24
#3
Hey, I know this is old, but I really love this system, and I just thought I would add a few enhancements I made and show them off here for anyone to use.
I wanted to add rewards after each level of the achievement was completed. You start out by adding this:
Code:
"POKEMON_CAUGHT"=>{
      "id"=>2,
      "name"=>"Gotta Catch 'Em All",
      "description"=>"Catch Pokémon. Reward: Pokeballs",
      "goals"=>[50,150,500],
      "rewards"=>["QUICKBALL","ULTRABALL","MASTERBALL"],     #Add this line
      "rewardamount"=>[20,50,1]                              #Add this line
    },
Then you just simply add this in def self.checkIfLevelUp(name):
Code:
if level>$achievements[name]["level"]
          $achievements[name]["level"]=level
          self.queueMessage(_INTL("Achievement Reached!\n{1} Level {2}",@achievementList[name]["name"],level.to_s))
          pbWait(10)                                                                                                           #Add this line
          Kernel.pbReceiveItem(@achievementList[name]["rewards"][level-1],@achievementList[name]["rewardamount"][level-1])     #Add this line
          return true
        else
          return false
        end
This isn't really a big deal or anything, and it could definitely be improved upon, but I hope it's useful to anybody wanting an achievement system in their game!

(Also still haven't figured out how to fix that error that constantly happens every save file, so if anybody has a solution to that, let me know!)
 
Top