• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
BW Medals / Archivement System

Resource BW Medals / Archivement System 1.0

Sonicover

Cooltrainer
Member
Joined
Jan 14, 2022
Posts
173
Sonicover submitted a new resource:

BW Medals / Archivement System - Collect archivements like in BW2 using fancy and shiny medals!

Remember the Medal Rally from Black and White 2? It's back! In plugin form!

pW3OeiI.gif


Being one of my favorite things from Black and White 2 (And still being salty I was never able to 100% it), I decided to re implement the medal system for anyone who wants to add this collectibles that work as achievements as well, for a bit of flavor to your game.

Installation:

Simply extract...

Read more about this resource...
 
This looks awesome. Any chance it works on v20.1?
Tbh I have no clue. Maybe it does? If anything some animations would probably be off considering v20.1 uses a different timer system than 21.1, but you can always give it a shot
 
Having this issue at startup.

Exception `NoMethodError' at [BW Medals / Archivement System] 001_PBS and Compiler.rb:199 - undefined method `compile_PBS_file_generic' for Compiler:Module
 
Having this issue at startup.

Exception `NoMethodError' at [BW Medals / Archivement System] 001_PBS and Compiler.rb:199 - undefined method `compile_PBS_file_generic' for Compiler:Module
Strange. What version are you using by the way? Because that method exist on v21, not on v20
 
Having this issue at startup.

Exception `NoMethodError' at [BW Medals / Archivement System] 001_PBS and Compiler.rb:199 - undefined method `compile_PBS_file_generic' for Compiler:Module
Plugins for v21.1 will not work on v20; you will only be causing crashes for yourself. There is nothing the plugin creators can do in this case.

Besides, why are you trying to use something that was made for a version newer than yours? I thought incompatibility would be the first thing that came to your mind * Thinking emoji*
 
Plugins for v21.1 will not work on v20; you will only be causing crashes for yourself. There is nothing the plugin creators can do in this case.

Besides, why are you trying to use something that was made for a version newer than yours? I thought incompatibility would be the first thing that came to your mind * Thinking emoji*
Well, I have plenty of plugins that are made for v21 that work just fine on my version. There is no way for me (and many others) to upgrade at a certain point in development, so I was just hoping this cool plugin could be used. I may privately work on a solution and share with the creator of the plugin, I've done that in the past as well. Thanks!
 
Could you show me a visual example of an event giving the player a medal? Any basic medal is fine. I tried following your instructions, but I am terrible at using / understanding RPGMaker and all my events keep failing.
 
Could you show me a visual example of an event giving the player a medal? Any basic medal is fine. I tried following your instructions, but I am terrible at using / understanding RPGMaker and all my events keep failing.
Sorry for the late reply, but sure. The 3 important methods you need to use are pbEarnMedal(medal_id), pbReceiveMedal(medal_id) and pbReceiveAllMedals.
pbReceiveMedal(medal_id) is the most straightforward method of them. Directly gives you the medal in your medal box, no intermediates, no checks, nothing.
zAc7VlZ.png

If you want to have NPCs themselves be the ones that reward you medals thats you way to go.

Now, like I said this plugin was inspired in the system of BW2 where you do certaing things in the world, and in the Pokemon centers theres an NPC that gives you every medal you have completed the requirements for.
In order to make that system a tad more flexible, the pbEarnMedal(medal_id) can be called anywhere to give you a medal, and later an NPC can check them and give all of them to you with pbReceiveAllMedals
FFzBKw3.png

The beauty of the pbEarnMedal method is that you can call it anywhere and it will save that you earned the medal.

On a move's function code, on a script that checks your dex, you name it.

