• 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!
Pokémon Factory

Resource Pokémon Factory 1.3.0

ok
 
Very useful script, this will certainly allow for some interesting giftmons without the need to define extra forms or bloating the Pokedex.
Just a couple of questions:
1) Can the generated Pokemon be used by opposing trainers? It would make for great bosses.
2) Can the generated Pokemon be forbidden from changing forms? (Including Megas/Gmax/Tera)
3) Could you add support for "Custom Innates"
 
Very useful script, this will certainly allow for some interesting giftmons without the need to define extra forms or bloating the Pokedex.
Just a couple of questions:
1) Can the generated Pokemon be used by opposing trainers? It would make for great bosses.
2) Can the generated Pokemon be forbidden from changing forms? (Including Megas/Gmax/Tera)
3) Could you add support for "Custom Innates"
1-Yes. In fact, the next update will feature examples of how to use the factory for WildBattles and, especially, TrainerBattles.

Example:
Ruby:
Expand Collapse Copy
def self.brock_figth
      trainer_party = []

      brock_onix_data = {
        species: :ONIX,
        level: 14,
        nickname: "Goliath",
        item: :BERRYJUICE,
        moves: [:ROCKTOMB, :BIND, :ROCKTHROW, :HARDEN],
        types: [:STEEL, :GHOST],
        base_stats: { defense: 200, attack: 60 }
      }

    # geodude_data= {}
   
      # The Onix is created and added to the team.
      trainer_party.push(ZBox::PokemonFactory.create(brock_onix_data))

      # More Pokémon can be added if needed.
      # trainer_party.push(ZBox::PokemonFactory.create(geodude_data))
   
      trainer = pbLoadTrainer(:LEADER_Brock, "Brock")

      # The team we just created is assigned.
      trainer.party = trainer_party

      # The battle is started using the Trainer object we have prepared.
      TrainerBattle.start(trainer)
    end

I'll probably create a method for inserting Pokémon into already defined teams, because this way the trainer's entire team is eliminated.

2-Not yet at the moment.

3-I don't have plans to add support for other scripts of this style yet. But rest assured, it will be implemented in the future.
 
Last edited:
Here's what it says:
Ruby:
Expand Collapse Copy
[2025-10-28 23:06:10 -0400]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: TypeError
Message: singleton can't be dumped

Backtrace:
SaveData:60:in `dump'
SaveData:60:in `block in save_to_file'
SaveData:60:in `open'
SaveData:60:in `save_to_file'
StartGame:118:in `save'
UI_Save:116:in `pbSaveScreen'
UI_PauseMenu:264:in `block in <main>'
UI_PauseMenu:124:in `block in pbStartPokemonMenu'
UI_PauseMenu:117:in `loop'
UI_PauseMenu:117:in `pbStartPokemonMenu'

It show up every time I saved.
 
Here's what it says:
Ruby:
Expand Collapse Copy
[2025-10-28 23:06:10 -0400]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: TypeError
Message: singleton can't be dumped

Backtrace:
SaveData:60:in `dump'
SaveData:60:in `block in save_to_file'
SaveData:60:in `open'
SaveData:60:in `save_to_file'
StartGame:118:in `save'
UI_Save:116:in `pbSaveScreen'
UI_PauseMenu:264:in `block in <main>'
UI_PauseMenu:124:in `block in pbStartPokemonMenu'
UI_PauseMenu:117:in `loop'
UI_PauseMenu:117:in `pbStartPokemonMenu'

It show up every time I saved.
Indeed. Those are the types of errors my script can produce when entering data that the save isn't designed for.

Although I made sure to mitigate these errors, they seem to have returned when I corrected some things.

You could also pass me the Pokémon you created so I can pinpoint which option might be the culprit.
 
Here:
Ruby:
Expand Collapse Copy
def self.give_pkmn_override #ZBox.give_pkmn_override
      new_impostor = {
        species: :UNOWN,
        level: 20,
        nickname: "Snickers",
        shiny: true,
        nature: :TIMID,
        poke_ball: :PREMIERBALL,
        ivs: { hp: 31, attack: 31, defense: 31, spatk: 31, spdef: 31, speed: 31 },
        moves: [:TRANSFORM, :HIDDENPOWER, :NIHILLIGHT, :HAPPYHOUR],
        first_moves: [:TRANSFORM, :HIDDENPOWER, :NIHILLIGHT, :HAPPYHOUR, :DRAGONPULSE, :DARKPULSE, :DRAGONRAGE, :HURRICANE, :TORMENT, :TAUNT, :CELEBRATE, :PRESENT, :SPLASH],
        base_stats: { atk: 130, spa: 230, spe: 140},
        obtain_text: "Top Secret",
        types: [:DARK, :FLYING],
        cry: "Cries/GIRATINA",
        hue_change: 330, # The value to shift the tone can be any number between -360 and 360.
        sprite_override: "ABSOL", # It is responsible for searching for sprites with this name.

        # --- Custom move ---
        custom_moves: [
          {
            move: :NIHILLIGHT,
            name: "Gaia WindWave",
            description: "A mystifying wave-like beam hits the foes easily. Cannot be stopped by the foe's ability.",
            category: :SPECIAL,
            type: :FLYING,
            power: 170,
            priority: 1,
            accuracy: 0,
            total_pp: 5
          }
        ]

      }

      pkmn = ZBox::PokemonFactory.create(new_impostor)
      pbAddPokemonWithNickname(pkmn)
    end
   
    give_pkmn_override

EDIT: Nihil Light is a move from Pokemon Legends Z-A and I'm sure the sprite itself might be a culprit.
 
I also applied to Suicune too. Maybe that you need to translate it to English.
 
Or maybe it only work inside of the ZBox.
 
Or maybe it only work inside of the ZBox.
Regarding Suicune, can you also send me the creation method and see the possible error?

Regarding Unow, it's probably due to the NIHILLIGHT movement. Is it added by a plugin?
 
How can I? I just added "ZBox::PokemonFactory.create(new_impostor)" in there. Maybe it only works inside of the ZBox?
 
How can I? I just added "ZBox::PokemonFactory.create(new_impostor)" in there. Maybe it only works inside of the ZBox?
By using "ZBox::" in this line, there's no need for it to be inside the module:
ZBox::PokemonFactory.create(new_impostor)

You just need to remove the "self." from the creation method:
def self.give_pkmn_override → def give_pkmn_override

And indeed, the NIHILLIGHT movement seems to be the culprit, because I copied it exactly and it allowed me to save without any problems. Now, if it still occurs even after removing the movement, it seems the problem is caused by some plugin incompatibility.
 
OK
 
Have you worked on HTML PKMN creator or a type chart yet?
 
Back
Top