Advertiser Content
Non-binary
Seen 1 Hour Ago
Posted 21 Hours Ago
65 posts
3 Years
Its me Mario!
Hello all. I’m having an issue. Currently, I’m about to change a Pokémon’s icon position in the Storage system but only for a specific Species such as when its number is 1050 or above. Any ideas how to fix it? I’m using Essentials 16.2
ΚΟΡΑ ΚΟΡΕ RPG MAKER XP
http://el.poke-kore.wikia.com/wiki/Qora#Λήψη - Download
http://el.poke-kore.wikia.com/wiki/Qora or just read the greek documentation (Note: May require google translator to read this in English)

My favorite Pokémon from the official games are Alcremie and Keklneon.

My favorite own self made Pokémon are Wikimedia and Frikipaideia

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 1 Hour Ago
859 posts
1.2 Years
You need to make some edition in 'Pokemon_Sprites' script, into 'class PokemonIconSprite < SpriteWrapper'. What I did when I used Full Melmetal's icon sprite, maybe can help to undestand what to do:
Spoiler:

#===============================================================================
# Pokémon icon (for defined Pokémon)
#===============================================================================
class PokemonIconSprite < SpriteWrapper
  attr_accessor :selected
  attr_accessor :active
  attr_reader :pokemon
  attr_reader :shiny#
  attr_reader :species#
  
  def initialize(pokemon,viewport=nil)
    super(viewport)
    @animbitmap=nil
    @frames=[
       #Rect.new(64,0,64,64) # First Original
       #Rect.new(0,0,64,64) # Second Original
       Rect.new(0,0,100,100), # First Edited
       Rect.new(0,0,100,100) # Second
    ]
    @framesegg=[
       Rect.new(64,0,64,64),
       Rect.new(0,0,64,64)
    ]
    @selected=false
    @animframe=0
    @animframeegg=0#
    @active=false
    self.pokemon=pokemon
    @frame=0
    @pokemon=pokemon
    @adjusted_x=0
    @adjusted_y=0
    @logical_x=0
    @logical_y=0
  end

  def pokemon=(value)
    @pokemon=value
    @animbitmap.dispose if @animbitmap
    @animbitmap=nil
    if @pokemon
      @animbitmap=AnimatedBitmap.new(pbPokemonIconFile(value))
      self.bitmap=@animbitmap.bitmap
      self.src_rect=@frames[@animframe]
      self.src_rect=@framesegg[@animframeegg] if @pokemon.egg?#
    else
      self.bitmap=nil
    end
  end

  def dispose
    @animbitmap.dispose if @animbitmap
    super
  end

  def x
    @logical_x
  end

  def y
    @logical_y
  end

  def x=(value)
    @logical_x=value
    super(@logical_x+@adjusted_x)
  end

  def y=(value)
    @logical_y=value
    super(@logical_y+@adjusted_y)
  end

  def update
    @updating=true
    super
    if @animbitmap
      @animbitmap.update
      self.bitmap=@animbitmap.bitmap 
      self.src_rect=@frames[@animframe]
      self.src_rect=@framesegg[@animframeegg] if @pokemon.egg?#
    end
    self.color=Color.new(0,0,0,0)
    frameskip=5
    frameskip=10 if @pokemon && @pokemon.hp<=(@pokemon.totalhp/2)
    frameskip=20 if @pokemon && @pokemon.hp<=(@pokemon.totalhp/4)
    frameskip=-1 if @pokemon && @pokemon.hp==0
    if frameskip==-1
      @animframe=0
      @animframeegg=0
      self.src_rect=@frames[@animframe]
      self.src_rect=@framesegg[@animframeegg] if @pokemon.egg?#
    else
      @frame+=1
      @frame=0 if @frame>100
      if @frame>=frameskip
        @animframe=(@animframe==1) ? 0 : 1
        @animframeegg=(@animframeegg==1) ? 0 : 1
        self.src_rect=@frames[@animframe]
        self.src_rect=@framesegg[@animframeegg] if @pokemon.egg?#
        @frame=0
      end
    end
    if self.selected
      #if isConst?(@pokemon.species,PBSpecies,:MELMETAL)
        #@adjusted_x=-26#
      #else#
      if @pokemon.egg?
        @adjusted_x=(@animframeegg==1) ? -6 : -14
      else
        @adjusted_x=-14#
      end
      #end
      if @pokemon.egg?##
        @adjusted_y=(@animframeegg==0) ? 10 : 12## 4 e 10
      else##
        @adjusted_y=(@animframe==0) ? -2 : 6#
      end##
    else#
      #if isConst?(@pokemon.species,PBSpecies,:MELMETAL)
        #@adjusted_x=-26#
      #else#
      if @pokemon.egg?
        @adjusted_x=(@animframeegg==1) ? -8 : -16
      else
        @adjusted_x=-16
      end
      #end#
      if @pokemon.egg?##
        @adjusted_y=(@animframeegg==0) ? 6 : 10## 10 e 12 #custom 4 e 10
      else##
        @adjusted_y=(@animframe==0) ? 10 : 12
      end##
    end
    @updating=false
    self.x=self.x
    self.y=self.y
  end
