- Joined
- Sep 12, 2020
- Posts
- 94
Hey everyone, so I'm attempting to add an icon much like the Delta icon in Pokemon Insurgence. I thought I had done the script properly, but I get two errors persistently. First, I modified my scripts. I followed these instructions: Scripting Question: Giving icon to some pokemon forms?
I added this under each instance of #Draw Shiny icon
And I added this under IsMega?
But I get this error when I attempt to open the Party Screen:
And this error when attempting to enter battle:
And I can't for the life of me figure out why. I'll attach the parts of the script I modfied in the spoiler below as well for clarity.
Any help would of course, be HUGELY appreciated!
I added this under each instance of #Draw Shiny icon
Ruby:
#Draw Rosen icon
alterX = ((@battler.index&1)==0) ? 10 : 201 # Player's/foe's
imagepos.push(["Graphics/Pictures/rosen",@spritebaseX+alterX,36,0,0,-1,-1]) if isRosen?
And I added this under IsMega?
Ruby:
def isRosen?
return true if isConst?(pokemon,PBSpecies,:FLAREON) && pokemon.form== 1
end
But I get this error when I attempt to open the Party Screen:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 18.1.dev]
Exception: NoMethodError
Message: undefined method `index' for nil:NilClass
Backtrace:
FRLG Party Screen:403:in `refresh'
FRLG Party Screen:229:in `initialize'
FRLG Party Screen:463:in `new'
FRLG Party Screen:463:in `pbStartScene'
FRLG Party Screen:461:in `each'
FRLG Party Screen:461:in `pbStartScene'
FRLG Party Screen:1124:in `pbPokemonScreen'
PScreen_PauseMenu:180:in `pbStartPokemonMenu'
PScreen_PauseMenu:177:in `pbFadeOutIn'
PScreen_PauseMenu:182:in `pbStartPokemonMenu'
And this error when attempting to enter battle:
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 18.1.dev]
Exception: NoMethodError
Message: undefined method `isRosen?' for #<PokemonDataBox:0xc97d550>
Backtrace:
PokeBattle_SceneElements:234:in `refresh'
PokeBattle_SceneElements:38:in `initialize'
Scene_Initialize:79:in `new'
Scene_Initialize:79:in `_bugContest_pbInitSprites'
Scene_Initialize:77:in `each_with_index'
Scene_Initialize:77:in `each'
Scene_Initialize:77:in `each_with_index'
Scene_Initialize:77:in `_bugContest_pbInitSprites'
PokeBattle_BugContest:8:in `pbInitSprites'
Scene_Initialize:21:in `pbStartBattle
And I can't for the life of me figure out why. I'll attach the parts of the script I modfied in the spoiler below as well for clarity.
PokeBattle_SceneElements:
# Draw shiny icon
if @battler.shiny?
shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's
imagePos.push(["Graphics/Pictures/shiny",@spriteBaseX+shinyX,36])
end
#Draw Rosen icon
alterX = ((@battler.index&1)==0) ? 10 : 201 # Player's/foe's
imagepos.push(["Graphics/Pictures/rosen",@spritebaseX+alterX,36,0,0,-1,-1]) if isRosen?
PScreen_Party:
# Draw shiny icon
if @pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap,[[
"Graphics/Pictures/shiny",80,48,0,0,16,16]])
end
end
# Draw Rosen icon
alterX = ((@battler.index&1)==0) ? 10 : 201 # Player's/foe's
imagepos.push(["Graphics/Pictures/rosen",@spritebaseX+alterX,36,0,0,-1,-1]) if isRosen?
pbDrawTextPositions(@overlaysprite.bitmap,textpos)
# Draw level text
if !@pokemon.egg?
pbDrawImagePositions(@overlaysprite.bitmap,[[
"Graphics/Pictures/Party/overlay_lv",20,70,0,0,22,14]])
pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap,[
[@pokemon.level.to_s,42,62,0,basecolor,shadowcolor]
])
end
FRLG Party Screen:
# Draw shiny icon
if @pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap,[[
"Graphics/Pictures/shiny",80,48,0,0,16,16]])
end
end
# Draw Rosen icon
alterX = ((@battler.index&1)==0) ? 10 : 201 # Player's/foe's
imagepos.push(["Graphics/Pictures/rosen",@spritebaseX+alterX,36,0,0,-1,-1]) if isRosen?#
pbDrawTextPositions(@overlaysprite.bitmap,textpos)
# Draw level text
if !@pokemon.egg?
pbDrawImagePositions(@overlaysprite.bitmap,[[
"Graphics/Pictures/Party/overlay_lv",20,70,0,0,22,14]])
pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap,[
[@pokemon.level.to_s,45,63,0,basecolor,shadowcolor]
])
end
PokeBattle_Battler:
#=============================================================================
# Mega Evolution, Primal Reversion, Shadow Pokémon, Rosen Formes
#=============================================================================
def hasMega?
return false if @effects[PBEffects::Transform]
return @pokemon && @pokemon.hasMegaForm?
end
def mega?; return @pokemon && @pokemon.mega?; end
alias isMega? mega?
def hasPrimal?
return false if @effects[PBEffects::Transform]
return @pokemon && @pokemon.hasPrimalForm?
end
def primal?; return @pokemon && @pokemon.primal?; end
alias isPrimal? primal?
def shadowPokemon?; return false; end
alias isShadow? shadowPokemon?
def inHyperMode?; return false; end
def isRosen?
return true if isConst?(pokemon,PBSpecies,:FLAREON) && pokemon.form== 1
end
Any help would of course, be HUGELY appreciated!