You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I can't seem to get random battles to work with the bot because the type chart isn't working. This is the error message I get:
Message='ELECTRIC'
Source=C:\Users\i4D4\Downloads\poke-env-master\poke-env-master\AItest.py
StackTrace:
File "C:\Users\i4D4\Downloads\poke-env-master\poke-env-master\AItest.py", line 61, in embed_battle (Current frame)
moves_dmg_multiplier[i] = move.type.damage_multiplier(
KeyError: 'ELECTRIC'
The type changes every time I run it because I'm running random battles.
This is the part of the code causing issues:
def embed_battle(self, battle: AbstractBattle) -> ObsType:
# -1 indicates that the move does not have a base power
# or is not available
moves_base_power = -np.ones(4)
moves_dmg_multiplier = np.ones(4)
for i, move in enumerate(battle.available_moves):
moves_base_power[i] = (
move.base_power / 100
) # Simple rescaling to facilitate learning
if move.type:
moves_dmg_multiplier[i] = move.type.damage_multiplier(
battle.opponent_active_pokemon.type_1,
battle.opponent_active_pokemon.type_2,
)
# We count how many pokemons have fainted in each team
fainted_mon_team = len([mon for mon in battle.team.values() if mon.fainted]) / 6
fainted_mon_opponent = (
len([mon for mon in battle.opponent_team.values() if mon.fainted]) / 6
)
...
```
The text was updated successfully, but these errors were encountered:
i4D4
changed the title
Type Chart causing issues
Type Chart causing a KeyError only containing a type as the error message
Jan 8, 2024
Hey there, I can't seem to get random battles to work with the bot because the type chart isn't working. This is the error message I get:
Message='ELECTRIC'
Source=C:\Users\i4D4\Downloads\poke-env-master\poke-env-master\AItest.py
StackTrace:
File "C:\Users\i4D4\Downloads\poke-env-master\poke-env-master\AItest.py", line 61, in embed_battle (Current frame)
moves_dmg_multiplier[i] = move.type.damage_multiplier(
KeyError: 'ELECTRIC'
The type changes every time I run it because I'm running random battles.
This is the part of the code causing issues:
The text was updated successfully, but these errors were encountered: