- 318
- Posts
- 5
- Years
- Germany
- Seen Apr 28, 2025
I have implemented some changes, but I get alwaysWhat could be wrong with my approach?Code:undefined method `aggressive' for nil:NilClass?
The pokemon you want to check out for aggressiveness is not a pokemon at all. Maybe there is some misspelling or any other mistake. It is not possible to decide what causes your error message without looking at your code.
Edit: I found errors in my explainations above. Next try is:
The wild pokemon can be found inside the array
Code:
spawned_pkmn = @party2
Code:
spawned_pkmn = foe_party
By default, you can't get access to party2 outside class Battle and thus also not in WildBattle by
Code:
spawned_pkmn = battle.party2
Code:
attr_accessor :party2
Last edited: