• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

[Scripting Question] Double Battle Sprite Positions

B+

  • 32
    Posts
    4
    Years
    • Seen Feb 18, 2025
    Hi,

    I'm in need of spacing out the sprite positions of Pokemon in double battles. I've been looking in PokeBattle_SceneElements > Pokemon sprite, but nothing stands out to me as the obvious script for double battles. Where should I be looking?
     
    Look inside PokeBattle_SceneElements under the function "def self.pbBattlerPosition(index,sideSize=1)". This is the section that handles double battles:
    Code:
    case sideSize
        when 2
          ret[0] += [-48, 48, 32, -32][index]
          ret[1] += [  0,  0, 16, -16][index]
    The first row of values are x-offsets, and the second are y-offsets, so each column is a set of offsets for a specific battler. The order of battlers is as follows:

    Player's left battler, foe's right battler, player's right battler, foe's left battler

    For example, the foe's right battler has +48 added to its x-position and 0 added to its y-position (the second column). You want to space out the battlers, so maybe you could try making the 48 a bit higher, like 54 or so. In general, give the right-side battlers a slightly higher x-offset and the left-side battlers a slightly lower x-offset (since those are negative). You could try this out as an example (adding/subtracting 6 to the appropriate x-offsets):
    Code:
    case sideSize
        when 2
          ret[0] += [-54, 54, 38, -38][index]
          ret[1] += [  0,  0, 16, -16][index]
     
    Look inside PokeBattle_SceneElements under the function "def self.pbBattlerPosition(index,sideSize=1)". This is the section that handles double battles:
    Code:
    case sideSize
        when 2
          ret[0] += [-48, 48, 32, -32][index]
          ret[1] += [  0,  0, 16, -16][index]
    The first row of values are x-offsets, and the second are y-offsets, so each column is a set of offsets for a specific battler. The order of battlers is as follows:

    Player's left battler, foe's right battler, player's right battler, foe's left battler

    For example, the foe's right battler has +48 added to its x-position and 0 added to its y-position (the second column). You want to space out the battlers, so maybe you could try making the 48 a bit higher, like 54 or so. In general, give the right-side battlers a slightly higher x-offset and the left-side battlers a slightly lower x-offset (since those are negative). You could try this out as an example (adding/subtracting 6 to the appropriate x-offsets):
    Code:
    case sideSize
        when 2
          ret[0] += [-54, 54, 38, -38][index]
          ret[1] += [  0,  0, 16, -16][index]

    You've been a big help. Thank you for the knowledge.
     
    Back
    Top