v21.1 Are there any plans to bugfix Pokemon Tower/Factory ever?

This thread pertains to v21.1 of Pokémon Essentials.

SuperSpyroDragon64

Cooltrainer
Member
Joined
Apr 20, 2022
Posts
150
Age
27
In the new version of Pokemon Essentials, the Pokemon Tower/Factory is as nonfunctional as ever. It either overwrites my new Pokemon list data with the old Pokemon list data, ignores it entirely and loads the old list data, or crashes trying to do one of those things.

Why did I bother updating? Why did I bother trying to make anything in this engine?
 

SuperSpyroDragon64

Cooltrainer
Member
Joined
Apr 20, 2022
Posts
150
Age
27
Also why has the update to V21.1 broken the scripts I was about to release? Is the trainer's party coded differently now? This worked fine in the previous version.

Code:
[Pokémon Essentials version 21.1]

Script error in event 13 (coords 2,5), map 62 (Battle Frontier)
Exception: NoMethodError
Message: undefined method `party' for nil:NilClass

***Full script:
pbChangeNature

Backtrace:
JasonsNonsense:592:in `pbChangeNature'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
Interpreter:86:in `loop'
Interpreter:86:in `update'
Scene_Map:167:in `block in update'

Code:
def pbChangeNature
  commands = []
  ids = []
  $Trainer.party.each do |pokemon|
    next if pokemon.egg?
    commands.push("#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})")
    ids.push(pokemon)
  end
  commands.push(_INTL("[Cancel]"))
  cmd = -1
  loop do
    msg = _INTL("Choose a Pokémon to change its nature.")
    cmd = pbMessage(msg, commands, -1)
    break if cmd < 0 || cmd >= commands.length - 1
    pokemon = ids[cmd]
    nature_commands = []
    nature_ids = []
    GameData::Nature.each do |nature|
      if nature.stat_changes.empty?
        nature_commands.push(_INTL("{1} (---)", nature.real_name))
      else
        plus_text = ""
        minus_text = ""
        nature.stat_changes.each do |change|
          if change[1] > 0
            plus_text += "/" if !plus_text.empty?
            plus_text += GameData::Stat.get(change[0]).name_brief
          elsif change[1] < 0
            minus_text += "/" if !minus_text.empty?
            minus_text += GameData::Stat.get(change[0]).name_brief
          end
        end
        nature_commands.push(_INTL("{1} (+{2}, -{3})", nature.real_name, plus_text, minus_text))
      end
      nature_ids.push(nature.id)
    end
    nature_commands.push(_INTL("[Reset]"))
    nature_commands.push(_INTL("[Back]"))
    loop do
      nature_cmd = pbMessage("Select a nature", nature_commands, 0)
    break if cmd < 0 || cmd >= commands.length - 1
      if nature_cmd >= 0 && nature_cmd < nature_commands.length - 2   # Set nature
        pokemon.nature = nature_ids[nature_cmd]
        pbMessage(_INTL("{1}'s nature is set to {2}.", pokemon.name, GameData::Nature.get(pokemon.nature).real_name))
        # Update the Pokémon's name and nature in the commands array
        commands[cmd] = "#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})"
        break
      elsif nature_cmd == nature_commands.length - 2   # Reset
        pokemon.nature = nil
        pbMessage(_INTL("{1}'s nature has been reset.", pokemon.name))
        # Update the Pokémon's name and nature in the commands array
        commands[cmd] = "#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})"
        break
      elsif nature_cmd == nature_commands.length - 1   # Back button
        break
      end
    end
  end
end
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
270
Age
29
Also why has the update to V21.1 broken the scripts I was about to release? Is the trainer's party coded differently now? This worked fine in the previous version.

Code:
[Pokémon Essentials version 21.1]

Script error in event 13 (coords 2,5), map 62 (Battle Frontier)
Exception: NoMethodError
Message: undefined method `party' for nil:NilClass

***Full script:
pbChangeNature

Backtrace:
JasonsNonsense:592:in `pbChangeNature'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
Interpreter_Commands:1177:in `command_355'
Interpreter_Commands:116:in `execute_command'
Interpreter:130:in `block in update'
Interpreter:86:in `loop'
Interpreter:86:in `update'
Scene_Map:167:in `block in update'

Code:
def pbChangeNature
  commands = []
  ids = []
  $Trainer.party.each do |pokemon|
    next if pokemon.egg?
    commands.push("#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})")
    ids.push(pokemon)
  end
  commands.push(_INTL("[Cancel]"))
  cmd = -1
  loop do
    msg = _INTL("Choose a Pokémon to change its nature.")
    cmd = pbMessage(msg, commands, -1)
    break if cmd < 0 || cmd >= commands.length - 1
    pokemon = ids[cmd]
    nature_commands = []
    nature_ids = []
    GameData::Nature.each do |nature|
      if nature.stat_changes.empty?
        nature_commands.push(_INTL("{1} (---)", nature.real_name))
      else
        plus_text = ""
        minus_text = ""
        nature.stat_changes.each do |change|
          if change[1] > 0
            plus_text += "/" if !plus_text.empty?
            plus_text += GameData::Stat.get(change[0]).name_brief
          elsif change[1] < 0
            minus_text += "/" if !minus_text.empty?
            minus_text += GameData::Stat.get(change[0]).name_brief
          end
        end
        nature_commands.push(_INTL("{1} (+{2}, -{3})", nature.real_name, plus_text, minus_text))
      end
      nature_ids.push(nature.id)
    end
    nature_commands.push(_INTL("[Reset]"))
    nature_commands.push(_INTL("[Back]"))
    loop do
      nature_cmd = pbMessage("Select a nature", nature_commands, 0)
    break if cmd < 0 || cmd >= commands.length - 1
      if nature_cmd >= 0 && nature_cmd < nature_commands.length - 2   # Set nature
        pokemon.nature = nature_ids[nature_cmd]
        pbMessage(_INTL("{1}'s nature is set to {2}.", pokemon.name, GameData::Nature.get(pokemon.nature).real_name))
        # Update the Pokémon's name and nature in the commands array
        commands[cmd] = "#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})"
        break
      elsif nature_cmd == nature_commands.length - 2   # Reset
        pokemon.nature = nil
        pbMessage(_INTL("{1}'s nature has been reset.", pokemon.name))
        # Update the Pokémon's name and nature in the commands array
        commands[cmd] = "#{pokemon.name} (#{GameData::Nature.get(pokemon.nature).real_name})"
        break
      elsif nature_cmd == nature_commands.length - 1   # Back button
        break
      end
    end
  end
end
Not sure why you're asking an unrelated question on your own question post, but "$Trainer" isn't used anymore, since at least v20. Use "$player" instead.
 
Top