• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Resource Mega MewThree's Achievement System for v21.1 v1.1

hostman

Trainer
Member
Joined
Aug 24, 2023
Posts
70
nice, do you know how it could be done with persistent switches?
 

Gardenette

Cooltrainer
Member
Joined
May 30, 2022
Posts
156
nice, do you know how it could be done with persistent switches?
Well for it to work with that script, you would need to keep the save files that have the achievements completed.
If you start over with no save files at all, it wouldn't work since the plugin searches other save files.

If you mean like from a coding perspective how would it look, I don't remember the syntax off the top of my head.
 

Gardenette

Cooltrainer
Member
Joined
May 30, 2022
Posts
156
@Frooziemon per your question in the the reviews -
"If you put this script above the v20.1 Essentials Hotfixes, or if you have the hotfixes as a plugin, this will overwrite the method for selling items, and selling items will not be counted towards achievements. I just copied the code from the hotfix and modified it to add to the achievement count. The def pbSellScreen in the Misc Bug Fixes script for hotfix 1.0.7 can be removed."

I know you wanted an explanation, but it might be easier if you state whether you're having issues with it and then me trying to explain if I need to.
When you sell things at the mart, does it progress your achievement for selling items?
 

mindbender12

Novice
Member
Joined
Jan 15, 2022
Posts
45
It doesn't disrupt the gameplay, but the background doesn't appear, making the design look a bit ugly. I don't understand programming much, but I've tried various possible modifications that don't change the result, and it works fine in v20, so it must be something that changed in v21. I'm investigating what it could be, but, as I mentioned, I'm not very skilled at this

View attachment 22077
How did you set it up to have a achievement based on a switch?
 

rafahbit

Novice
Member
Joined
Oct 21, 2020
Posts
42
How did you set it up to have a achievement based on a switch?

I will give an example of my project. I added the achievements "charms progress", where there are goals to achieve, being [5,10,15,20,25,30, and every time I added a charm, I called the script: Achievements.incrementProgress("CHARMS_PROGRESS", 1) , where I said which achievement it was supposed to increase and its value to be added.

to add the achievement, under the nuzlock achievement in Achievement_Module, I did:

"CHARMS_PROGRESS"=>{
"id"=>15,
"name"=>"Enchanted Amulets",
"description"=>"Every charm Unveiled",
"goals"=>[5,10,15,20,25,30]
}

So, if you want the player to gain an achievement when they activate a switch, in fact just put :Achievements.incrementProgress("achievement here", 1) where you want, without needing to spend a switch for it, it can be in a conditional branch for example.

You can customize your achievements within the game, for example the mega evolution, I'm working on the script to add a count for every time you use dynamax, gigantamax, z move and terastalization, but I didn't have much time to do this.
 

rafahbit

Novice
Member
Joined
Oct 21, 2020
Posts
42
I modified Achievement_Triggers a little so that I could identify the use of: Dynamax, gigantamax, terastal and z-moves from the Deluxe battle kit plugins
but it is necessary to add the respective achievements to be updated by the modifications in the Achievement_Module, they are:

Don't forget to put the order corresponding to your script, the description and goals are just examples, do as you wish.

Ruby:
"DYNAMAXING"=>{
    "id"=>16,
    "name"=>"Dynamax Expert",
    "description"=>"Dynamaxing Pokémon",
    "goals"=>[1,10,50,100,300]
    },
  "GIGANTAMAXING"=>{
    "id"=>17,
    "name"=>"Gigantamax Expert",
    "description"=>"Gigantamaxing Pokémon",
    "goals"=>[1,10,50,100,300]
    },
 "ZMOVE"=>{
    "id"=>18,
    "name"=>"Z-move Expert",
    "description"=>"zmove",
    "goals"=>[1,10,25,50,100,200]
    },
"ULTRA"=>{
    "id"=>19,
    "name"=>"Ultra Expert",
    "description"=>"Ultra",
    "goals"=>[1,10,25,50,100,200]
    },
 "TERASTAL"=>{
    "id"=>20,
    "name"=>"Terastal Expert",
    "description"=>"terastal",
    "goals"=>[1,10,25,50,100,200]
    }
  }