For example I have this code that checks the pokemon caught and earns you the respective medal for it:
Ruby:
Expand Collapse Copy
def species_medal_check
  medal_definitions = {
    :OHKRAB         => [:KRABBY],
    :OUTOFTHISWORLD => [:NIHILEGO, :BUZZWOLE, :PHEROMOSA, :XURKITREE, :CELESTEELA, :KARTANA, :GUZZLORD],
    :LETSGETSTARTER => [:BULBASAUR, :CHARMANDER, :SQUIRTLE, :CHIKORITA, :CYNDAQUIL, :TOTODILE, :TREECKO, :TORCHIC, :MUDKIP,
                        :TURTWIG, :CHIMCHAR, :PIPLUP, :SNIVY, :TEPIG, :OSHAWOTT, :CHESPIN, :FENNEKIN, :FROAKIE,
                        :ROWLET, :LITTEN, :POPPLIO, :SPRIGATITO, :FUECOCO, :QUAXLY],
    :STARTINGINKANTO => [:BULBASAUR, :CHARMANDER, :SQUIRTLE],
    :STARTINGJOHTO  => [:CHIKORITA, :CYNDAQUIL, :TOTODILE],
    :STARTINGHOENN  => [:TREECKO, :TORCHIC, :MUDKIP],
    :STARTINGSINNOH  => [:TURTWIG, :CHIMCHAR, :PIPLUP],
    :STARTINGUNOVA  => [:SNIVY, :TEPIG, :OSHAWOTT],
    :STARTINGKALOS  => [:CHESPIN, :FENNEKIN, :FROAKIE],
    :STARTINGALOLA  => [:ROWLET, :LITTEN, :POPPLIO],
    :STARTINGINGALAR  => [:GROOKEY, :SCORBUNNY, :SOBBLE],
    :STARTINGINPALDEA   => [:SPRIGATITO, :FUECOCO, :QUAXLY],
  }

  medal_definitions.each do |medal_id, required_species|
    next if MedalSystem.has_medal?(medal_id)

    if required_species.all? { |s| $player.owned?(s) }
      pbEarnMedal(medal_id)
    end
  end
end

So when you call it, you "earn" the respective medal if you have registered in your dex the necessary Pokemon for them.
Or even something like this:
Ruby:
Expand Collapse Copy
def specific_medals_check
  # Medals for catching pokemon
  pbEarnMedal(:NEWBUDDY) if $stats.caught_pokemon >= 1 && !MedalSystem.has_medal?(:NEWBUDDY)
  pbEarnMedal(:CATCHINGSTARTER) if $stats.caught_pokemon >= 25 && !MedalSystem.has_medal?(:CATCHINGSTARTER)
  pbEarnMedal(:CAPTUREEXPERT) if $stats.caught_pokemon >= 100 && !MedalSystem.has_medal?(:CAPTUREEXPERT)
  pbEarnMedal(:GOTTACATCHEMALL) if $stats.caught_pokemon >= 151 && !MedalSystem.has_medal?(:GOTTACATCHEMALL)
 
  #Elementalist upon catching at least 1 fire, grass and water type pokemon
  pbEarnMedal(:ELEMENTALIST) if $stats.fire_pokemon_caught >= 1 && $stats.grass_pokemon_caught >= 1 && $stats.water_pokemon_caught >= 1 && !MedalSystem.has_medal?(:ELEMENTALIST)
 
  # Glorious Evolution upon evolving
  pbEarnMedal(:GLORIOUSEVOLUTION) if $stats.evolution_count >= 1 && !MedalSystem.has_medal?(:GLORIOUSEVOLUTION)
  #Giant Slayer and Monster Hunter upon beating boss pokemon
  pbEarnMedal(:GIANTSLAYER) if $stats.alpha_pokemon_defeated >= 10 && !MedalSystem.has_medal?(:GIANTSLAYER)
  pbEarnMedal(:MONSTERHUNTER) if $stats.alpha_pokemon_defeated >= 30 && !MedalSystem.has_medal?(:MONSTERHUNTER)
  pbEanrMedal(:KAIJUCAPTUREMISSION) if $stats.alpha_pokemon_caught >= 10 && !MedalSystem.has_medal?(:KAIJUCAPTUREMISSION)

  #Charm Collector
  pbEarnMedal(:CHARMCOLLECTOR) if $player.owned_charms.uniq.size >= 10 && !MedalSystem.has_medal?(:CHARMCOLLECTOR)

  pbEarnMedal(:ADVANCEDTRAINER) if $player.badge_count >= 1 && !MedalSystem.has_medal?(:ADVANCEDTRAINER)
