- Joined
- Jun 24, 2021
- Posts
- 26
- Pronouns
- she/her
ok
1-Yes. In fact, the next update will feature examples of how to use the factory for WildBattles and, especially, TrainerBattles.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"
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
[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'
Indeed. Those are the types of errors my script can produce when entering data that the save isn't designed for.Here's what it says:
Ruby:[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.
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
Regarding Suicune, can you also send me the creation method and see the possible error?Or maybe it only work inside of the ZBox.
By using "ZBox::" in this line, there's no need for it to be inside the module:How can I? I just added "ZBox::PokemonFactory.create(new_impostor)" in there. Maybe it only works inside of the ZBox?