Z-MOVE:
in Achievement Triggers, in the class Battle::Battler, where it says " alias achieve_pbUseMove pbUseMove" replace with:
Ruby:
alias achieve_pbUseMove pbUseMove
  def pbUseMove(*args)
    achieve_pbUseMove(*args)
    if @lastMoveUsedIsZMove && @battle.pbOwnedByPlayer?(self.index)
      Achievements.incrementProgress("ZMOVE", 1)
  else
      Achievements.incrementProgress("MOVES_USED", 1)

    end
  end
end

This will make the system recognize the use of Z-move or not.

for Dynamax, Gigantamax and Terastal, in class Battle, place:
Ruby:
alias tera_pbTerastallize pbTerastallize
  def pbTerastallize(idxBattler)
    tera_pbTerastallize(idxBattler)
    battler = @battlers[idxBattler]
    if battler.pbOwnedByPlayer?
      Achievements.incrementProgress("TERASTAL", 1)
    end
  end


  alias achieve_pbDynamax pbDynamax

  def pbDynamax(index, *args)
    achieve_pbDynamax(index, *args)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].gmax?
      Achievements.incrementProgress("GIGANTAMAXING", 1)
    else
      Achievements.incrementProgress("DYNAMAXING", 1)
    end
  end
alias achieve_pbUltraBurst pbUltraBurst
  def pbUltraBurst(index)
    achieve_pbUltraBurst(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].ultra?
      Achievements.incrementProgress("ULTRA", 1)
    end
  end
 
Last edited:

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
100
I'm looking to make achievements for a few things if someone can help me

Looking to implement the following:

Lifetime money earned.
Lifetime Coins earned.
$game_variables[94] reaching a certain number
the sum of a bunch of variables being a certain number.
 

Thomwell

Novice
Member
Joined
Mar 8, 2024
Posts
24
Wow, your plugin is really amazing. It has brought me a lot of fun in game creation. May I ask the author, is there a reward mechanism for this achievement system? Will players be rewarded if they complete their achievements? For example, money, props, Pok é mon, and so on. I think doing so will attract players more to complete this gameplay operation.
 

Thomwell

Novice
Member
Joined
Mar 8, 2024
Posts
24
I modified Achievement_Triggers a little so that it could identify the use of: Dynamax, gigantamax, terastal and z-moves.
but it is necessary to add the respective achievements to be updated by the modifications in the Achievement_Module, they are:

Don't forget to put the order corresponding to your script, the description and goals are just examples, do as you wish.

Ruby:
"DYNAMAXING"=>{
    "id"=>16,
    "name"=>"Dynamax Expert",
    "description"=>"Dynamaxing Pokémon",
    "goals"=>[1,10,50,100,300]
    },
  "GIGANTAMAXING"=>{
    "id"=>17,
    "name"=>"Gigantamax Expert",
    "description"=>"Gigantamaxing Pokémon",
    "goals"=>[1,10,50,100,300]
    },
 "ZMOVE"=>{
    "id"=>18,
    "name"=>"Z-move Expert",
    "description"=>"zmove",
    "goals"=>[1,10,25,50,100,200]
    },
"ULTRA"=>{
    "id"=>19,
    "name"=>"Ultra Expert",
    "description"=>"Ultra",
    "goals"=>[1,10,25,50,100,200]
    },
 "TERASTAL"=>{
    "id"=>20,
    "name"=>"Terastal Expert",
    "description"=>"terastal",
    "goals"=>[1,10,25,50,100,200]
    }
  }

Z-MOVE:
in Achievement Triggers, in the class Battle::Battler, where it says " alias achieve_pbUseMove pbUseMove" replace with:
Ruby:
alias achieve_pbUseMove pbUseMove
  def pbUseMove(*args)
    achieve_pbUseMove(*args)
    if @lastMoveUsedIsZMove && @battle.pbOwnedByPlayer?(self.index)
      Achievements.incrementProgress("ZMOVE", 1)
  else
      Achievements.incrementProgress("MOVES_USED", 1)

    end
  end
end

This will make the system recognize the use of Z-move or not.

for Dynamax, Gigantamax and Terastal, in class Battle, place:
Ruby:
alias tera_pbTerastallize pbTerastallize
  def pbTerastallize(idxBattler)
    tera_pbTerastallize(idxBattler)
    battler = @battlers[idxBattler]
    if battler.pbOwnedByPlayer?
      Achievements.incrementProgress("TERASTAL", 1)
    end
  end


  alias achieve_pbDynamax pbDynamax

  def pbDynamax(index, *args)
    achieve_pbDynamax(index, *args)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].gmax?
      Achievements.incrementProgress("GIGANTAMAXING", 1)
    else
      Achievements.incrementProgress("DYNAMAXING", 1)
    end
  end
alias achieve_pbUltraBurst pbUltraBurst
  def pbUltraBurst(index)
    achieve_pbUltraBurst(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].ultra?
      Achievements.incrementProgress("ULTRA", 1)
    end
  end
Hello, I followed your instructions, but there was a problem. I don't understand Ruby very well, and I don't know where I went wrong. Thank you for your guidance.
 

Attachments

  • 001.png
    001.png
    17.9 KB · Views: 11

rafahbit

Novice
Member
Joined
Oct 21, 2020
Posts
42
Hello, I followed your instructions, but there was a problem. I don't understand Ruby very well, and I don't know where I went wrong. Thank you for your guidance.
Are you using the Deluxe battle kit plugins?
because the error says that it did not find "terastallize" in the existing scripts, you need to have the dbk terastal plugin for this, the same for dynamax and zmove, I think I didn't include this information when I posted XD
 

Thomwell

Novice
Member
Joined
Mar 8, 2024
Posts
24
Are you using the Deluxe battle kit plugins?
because the error says that it did not find "terastallize" in the existing scripts, you need to have the dbk terastal plugin for this, the same for dynamax and zmove, I think I didn't include this information when I posted XD
Deluxe Battle Kit ?Yes, I am using it.
 

rafahbit

Novice
Member
Joined
Oct 21, 2020
Posts
42
Deluxe Battle Kit ?Yes, I am using it.
Can you send me your entire Achievement_Triggers file so I can take a look? I'm half blind and just looking at the photo of the error I can't see almost anything hahahahah

Or, just copy this section here again and put it in Achievement_Triggers

Ruby:
class Battle

  alias achieve_pbMegaEvolve pbMegaEvolve

  def pbMegaEvolve(index)
    achieve_pbMegaEvolve(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].mega?
      Achievements.incrementProgress("MEGA_EVOLUTIONS", 1)
    end
  end

alias tera_pbTerastallize pbTerastallize
  def pbTerastallize(idxBattler)
    tera_pbTerastallize(idxBattler)
    battler = @battlers[idxBattler]
    if battler.pbOwnedByPlayer?
      Achievements.incrementProgress("TERASTAL", 1)
    end
  end


  alias achieve_pbDynamax pbDynamax

  def pbDynamax(index, *args)
    achieve_pbDynamax(index, *args)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].gmax?
      Achievements.incrementProgress("GIGANTAMAXING", 1)
    else
      Achievements.incrementProgress("DYNAMAXING", 1)
    end
  end


  alias achieve_pbPrimalReversion pbPrimalReversion

  def pbPrimalReversion(index)
    achieve_pbPrimalReversion(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].primal?
      Achievements.incrementProgress("PRIMAL_REVERSIONS", 1)
    end
  end

alias achieve_pbUltraBurst pbUltraBurst
  def pbUltraBurst(index)
    achieve_pbUltraBurst(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].ultra?
      Achievements.incrementProgress("ULTRA", 1)
    end
  end

  #use item on pokemon in battle
 

Thomwell

Novice
Member
Joined
Mar 8, 2024
Posts
24
Can you send me your entire Achievement_Triggers file so I can take a look? I'm half blind and just looking at the photo of the error I can't see almost anything hahahahah

Or, just copy this section here again and put it in Achievement_Triggers

Ruby:
class Battle

  alias achieve_pbMegaEvolve pbMegaEvolve

  def pbMegaEvolve(index)
    achieve_pbMegaEvolve(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].mega?
      Achievements.incrementProgress("MEGA_EVOLUTIONS", 1)
    end
  end

