Advertiser Content
Seen October 6th, 2017
Posted January 2nd, 2016
76 posts
4.2 Years
How would I go about changing the sprite positioning of an alternate form of a Pokemon? Ex, I would like to change the position of a Mega Pokemon in battle, but the Mega isn't listed in Pokemon.txt or the Sprite Positioner. I am using Gen 6 and Elite Battle.

Note: I would like to say that the sprites AREN'T positioned in the wrong place, I would just like them positioned differently.

Luka S.J.

Jealous Croatian

Age 26
Male
Croatia
Seen 3 Days Ago
Posted 3 Weeks Ago
1,145 posts
10.9 Years
Pokemon_MultipleForms

Add in Y = , X =

there is more but i forgot the rest....
I have no idea where on earth you're getting this from. There is nothing in stock Essentials, or even the gen 6 project that says you can just plot in random x and y variables (not to mention that your description of it is not really helpful either).

To answer the question, the Gen 6 Project offers Y offset per form, and my EBS takes that into account if one exists. To use them, you'd add the following entry to where your Pokemon's form is defined in Pokemon_MultipleForms
"getOffsetY"=>proc{|pokemon|
   next if pokemon.form==0              
   case pokemon.form
     when 1; next 45 # example Y coordinate
     when 2; next 60 # example Y coordinate
   end
}
Seen October 6th, 2017
Posted January 2nd, 2016
76 posts
4.2 Years
I have no idea where on earth you're getting this from. There is nothing in stock Essentials, or even the gen 6 project that says you can just plot in random x and y variables (not to mention that your description of it is not really helpful either).

To answer the question, the Gen 6 Project offers Y offset per form, and my EBS takes that into account if one exists. To use them, you'd add the following entry to where your Pokemon's form is defined in Pokemon_MultipleForms
"getOffsetY"=>proc{|pokemon|
   next if pokemon.form==0              
   case pokemon.form
     when 1; next 45 # example Y coordinate
     when 2; next 60 # example Y coordinate
   end
}
Thanks Luka, that's very helpful. However, I should've been more specific with my question.

I'd like to alter the positioning of each individual mega Pokémon.

Luka S.J.

Jealous Croatian

Age 26
Male
Croatia
Seen 3 Days Ago
Posted 3 Weeks Ago
1,145 posts
10.9 Years
Thanks Luka, that's very helpful. However, I should've been more specific with my question.

I'd like to alter the positioning of each individual mega Pokémon.
Mega Pokemon are just another Pokemon form. The same thing applies.

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 4 Hours Ago
Posted 5 Hours Ago
854 posts
1.2 Years
Sorry to necropost but i really want to use it.

Im usin EBS and PS v17.2 and i havent that "getOffsetY" and "Pokemon_MultipleForms". So i try to put in 'Pokemon_Forms':

MultipleForms.register(:NECROZMA,{
"getOffsetY"=>proc{|pokemon|
   next if pokemon.form==0              
   case pokemon.form
     when 1; next 33 # example Y coordinate
     when 2; next -4 # example Y coordinate
     when 3; next 0 # example Y coordinate
   end
}
})
But i havent that 'getOffsetY'. Can anyone share with me the 'def'?

EDIT:
Nvm! I found it!

add in 'PokeBattle_Battler' before 'attr_reader :level'

  def formOffsetY
    return nil if !@pokemon.formOffsetY
    return @pokemon.formOffsetY
  end
in 'PokeBattle_Scene', search 'def pbChangeSpecies(attacker,species)' and replace
pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index)
to
pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index,nil,true,attacker.pokemon.formOffsetY)
Then, in 'def pbChangePokemon(attacker,pokemon)' do the same. Search:
pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index)
and replace to:
pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index,nil,true,attacker.pokemon.formOffsetY)
Now, go to 'Pokemon_Forms' and search
  def form=(value)
    @form=value
    MultipleForms.call("onSetForm",self,value)
    self.calcStats
    pbSeenForm(self)
  end
Add below:
  def formOffsetY
    v=MultipleForms.call("getOffsetY",self)
    if v!=nil
      @formOffsetY=v if !@formOffsetY || v!=@formOffsetY
      return v
    end
    return @formOffsetY || 0
  end
Now, in 'Pokemon_Sprites', search to
def adjustBattleSpriteY(sprite,species,index,metrics=nil)
  ret = 0
  spriteheight = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.bitmap.height : 128
  ret -= spriteheight
  ret += getBattleSpriteMetricOffset(species,index,metrics)
  return ret
end
And replace to:
def adjustBattleSpriteY(sprite,species,index,metrics=nil,zoom=true,formOffsetY=nil)
  ret=0
  spriteheight=(sprite.bitmap &&
     !sprite.bitmap.disposed?) ? sprite.bitmap.height : 128
  spriteheight*=sprite.zoom_y if zoom==true
  ret-=spriteheight
  ret+=getBattleSpriteMetricOffset(species,index,metrics)
  ret+=formOffsetY if formOffsetY
  return ret
end

Luka S.J.

Jealous Croatian

Age 26
Male
Croatia
Seen 3 Days Ago
Posted 3 Weeks Ago
1,145 posts
10.9 Years
Sorry to necropost but i really want to use it.
Spoiler:

Im usin EBS and PS v17.2 and i havent that "getOffsetY" and "Pokemon_MultipleForms". So i try to put in 'Pokemon_Forms':

MultipleForms.register(:NECROZMA,{
"getOffsetY"=>proc{|pokemon|
   next if pokemon.form==0              
   case pokemon.form
     when 1; next 33 # example Y coordinate
     when 2; next -4 # example Y coordinate
     when 3; next 0 # example Y coordinate
   end
}
})
But i havent that 'getOffsetY'. Can anyone share with me the 'def'?

EDIT:
Nvm! I found it!

add in 'PokeBattle_Battler' before 'attr_reader :level'

  def formOffsetY
    return nil if !@pokemon.formOffsetY
    return @pokemon.formOffsetY
  end
in 'PokeBattle_Scene', search 'def pbChangeSpecies(attacker,species)' and replace
pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index)
to
pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index,nil,true,attacker.pokemon.formOffsetY)
Then, in 'def pbChangePokemon(attacker,pokemon)' do the same. Search:
pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index)
and replace to:
pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index,nil,true,attacker.pokemon.formOffsetY)
Now, go to 'Pokemon_Forms' and search
  def form=(value)
    @form=value
    MultipleForms.call("onSetForm",self,value)
    self.calcStats
    pbSeenForm(self)
  end
Add below:
  def formOffsetY
    v=MultipleForms.call("getOffsetY",self)
    if v!=nil
      @formOffsetY=v if !@formOffsetY || v!=@formOffsetY
      return v
    end
    return @formOffsetY || 0
  end
Now, in 'Pokemon_Sprites', search to
def adjustBattleSpriteY(sprite,species,index,metrics=nil)
  ret = 0
  spriteheight = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.bitmap.height : 128
  ret -= spriteheight
  ret += getBattleSpriteMetricOffset(species,index,metrics)
  return ret
end
And replace to:
def adjustBattleSpriteY(sprite,species,index,metrics=nil,zoom=true,formOffsetY=nil)
  ret=0
  spriteheight=(sprite.bitmap &&
     !sprite.bitmap.disposed?) ? sprite.bitmap.height : 128
  spriteheight*=sprite.zoom_y if zoom==true
  ret-=spriteheight
  ret+=getBattleSpriteMetricOffset(species,index,metrics)
  ret+=formOffsetY if formOffsetY
  return ret
end
No dude. Essentials v17 has it's own pokemonforms.txt in which you define the Y position for Pokemon forms (along with everything else), and the new versions of EBS take this value into account.

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 4 Hours Ago
Posted 5 Hours Ago
854 posts
1.2 Years
No dude. Essentials v17 has it's own pokemonforms.txt in which you define the Y position for Pokemon forms (along with everything else), and the new versions of EBS take this value into account.
I try to put in 'pokemonform' and didnt work (i tried usin fresh PE v17.2 too). But when i add 'formOffsetY', did works perfectly. :D
Male
Seen October 7th, 2019
Posted October 7th, 2019
22 posts
4.1 Years
I have no idea where on earth you're getting this from. There is nothing in stock Essentials, or even the gen 6 project that says you can just plot in random x and y variables (not to mention that your description of it is not really helpful either).

To answer the question, the Gen 6 Project offers Y offset per form, and my EBS takes that into account if one exists. To use them, you'd add the following entry to where your Pokemon's form is defined in Pokemon_MultipleForms
"getOffsetY"=>proc{|pokemon|
   next if pokemon.form==0              
   case pokemon.form
     when 1; next 45 # example Y coordinate
     when 2; next 60 # example Y coordinate
   end
}
I can see that can set the Y coordinate of the player.
But what about the opposing Pokémon? How can I set its Y position?
Advertiser Content