end



#===============================================================================
# Pokémon icon (for species)
#===============================================================================
class PokemonSpeciesIconSprite < SpriteWrapper
  attr_accessor :selected
  attr_accessor :active
  attr_reader :species
  attr_reader :gender
  attr_reader :form
  attr_reader :shiny
  attr_reader :x
  attr_reader :y

  def initialize(species,viewport=nil)
    super(viewport)
    @animbitmap=nil
    @frames=[
       #Rect.new(0,0,64,64),
       #Rect.new(64,0,64,64)
       Rect.new(0,0,100,100),#
       Rect.new(0,0,100,100)#
    ]
    @animframe=0
    @frame=0
    @x=0
    @y=0
    @species=species
    @gender=0
    @form=0
    @shiny=false
    refresh
  end

  def species=(value)
    @species=value
    refresh
  end

  def gender=(value)
    @gender=value
    refresh
  end

  def form=(value)
    @form=value
    refresh
  end
  
  def shiny=(value)
    @shiny=value
    refresh
  end

  def pbSetParams(species,gender,form,shiny=false)
    @species=species
    @gender=gender
    @form=form
    @shiny=shiny
    refresh
  end

  def dispose
    @animbitmap.dispose if @animbitmap
    super
  end

  def x=(value)
    @x=value
    super(@x)
  end

  def y=(value)
    @y=value
    super(@y)
  end

  def refresh
    @animbitmap.dispose if @animbitmap
    @animbitmap=nil
    bitmapFileName=pbCheckPokemonIconFiles([@species,(@gender==1),@shiny,@form,false])
    @animbitmap=AnimatedBitmap.new(bitmapFileName)
    self.bitmap=@animbitmap.bitmap
    self.src_rect=@frames[@animframe]
  end

  def update
    @updating=true
    super
    if @animbitmap
      @animbitmap.update
      self.bitmap=@animbitmap.bitmap 
      self.src_rect=@frames[@animframe]
    end
    frameskip=5
    @frame+=1
    @frame=0 if @frame>10
    if @frame>=frameskip
      @animframe=(@animframe==1) ? 0 : 1
      self.src_rect=@frames[@animframe]
      @frame=0
    end
    @updating=false
    self.x=self.x
    self.y=self.y
  end
end
Non-binary
Seen 1 Hour Ago
Posted 21 Hours Ago
65 posts
3 Years
I have already done everything and it fixed everything bar the icon in the Storage System. Unfortunately it must require editions in the storage system script section since it is the x value it has to be edited. I will give screenshots soon for the bug. All you sent me to do are done already. I will give you screenshots for comparison between alignments of Melmetal’s sprite. On the 3rd pic, ignore Solgaleo Battler sprite and note that Melmetal’s icon should have been shifted to the left by 8 pixels compared to other sprites
ΚΟΡΑ ΚΟΡΕ RPG MAKER XP
http://el.poke-kore.wikia.com/wiki/Qora#Λήψη - Download
http://el.poke-kore.wikia.com/wiki/Qora or just read the greek documentation (Note: May require google translator to read this in English)

