Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Game Resolution and Battler Position
noktaris
post Jun 3 2011, 08:47 PM
Post #1



Group Icon

Group: Member
Posts: 4
Type: None
RM Skill: Undisclosed




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.

This post has been edited by noktaris: Jun 3 2011, 09:24 PM
Go to the top of the page
 
+Quote Post
   
Helios
post Jun 4 2011, 02:31 AM
Post #2


Level 4
Group Icon

Group: Member
Posts: 54
Type: None
RM Skill: Undisclosed




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


This post has been edited by Helios: Jun 4 2011, 02:31 AM


__________________________
ERROR: NO ERROR DETECTED
Go to the top of the page
 
+Quote Post
   
noktaris
post Jun 4 2011, 09:47 AM
Post #3



Group Icon

Group: Member
Posts: 4
Type: None
RM Skill: Undisclosed




PERFECT - thank you so much! This saves me from having to reposition all of my animations.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 08:46 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker