- 155
- Posts
- 11
- Years
- Seen Jun 11, 2021
I modified the Shiny Pokemon code to try to create Delta Species Pokemon from the TCG. However, when testing it out, it doesn't appear to be working.
This is the code I have in PokeBattle_Pokemon.
And in PokeBattle_Battler, I replaced each instance of this line:
With this.
Unfortunately, whenever I try it out and head into the tall grass, this error pops up:
I know I did something wrong. I'm just not sure what. Can anyone help me out?
Code:
def isDelta?
return @deltaflag if @deltaflag!=nil
a=@personalID^@trainerID
b=a&0xFFFF
c=(a>>16)&0xFFFF
d=b^c
return (d<DELTAPOKEMONCHANCE)
end
# Makes this Pokemon delta species.
def makeDelta
case rand(17)
when 0
@deltatype=0
when 1
@deltatype=1
when 2
@deltatype=2
when 3
@deltatype=3
when 4
@deltatype=4
when 5
@deltatype=5
when 6
@deltatype=6
when 7
@deltatype=7
when 8
@deltatype=8
when 9
@deltatype=10
when 10
@deltatype=11
when 11
@deltatype=12
when 12
@deltatype=13
when 13
@deltatype=14
when 14
@deltatype=15
when 15
@deltatype=16
when 16
@deltatype=17
when 17
@deltatype=18
end
@deltaflag=true
end
# Makes this Pokemon not shiny.
def makeNotDelta
@deltaflag=false
end
And in PokeBattle_Battler, I replaced each instance of this line:
Code:
@type1=pkmn.type1
Code:
if !pokemon.isDelta?
@type1=pkmn.type1
else
@type1=@deltatype
end
Code:
Exception: NoMethodError
Message: undefined method `isDelta?' for nil:NilClass
PokeBattle_Battler:215:in `__shadow_pbInitPokemon'
Pokemon_ShadowPokemon:525:in `pbInitPokemon'
PokeBattle_Battler:517:in `pbInitialize'
PokeBattle_Battle:2532:in `pbStartBattleCore'
PokeBattle_Battle:2505:in `pbStartBattle'
InverseSkyBattles:49:in `pbWildBattle'
InverseSkyBattles:48:in `pbSceneStandby'
InverseSkyBattles:50:in `pbWildBattle'
InverseSkyBattles:47:in `pbBattleAnimation'
InverseSkyBattles:47:in `pbWildBattle'