end
That when called, checks for various custom game stats and if you have surpased the threshold, you earn the medal.

And since you've earned those medals, going with an NPC that has the pbReceiveAllMedals command (Or simply calling it) will reward you with every single one of them.

In fact you don't even need to use the pbReceiveAllMedals method if you can code with arrays. You can even customize something like this: (Pardon the spanish, but thats my first language)

Code:
Expand Collapse Copy
# NPC method to receive all earned medals
def receive_all_NPC
  #---------------------------------------------------------
  # No medals earned
  #---------------------------------------------------------
  if MedalSystem.earned_count == 0
    pbMessage(_INTL("\\bHmmm, no me aparece que tengas ninguna nueva medalla en mi registro."))
    pbMessage(_INTL("¡Sigue esforzandote! Se que las coleccionaras todas en poco tiempo."))
    return
  elsif MedalSystem.earned_count == 1
    pbMessage(_INTL("\\b¡Vengo a hacerte entrega de tu merecida medalla!"))
    pbMessage(_INTL("Aqui tienes."))
  else
    pbMessage(_INTL("\\b¡Vengo a hacerte entrega de tus merecidas medallas!"))
    pbMessage(_INTL("\\bAqui tienes."))
  end

  #---------------------------------------------------------
  # Receive medals one by one
  #---------------------------------------------------------
  gained = []

  $PokemonGlobal.earned_medals.dup.each do |medal_id|
    next if !MedalSystem.receive(medal_id)
    medal = GameData::Medal.get(medal_id)
    pbSEPlay("Mining reveal full")
    pbMessage(_INTL(
      "Reciviste la medalla \\c[2]{1}\\c[0]!",
      medal.name
    ))

    gained << medal_id
  end

  #---------------------------------------------------------
  # Post-gain flavor
  #---------------------------------------------------------
  if gained.length == 1
    pbMessage(_INTL("\\b¡Lleva esa medalla con orgullo!"))
  else
    pbMessage(_INTL(
      "\\b¡Maravilloso! Ganaste {1} medallas!",
      gained.length
    ))
    pbMessage("\\b¡Lucelas con orgullo!")
  end

  medal_rewards = [
    {
      :count => 10,
      :medal => :ROOKIEMEDALIST,
      :msg   => "¡Veo que ya llevas almenos 10 medallas en tu coleccion!"
    },
    {
      :count => 50,
      :medal => :ELITEMEDALIST,
      :msg   => "¡Impresionante! ¡Ya tienes almenos 50 medallas!"
    }
  ]

  medal_rewards.each do |data|
    next if MedalSystem.count < data[:count]
    next if MedalSystem.has_medal?(data[:medal])

    pbMessage(_INTL("\\b" + data[:msg]))
    pbMessage(_INTL("\\bEn ese caso, permiteme darte esta medalla."))
    pbGainMedal(data[:medal])
    break
  end
end
 
Sorry for the late reply, but sure. The 3 important methods you need to use are pbEarnMedal(medal_id), pbReceiveMedal(medal_id) and pbReceiveAllMedals.
pbReceiveMedal(medal_id) is the most straightforward method of them. Directly gives you the medal in your medal box, no intermediates, no checks, nothing.
zAc7VlZ.png

If you want to have NPCs themselves be the ones that reward you medals thats you way to go.

Now, like I said this plugin was inspired in the system of BW2 where you do certaing things in the world, and in the Pokemon centers theres an NPC that gives you every medal you have completed the requirements for.
In order to make that system a tad more flexible, the pbEarnMedal(medal_id) can be called anywhere to give you a medal, and later an NPC can check them and give all of them to you with pbReceiveAllMedals
FFzBKw3.png

The beauty of the pbEarnMedal method is that you can call it anywhere and it will save that you earned the medal.

On a move's function code, on a script that checks your dex, you name it.

For example I have this code that checks the pokemon caught and earns you the respective medal for it:
Ruby:
Expand Collapse Copy
def species_medal_check
  medal_definitions = {
    :OHKRAB         => [:KRABBY],
    :OUTOFTHISWORLD => [:NIHILEGO, :BUZZWOLE, :PHEROMOSA, :XURKITREE, :CELESTEELA, :KARTANA, :GUZZLORD],
    :LETSGETSTARTER => [:BULBASAUR, :CHARMANDER, :SQUIRTLE, :CHIKORITA, :CYNDAQUIL, :TOTODILE, :TREECKO, :TORCHIC, :MUDKIP,
                        :TURTWIG, :CHIMCHAR, :PIPLUP, :SNIVY, :TEPIG, :OSHAWOTT, :CHESPIN, :FENNEKIN, :FROAKIE,
                        :ROWLET, :LITTEN, :POPPLIO, :SPRIGATITO, :FUECOCO, :QUAXLY],
    :STARTINGINKANTO => [:BULBASAUR, :CHARMANDER, :SQUIRTLE],
    :STARTINGJOHTO  => [:CHIKORITA, :CYNDAQUIL, :TOTODILE],
    :STARTINGHOENN  => [:TREECKO, :TORCHIC, :MUDKIP],
    :STARTINGSINNOH  => [:TURTWIG, :CHIMCHAR, :PIPLUP],
    :STARTINGUNOVA  => [:SNIVY, :TEPIG, :OSHAWOTT],
    :STARTINGKALOS  => [:CHESPIN, :FENNEKIN, :FROAKIE],
    :STARTINGALOLA  => [:ROWLET, :LITTEN, :POPPLIO],
    :STARTINGINGALAR  => [:GROOKEY, :SCORBUNNY, :SOBBLE],
    :STARTINGINPALDEA   => [:SPRIGATITO, :FUECOCO, :QUAXLY],
  }

  medal_definitions.each do |medal_id, required_species|
    next if MedalSystem.has_medal?(medal_id)

    if required_species.all? { |s| $player.owned?(s) }
      pbEarnMedal(medal_id)
    end
  end
end

So when you call it, you "earn" the respective medal if you have registered in your dex the necessary Pokemon for them.
Or even something like this:
Ruby:
Expand Collapse Copy
def specific_medals_check
  # Medals for catching pokemon
  pbEarnMedal(:NEWBUDDY) if $stats.caught_pokemon >= 1 && !MedalSystem.has_medal?(:NEWBUDDY)
  pbEarnMedal(:CATCHINGSTARTER) if $stats.caught_pokemon >= 25 && !MedalSystem.has_medal?(:CATCHINGSTARTER)
  pbEarnMedal(:CAPTUREEXPERT) if $stats.caught_pokemon >= 100 && !MedalSystem.has_medal?(:CAPTUREEXPERT)
  pbEarnMedal(:GOTTACATCHEMALL) if $stats.caught_pokemon >= 151 && !MedalSystem.has_medal?(:GOTTACATCHEMALL)
 
  #Elementalist upon catching at least 1 fire, grass and water type pokemon
  pbEarnMedal(:ELEMENTALIST) if $stats.fire_pokemon_caught >= 1 && $stats.grass_pokemon_caught >= 1 && $stats.water_pokemon_caught >= 1 && !MedalSystem.has_medal?(:ELEMENTALIST)
 
  # Glorious Evolution upon evolving
  pbEarnMedal(:GLORIOUSEVOLUTION) if $stats.evolution_count >= 1 && !MedalSystem.has_medal?(:GLORIOUSEVOLUTION)
  #Giant Slayer and Monster Hunter upon beating boss pokemon
  pbEarnMedal(:GIANTSLAYER) if $stats.alpha_pokemon_defeated >= 10 && !MedalSystem.has_medal?(:GIANTSLAYER)
  pbEarnMedal(:MONSTERHUNTER) if $stats.alpha_pokemon_defeated >= 30 && !MedalSystem.has_medal?(:MONSTERHUNTER)
  pbEanrMedal(:KAIJUCAPTUREMISSION) if $stats.alpha_pokemon_caught >= 10 && !MedalSystem.has_medal?(:KAIJUCAPTUREMISSION)

  #Charm Collector
  pbEarnMedal(:CHARMCOLLECTOR) if $player.owned_charms.uniq.size >= 10 && !MedalSystem.has_medal?(:CHARMCOLLECTOR)

  pbEarnMedal(:ADVANCEDTRAINER) if $player.badge_count >= 1 && !MedalSystem.has_medal?(:ADVANCEDTRAINER)