My favorite Pokémon from the official games are Alcremie and Keklneon.

My favorite own self made Pokémon are Wikimedia and Frikipaideia

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 1 Hour Ago
859 posts
1.2 Years
For Pokémon Storage, I edited inside 'PScreen_PokemonStorage' script:

Spoiler:

#===============================================================================
# Pokémon icons
#===============================================================================
class PokemonBoxIcon < IconSprite
  def initialize(pokemon,viewport=nil)
    super(0,0,viewport)
    @pokemon = pokemon
    @release = Interpolator.new
    @startRelease = false
    self.setBitmap(pbPokemonIconFile(pokemon)) if pokemon
    #self.src_rect = Rect.new(0,0,64,64)
    self.src_rect = Rect.new(0,0,100,64)#
  end
  def update
    @updating = true
    super
    heldpkmn = heldPokemon
    heldpkmn.update if heldpkmn
    @handsprite.update
    @holding = false if !heldpkmn
    if @grabbingState>0
      if @grabbingState<=8
        @handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
        self.y = @spriteY+(@grabbingState)*2
        @grabbingState += 1
      elsif @grabbingState<=16
        @holding = true
        @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
        self.y = @spriteY+(16-@grabbingState)*2
        @grabbingState += 1
      else
        @grabbingState = 0
      end
    elsif @placingState>0
      if @placingState<=8
        @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
        self.y = @spriteY+(@placingState)*2
        @placingState += 1
      elsif @placingState<=16
        @holding = false
        @heldpkmn = nil
        @handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
        self.y = @spriteY+(16-@placingState)*2
        @placingState += 1
      else
        @placingState = 0
      end
    elsif holding?
      @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
      @handsprite.x = @spriteX+15#
    else
      self.x = @spriteX+15#
      #self.x = @spriteX
      self.y = @spriteY
      if (@frame/20)==0
        @handsprite.changeBitmap((@quickswap) ? "point1q" : "point1")
      else
        @handsprite.changeBitmap((@quickswap) ? "point2q" : "point2")
      end
    end
    @frame += 1
    @frame = 0 if @frame==40
    @updating = false
  end
end
  def refresh
    if @refreshBox
      boxname = @storage[@boxnumber].name
      getBoxBitmap
      @contents.blt(0,0,@boxbitmap.bitmap,Rect.new(0,0,324,296))
      pbSetSystemFont(@contents)
      widthval = @contents.text_size(boxname).width
      xval = 162-(widthval/2)
      pbDrawShadowText(@contents,xval,8,widthval,32,boxname,Color.new(248,248,248),Color.new(40,48,48))
      @refreshBox = false
    end
    yval = self.y+30
    for j in 0...5
      xval = self.x+10
      for k in 0...6
        sprite = @pokemonsprites[j*6+k]
        if sprite && !sprite.disposed?
          sprite.viewport = self.viewport
          sprite.x = xval - 6 #xval
          sprite.y = yval + 4 #yval
          sprite.z = 0
        end
        xval += 48
      end
      yval += 48
    end
  end

Maybe can help you too.
Non-binary
Seen 1 Hour Ago
Posted 21 Hours Ago
65 posts
3 Years
For Pokémon Storage, I edited inside 'PScreen_PokemonStorage' script:

Spoiler:

