Help - Search - Members - Calendar
Full Version: Game Resolution and Battler Position
RPG RPG Revolution Forums > Scripting > Script Development and Support
noktaris
Edit: This post is probably moot, because I realized I could just offset animations in the animations tab to solve this issue. That said, if anyone knows how to offset the default position of enemy battlers without affecting actors, I'd still appreciate the hint.

--

I've been working with a script that readjusts VX's resolution to 640x480. I've solved most of the problems that occur as a side-effect of changing VX's resolution, aside from one major problem that I'm stuck on: battlers.

My problem is that enemy battlers are no longer centered on the default front-facing system.

I've tried adjusting the viewports in Spriteset_Battle and Sprite_Battler without much luck. Changing these values solves the problem:
CODE
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if @battler == nil
      self.bitmap = nil
    else
      @use_sprite = @battler.use_sprite?
      if @use_sprite
        self.x = @battler.screen_x + 48 #added to adjust for 480p
        self.y = @battler.screen_y + 70 #added to adjust for 480p
        self.z = @battler.screen_z
        update_battler_bitmap
      end
      setup_new_effect
      update_effect
    end
  end


However, this also affects actor battlers, which throws off animations targeting actors. Meanwhile, animations targeting enemies work fine.

I'm basically looking for a way to offset the default enemy battler locations so that they're centered normally again.
Helios
Try this:

CODE
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Create Viewport
  #--------------------------------------------------------------------------
  def create_viewports
    @viewport1 = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport2 = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport3 = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport2.z = 50
    @viewport3.z = 100
  end
  #--------------------------------------------------------------------------
  # * Create Enemy Sprite
  #--------------------------------------------------------------------------
  def create_enemies
    @enemy_sprites = []
    for enemy in $game_troop.members.reverse
      enemy.screen_x += 48
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
  end
  #--------------------------------------------------------------------------
  # * Create Battleback Sprite
  #--------------------------------------------------------------------------
  def create_battleback
    source = $game_temp.background_bitmap
    bitmap = Bitmap.new(Graphics.width + 96, Graphics.height + 64)
    bitmap.stretch_blt(bitmap.rect, source, source.rect)
    bitmap.radial_blur(90, 12)
    @battleback_sprite = Sprite.new(@viewport1)
    @battleback_sprite.bitmap = bitmap
    @battleback_sprite.ox = 320+48
    @battleback_sprite.oy = 240+32
    @battleback_sprite.x = 272+48
    @battleback_sprite.y = 176+32
    @battleback_sprite.wave_amp = 8
    @battleback_sprite.wave_length = 240
    @battleback_sprite.wave_speed = 120
  end
  #--------------------------------------------------------------------------
  # * Create Battlefloor Sprite
  #--------------------------------------------------------------------------
  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    @battlefloor_sprite.bitmap = Cache.system("BattleFloor")
    @battlefloor_sprite.x = 0+64
    @battlefloor_sprite.y = 192
    @battlefloor_sprite.z = 1
    @battlefloor_sprite.opacity = 128
  end
end
noktaris
PERFECT - thank you so much! This saves me from having to reposition all of my animations.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.