end
That when called, checks for various custom game stats and if you have surpased the threshold, you earn the medal.

And since you've earned those medals, going with an NPC that has the pbReceiveAllMedals command (Or simply calling it) will reward you with every single one of them.

In fact you don't even need to use the pbReceiveAllMedals method if you can code with arrays. You can even customize something like this: (Pardon the spanish, but thats my first language)

Code:
Expand Collapse Copy
# NPC method to receive all earned medals
def receive_all_NPC
  #---------------------------------------------------------
  # No medals earned
  #---------------------------------------------------------
  if MedalSystem.earned_count == 0
    pbMessage(_INTL("\\bHmmm, no me aparece que tengas ninguna nueva medalla en mi registro."))
    pbMessage(_INTL("¡Sigue esforzandote! Se que las coleccionaras todas en poco tiempo."))
    return
  elsif MedalSystem.earned_count == 1
    pbMessage(_INTL("\\b¡Vengo a hacerte entrega de tu merecida medalla!"))
    pbMessage(_INTL("Aqui tienes."))
  else
    pbMessage(_INTL("\\b¡Vengo a hacerte entrega de tus merecidas medallas!"))
    pbMessage(_INTL("\\bAqui tienes."))
  end

  #---------------------------------------------------------
  # Receive medals one by one
  #---------------------------------------------------------
  gained = []

  $PokemonGlobal.earned_medals.dup.each do |medal_id|
    next if !MedalSystem.receive(medal_id)
    medal = GameData::Medal.get(medal_id)
    pbSEPlay("Mining reveal full")
    pbMessage(_INTL(
      "Reciviste la medalla \\c[2]{1}\\c[0]!",
      medal.name
    ))

    gained << medal_id
  end

  #---------------------------------------------------------
  # Post-gain flavor
  #---------------------------------------------------------
  if gained.length == 1
    pbMessage(_INTL("\\b¡Lleva esa medalla con orgullo!"))
  else
    pbMessage(_INTL(
      "\\b¡Maravilloso! Ganaste {1} medallas!",
      gained.length
    ))
    pbMessage("\\b¡Lucelas con orgullo!")
  end

  medal_rewards = [
    {
      :count => 10,
      :medal => :ROOKIEMEDALIST,
      :msg   => "¡Veo que ya llevas almenos 10 medallas en tu coleccion!"
    },
    {
      :count => 50,
      :medal => :ELITEMEDALIST,
      :msg   => "¡Impresionante! ¡Ya tienes almenos 50 medallas!"
    }
  ]

  medal_rewards.each do |data|
    next if MedalSystem.count < data[:count]
    next if MedalSystem.has_medal?(data[:medal])

    pbMessage(_INTL("\\b" + data[:msg]))
    pbMessage(_INTL("\\bEn ese caso, permiteme darte esta medalla."))
    pbGainMedal(data[:medal])
    break
  end
end
It works now! Thank you so much for the help! :D
 
Back
Top