#===============================================================================
# Pokémon icons
#===============================================================================
class PokemonBoxIcon < IconSprite
  def initialize(pokemon,viewport=nil)
    super(0,0,viewport)
    @pokemon = pokemon
    @release = Interpolator.new
    @startRelease = false
    self.setBitmap(pbPokemonIconFile(pokemon)) if pokemon
    #self.src_rect = Rect.new(0,0,64,64)
    self.src_rect = Rect.new(0,0,100,64)#
  end
  def update
    @updating = true
    super
    heldpkmn = heldPokemon
    heldpkmn.update if heldpkmn
    @handsprite.update
    @holding = false if !heldpkmn
    if @grabbingState>0
      if @grabbingState<=8
        @handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
        self.y = @spriteY+(@grabbingState)*2
        @grabbingState += 1
      elsif @grabbingState<=16
        @holding = true
        @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
        self.y = @spriteY+(16-@grabbingState)*2
        @grabbingState += 1
      else
        @grabbingState = 0
      end
    elsif @placingState>0
      if @placingState<=8
        @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
        self.y = @spriteY+(@placingState)*2
        @placingState += 1
      elsif @placingState<=16
        @holding = false
        @heldpkmn = nil
        @handsprite.changeBitmap((@quickswap) ? "grabq" : "grab")
        self.y = @spriteY+(16-@placingState)*2
        @placingState += 1
      else
        @placingState = 0
      end
    elsif holding?
      @handsprite.changeBitmap((@quickswap) ? "fistq" : "fist")
      @handsprite.x = @spriteX+15#
    else
      self.x = @spriteX+15#
      #self.x = @spriteX
      self.y = @spriteY
      if (@frame/20)==0
        @handsprite.changeBitmap((@quickswap) ? "point1q" : "point1")
      else
        @handsprite.changeBitmap((@quickswap) ? "point2q" : "point2")
      end
    end
    @frame += 1
    @frame = 0 if @frame==40
    @updating = false
  end
end
  def refresh
    if @refreshBox
      boxname = @storage[@boxnumber].name
      getBoxBitmap
      @contents.blt(0,0,@boxbitmap.bitmap,Rect.new(0,0,324,296))
      pbSetSystemFont(@contents)
      widthval = @contents.text_size(boxname).width
      xval = 162-(widthval/2)
      pbDrawShadowText(@contents,xval,8,widthval,32,boxname,Color.new(248,248,248),Color.new(40,48,48))
      @refreshBox = false
    end
    yval = self.y+30
    for j in 0...5
      xval = self.x+10
      for k in 0...6
        sprite = @pokemonsprites[j*6+k]
        if sprite && !sprite.disposed?
          sprite.viewport = self.viewport
          sprite.x = xval - 6 #xval
          sprite.y = yval + 4 #yval
          sprite.z = 0
        end
        xval += 48
      end
      yval += 48
    end
  end

Maybe can help you too.

Yes but unfortunately I need this for specific species only, not for all since the it will break existing icon’s position
ΚΟΡΑ ΚΟΡΕ RPG MAKER XP
http://el.poke-kore.wikia.com/wiki/Qora#Λήψη - Download
http://el.poke-kore.wikia.com/wiki/Qora or just read the greek documentation (Note: May require google translator to read this in English)

My favorite Pokémon from the official games are Alcremie and Keklneon.

My favorite own self made Pokémon are Wikimedia and Frikipaideia

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 1 Hour Ago
859 posts
1.2 Years
So you need to find or create some code to return true if pokedexNumber>x or something like. I did a code about footsprint, adding each pokémon (name), maybe (unfortunately) you need to do that. Here the link if you want:

https://www.pokecommunity.com/showthread.php?p=10029025#post10029025

Good luck!
Non-binary
Seen 1 Hour Ago
Posted 21 Hours Ago
65 posts
3 Years
So you need to find or create some code to return true if pokedexNumber>x or something like. I did a code about footsprint, adding each pokémon (name), maybe (unfortunately) you need to do that. Here the link if you want:

https://www.pokecommunity.com/showthread.php?p=10029025#post10029025

Good luck!
Well, I intended to do that and it seems it got fixed well bar when the sprite is grabbed
ΚΟΡΑ ΚΟΡΕ RPG MAKER XP
http://el.poke-kore.wikia.com/wiki/Qora#Λήψη - Download
http://el.poke-kore.wikia.com/wiki/Qora or just read the greek documentation (Note: May require google translator to read this in English)

My favorite Pokémon from the official games are Alcremie and Keklneon.

My favorite own self made Pokémon are Wikimedia and Frikipaideia
Advertiser Content