- 16
- Posts
- 11
- Years
- Seen Dec 21, 2019
Hi,
I'm working on my first game and I'm trying to edit the pokedex in such a way so you can not only check if you own a pokemon, but also can check if you currently own a pokemon (so all the pokemon in your boxes and your party). All pokemon that you've traded, released or evolved are currently marked as "owned" even if you don't own one at the moment. For those who remember, this was in Stadium 2 also: htt p://imgu r.com/jddCPKN (remove spaces as I'm not allowed yet to post links)
So I want
-a normal red/white pokeball if you have that species in your boxes/party
-a grey pokeball if you once have onwed that species
-a white box if you only have seen that species
I've edited this on the PokemonPokedex script:
This:
I've changed into this:
(I know it only checks the boxes and not the party, but I'll do that later)
and this:
into this:
Offcourse I've also placed the right images in the right folders.
When I try to test it, it gives no error, but when I open the Pokédex the game crashes.
No error or error log, just not responding.
Any idea what I've done wrong?
Any help is appriciated
P.S. sorry if my English isn't good, it's not my first language.
I'm working on my first game and I'm trying to edit the pokedex in such a way so you can not only check if you own a pokemon, but also can check if you currently own a pokemon (so all the pokemon in your boxes and your party). All pokemon that you've traded, released or evolved are currently marked as "owned" even if you don't own one at the moment. For those who remember, this was in Stadium 2 also: htt p://imgu r.com/jddCPKN (remove spaces as I'm not allowed yet to post links)
So I want
-a normal red/white pokeball if you have that species in your boxes/party
-a grey pokeball if you once have onwed that species
-a white box if you only have seen that species
I've edited this on the PokemonPokedex script:
This:
Spoiler:
def drawItem(index,count,rect)
return if index >= self.top_row + self.page_item_max
rect=drawCursor(index,rect)
indexNumber=@commands[index][4]
species=@commands[index][0]
if $Trainer.seen[species]
if $Trainer.owned[species]
pbCopyBitmap(self.contents,@pokeballOwned.bitmap,rect.x-6,rect.y+8)
else
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
end
text=_ISPRINTF("{1:03d}{2:s} {3:s}",(@commands[index][5]) ? indexNumber-1 : indexNumber," ",@commands[index][1])
else
text=_ISPRINTF("{1:03d} ----------",(@commands[index][5]) ? indexNumber-1 : indexNumber)
end
pbDrawShadowText(self.contents,rect.x+34,rect.y+6,rect.width,rect.height,text,
self.baseColor,self.shadowColor)
overlapCursor=drawCursor(index-1,itemRect(index-1))
end
return if index >= self.top_row + self.page_item_max
rect=drawCursor(index,rect)
indexNumber=@commands[index][4]
species=@commands[index][0]
if $Trainer.seen[species]
if $Trainer.owned[species]
pbCopyBitmap(self.contents,@pokeballOwned.bitmap,rect.x-6,rect.y+8)
else
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
end
text=_ISPRINTF("{1:03d}{2:s} {3:s}",(@commands[index][5]) ? indexNumber-1 : indexNumber," ",@commands[index][1])
else
text=_ISPRINTF("{1:03d} ----------",(@commands[index][5]) ? indexNumber-1 : indexNumber)
end
pbDrawShadowText(self.contents,rect.x+34,rect.y+6,rect.width,rect.height,text,
self.baseColor,self.shadowColor)
overlapCursor=drawCursor(index-1,itemRect(index-1))
end
I've changed into this:
Spoiler:
def drawItem(index,count,rect)
return if index >= self.top_row + self.page_item_max
rect=drawCursor(index,rect)
indexNumber=@commands[index][4]
species=@commands[index][0]
if $Trainer.seen[species]
if $Trainer.owned[species]
hasinbox=false
while hasinbox==false
for i in 0...$PokemonStorage.maxBoxes
for j in 0...$PokemonStorage.maxPokemon(i)
hasinbox=($PokemonStorage[j]==species)
end
end
end
if hasinbox==true
pbCopyBitmap(self.contents,@pokeballInBox.bitmap,rect.x-6,rect.y+8)
end
pbCopyBitmap(self.contents,@pokeballOwned.bitmap,rect.x-6,rect.y+8)
else
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
end
text=_ISPRINTF("{1:03d}{2:s} {3:s}",(@commands[index][5]) ? indexNumber-1 : indexNumber," ",@commands[index][1])
else
text=_ISPRINTF("{1:03d} ----------",(@commands[index][5]) ? indexNumber-1 : indexNumber)
end
pbDrawShadowText(self.contents,rect.x+34,rect.y+6,rect.width,rect.height,text,
self.baseColor,self.shadowColor)
overlapCursor=drawCursor(index-1,itemRect(index-1))
end
return if index >= self.top_row + self.page_item_max
rect=drawCursor(index,rect)
indexNumber=@commands[index][4]
species=@commands[index][0]
if $Trainer.seen[species]
if $Trainer.owned[species]
hasinbox=false
while hasinbox==false
for i in 0...$PokemonStorage.maxBoxes
for j in 0...$PokemonStorage.maxPokemon(i)
hasinbox=($PokemonStorage[j]==species)
end
end
end
if hasinbox==true
pbCopyBitmap(self.contents,@pokeballInBox.bitmap,rect.x-6,rect.y+8)
end
pbCopyBitmap(self.contents,@pokeballOwned.bitmap,rect.x-6,rect.y+8)
else
pbCopyBitmap(self.contents,@pokeballSeen.bitmap,rect.x-6,rect.y+8)
end
text=_ISPRINTF("{1:03d}{2:s} {3:s}",(@commands[index][5]) ? indexNumber-1 : indexNumber," ",@commands[index][1])
else
text=_ISPRINTF("{1:03d} ----------",(@commands[index][5]) ? indexNumber-1 : indexNumber)
end
pbDrawShadowText(self.contents,rect.x+34,rect.y+6,rect.width,rect.height,text,
self.baseColor,self.shadowColor)
overlapCursor=drawCursor(index-1,itemRect(index-1))
end
(I know it only checks the boxes and not the party, but I'll do that later)
and this:
Spoiler:
class Window_Pokedex < Window_DrawableCommand
def initialize(x,y,width,height)
@pokeballOwned=AnimatedBitmap.new("Graphics/Pictures/pokedexOwned")
@pokeballSeen=AnimatedBitmap.new("Graphics/Pictures/pokedexSeen")
@commands=[]
super(x,y,width,height)
self.windowskin=nil
self.baseColor=Color.new(88,88,80)
self.shadowColor=Color.new(168,184,184)
end
def initialize(x,y,width,height)
@pokeballOwned=AnimatedBitmap.new("Graphics/Pictures/pokedexOwned")
@pokeballSeen=AnimatedBitmap.new("Graphics/Pictures/pokedexSeen")
@commands=[]
super(x,y,width,height)
self.windowskin=nil
self.baseColor=Color.new(88,88,80)
self.shadowColor=Color.new(168,184,184)
end
into this:
Spoiler:
class Window_Pokedex < Window_DrawableCommand
def initialize(x,y,width,height)
@pokeballInBox=AnimatedBitmap.new("Graphics/Pictures/pokedexInBox")
@pokeballOwned=AnimatedBitmap.new("Graphics/Pictures/pokedexOwned")
@pokeballSeen=AnimatedBitmap.new("Graphics/Pictures/pokedexSeen")
@commands=[]
super(x,y,width,height)
self.windowskin=nil
self.baseColor=Color.new(88,88,80)
self.shadowColor=Color.new(168,184,184)
end
def initialize(x,y,width,height)
@pokeballInBox=AnimatedBitmap.new("Graphics/Pictures/pokedexInBox")
@pokeballOwned=AnimatedBitmap.new("Graphics/Pictures/pokedexOwned")
@pokeballSeen=AnimatedBitmap.new("Graphics/Pictures/pokedexSeen")
@commands=[]
super(x,y,width,height)
self.windowskin=nil
self.baseColor=Color.new(88,88,80)
self.shadowColor=Color.new(168,184,184)
end
Offcourse I've also placed the right images in the right folders.
When I try to test it, it gives no error, but when I open the Pokédex the game crashes.
No error or error log, just not responding.
Any idea what I've done wrong?
Any help is appriciated
P.S. sorry if my English isn't good, it's not my first language.