Other Evolution method involving fainting in battle

This thread does not pertain to a related version of Pokémon Essentials.

Kadai

Rookie
Member
Joined
Nov 19, 2020
Posts
6
Age
28
I'm trying to figure out how to script an evolution method for a Ghost type Eeveelution that would involve it fainting in battle as a prerequisite for evolving (may or may not need to level up before or after that same battle; whatever works script-wise honestly).

On another site (https://www.pokecommunity.com/showthread.php?t=410401) a helpful user gave some suggestions for other methods, but this particular evolution method gave the following error whenever Eevee leveled up at all:

Exception: NoMethodError

Message: undefined method `fainted?' for #<PokeBattle_Pokemon:0xf37ff08>

Pokemon_Evolution:896:in `pbMiniCheckEvolution'

Pokemon_Evolution:999:in `pbCheckEvolution'

Pokemon_Evolution:998:in `pbCheckEvolutionEx'

Pokemon_Evolution:987:in `each'

Pokemon_Evolution:987:in `pbCheckEvolutionEx'

Pokemon_Evolution:998:in `pbCheckEvolution'

PItem_Items:318:in `pbChangeLevel'

PItem_ItemEffects:759

PItem_ItemEffects:754:in `call'

Event:150:in `trigger'

-----

Here was the script I used, under Evolution Methods)

when PBEvolution::Fainted
return poke if pokemon.level>=level && pokemon.fainted?

The EVOPARAM was 1, and I'm using v16
Any ideas how to script it properly? I'm flexible on the exact method, as long as it involves the Pokemon fainting in battle.
 

Kadai

Rookie
Member
Joined
Nov 19, 2020
Posts
6
Age
28
In v16.2, I believe it's isFainted? rather than fainted?.

I'd be pleasantly surprised if it's that simple, though.
You are correct, thanks. On both points, haha.

I found another thread where a solution seemed to work (https://reliccastle.com/threads/2618/) but the method also seems to result in also allowing fainted Pokemon who evolve by leveling up or through an item to evolve too though. I'd like to route around that if possible. Wondering now if there's a way to do it such that it evolves via level up when healthy, but only after having fainted at least once as a precondition? (ideally within the same battle, but not required I suppose)?
 
Top