alias tera_pbTerastallize pbTerastallize
  def pbTerastallize(idxBattler)
    tera_pbTerastallize(idxBattler)
    battler = @battlers[idxBattler]
    if battler.pbOwnedByPlayer?
      Achievements.incrementProgress("TERASTAL", 1)
    end
  end


  alias achieve_pbDynamax pbDynamax

  def pbDynamax(index, *args)
    achieve_pbDynamax(index, *args)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].gmax?
      Achievements.incrementProgress("GIGANTAMAXING", 1)
    else
      Achievements.incrementProgress("DYNAMAXING", 1)
    end
  end


  alias achieve_pbPrimalReversion pbPrimalReversion

  def pbPrimalReversion(index)
    achieve_pbPrimalReversion(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].primal?
      Achievements.incrementProgress("PRIMAL_REVERSIONS", 1)
    end
  end

alias achieve_pbUltraBurst pbUltraBurst
  def pbUltraBurst(index)
    achieve_pbUltraBurst(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].ultra?
      Achievements.incrementProgress("ULTRA", 1)
    end
  end

  #use item on pokemon in battle
Wow, that's really great. After you made these modifications, it can now be used normally. It's really amazing. Thank you very much for your guidance.
 

komeiji514

Cooltrainer
Member
Joined
Oct 28, 2023
Posts
193
How to set events that check whether player has reached a certain level of an achievement and give rewards?
 

komeiji514

Cooltrainer
Member
Joined
Oct 28, 2023
Posts
193
Can you send me your entire Achievement_Triggers file so I can take a look? I'm half blind and just looking at the photo of the error I can't see almost anything hahahahah

Or, just copy this section here again and put it in Achievement_Triggers

Ruby:
class Battle

  alias achieve_pbMegaEvolve pbMegaEvolve

  def pbMegaEvolve(index)
    achieve_pbMegaEvolve(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].mega?
      Achievements.incrementProgress("MEGA_EVOLUTIONS", 1)
    end
  end

alias tera_pbTerastallize pbTerastallize
  def pbTerastallize(idxBattler)
    tera_pbTerastallize(idxBattler)
    battler = @battlers[idxBattler]
    if battler.pbOwnedByPlayer?
      Achievements.incrementProgress("TERASTAL", 1)
    end
  end


  alias achieve_pbDynamax pbDynamax

  def pbDynamax(index, *args)
    achieve_pbDynamax(index, *args)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].gmax?
      Achievements.incrementProgress("GIGANTAMAXING", 1)
    else
      Achievements.incrementProgress("DYNAMAXING", 1)
    end
  end


  alias achieve_pbPrimalReversion pbPrimalReversion

  def pbPrimalReversion(index)
    achieve_pbPrimalReversion(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].primal?
      Achievements.incrementProgress("PRIMAL_REVERSIONS", 1)
    end
  end

alias achieve_pbUltraBurst pbUltraBurst
  def pbUltraBurst(index)
    achieve_pbUltraBurst(index)
    return if !pbOwnedByPlayer?(index)
    if @battlers[index].ultra?
      Achievements.incrementProgress("ULTRA", 1)
    end
  end

  #use item on pokemon in battle
After the round using Dynamax in a battle this happens.But the game didn't crash and the opposing pokemon did nothing.
[2024-07-06 15:27:37 +0800]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

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

Backtrace:
[Mega MewThree's Achievement System] Achievement_Module.rb:215:in `checkIfLevelUp'
[Mega MewThree's Achievement System] Achievement_Module.rb:158:in `incrementProgress'
[Mega MewThree's Achievement System] Achievement_Triggers.rb:121:in `pbDynamax'
[[DBK] Dynamax] [007] Dynamax Mechanics.rb:254:in `block in pbAttackPhaseSpecialActions3'
[[DBK] Dynamax] [007] Dynamax Mechanics.rb:250:in `each'
[[DBK] Dynamax] [007] Dynamax Mechanics.rb:250:in `pbAttackPhaseSpecialActions3'
[[DBK] Z-Power] [007] Z-Move Mechanics.rb:244:in `pbAttackPhaseSpecialActions3'
[[DBK] Z-Power] [009] Ultra Burst Mechanics.rb:223:in `pbAttackPhaseSpecialActions3'
[Deluxe Battle Kit] [003] Command Menu Refactor.rb:408:in `pbAttackPhase'
148:Battle_StartAndEnd:339:in `block (2 levels) in pbBattleLoop'
Edit: I referred to https://eeveeexpo.com/threads/592/ to try to add rewards. After removing the codes it's ok.
But how can I add rewards to make it run correctly?
 
Last edited:
Back
Top