• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Custom Feature Question] Changing the sprite positioning of alternate form of a Pokemon.

76
Posts
8
Years
    • Seen Oct 6, 2017
    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
    1,270
    Posts
    15
    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
    Code:
    "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
    }
     
    76
    Posts
    8
    Years
    • Seen Oct 6, 2017
    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
    Code:
    "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.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    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':

    Code:
    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'

    Code:
      def formOffsetY
        return nil if [email protected]
        return @pokemon.formOffsetY
      end

    in 'PokeBattle_Scene', search 'def pbChangeSpecies(attacker,species)' and replace
    Code:
    pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index)
    to
    Code:
    pkmn.y=adjustBattleSpriteY(pkmn,species,attacker.index,nil,true,attacker.pokemon.formOffsetY)

    Then, in 'def pbChangePokemon(attacker,pokemon)' do the same. Search:
    Code:
    pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index)
    and replace to:
    Code:
    pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index,nil,true,attacker.pokemon.formOffsetY)

    Now, go to 'Pokemon_Forms' and search
    Code:
      def form=(value)
        @form=value
        MultipleForms.call("onSetForm",self,value)
        self.calcStats
        pbSeenForm(self)
      end
    Add below:
    Code:
      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
    Code:
    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:
    Code:
    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
     

    Attachments

    • Sem título.png
      Sem título.png
      34.7 KB · Views: 35
    Last edited:

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Sorry to necropost but i really want to use it.
    Spoiler:

    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

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    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
     
    Last edited:
    38
    Posts
    8
    Years
    • Seen Aug 10, 2021
    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
    Code:
    "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?
     
    Back
    Top