Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

FFX-2 CBS Edit / CBS Request Similar

Taylor

Sponsor

Most people use a 640x480 game size, however I have a script that changes the size to 480x320 (double GBA size). Most of my scripts have been reletivly (gah i cnt spel) easy to squeeze into the new resolution, but I find that the ffx-2 CBS is too complicated for me. oO

Here are the scripts I use to resize the game screen- use them to help get an idea of where to shift everything.
Code:
#==============================================================================
# â–  Win32API
#------------------------------------------------------------------------------
# by Squall squall@loeher.znn.com
# Change the window size
# I must thank cybersam for his mouse and keyboard scripts. they were very
# useful finding some winapi function.
#
# !! this script MUST be on top of all other or the game will crash,
#    if you use scripts to enlarge maps!
#==============================================================================

class Win32API
 #--------------------------------------------------------------------------
 # - define constant
 #--------------------------------------------------------------------------
 GAME_INI_FILE = ".\\Game.ini"         # define "Game.ini" file
 HWND_TOPMOST = 1                      # window always active
 HWND_TOP = -1                         # window active when used only
 SWP_NOMOVE   = 1                      # window pos and sizes can be changed
 #--------------------------------------------------------------------------
 # - Win32API.GetPrivateProfileString // check your game title in Game.ini
 #--------------------------------------------------------------------------
 def Win32API.GetPrivateProfileString(section, key)
   val = "\0"*256
   gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
   gps.call(section, key, "", val, 256, GAME_INI_FILE)
   val.delete!("\0")
   return val
 end
 #--------------------------------------------------------------------------
 # - Win32API.FindWindow // find the RGSS window
 #--------------------------------------------------------------------------
 def Win32API.FindWindow(class_name, title)
   fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
   hWnd = fw.call(class_name, title)
   return hWnd
 end
 #--------------------------------------------------------------------------
 # - Win32API.SetWindowPos // change window positions and sizes
 #--------------------------------------------------------------------------
 def Win32API.SetWindowPos(w, h)
   title =  Win32API.GetPrivateProfileString("Game", "Title")
   hWnd = Win32API.FindWindow("RGSS Player", title)
   swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
   win = swp.call(hWnd, HWND_TOP, 240, 240, w + 6, h + 25, 0)
   
   #the line below makes the window on top of all others
   #win = swp.call(hWnd, HWND_TOPMOST, 0, 0, w + 6, h + 32, SWP_NOMOVE)
   return win
 end
 #--------------------------------------------------------------------------
 # - Win32API.client_size // check the window width and height
 #--------------------------------------------------------------------------
 def Win32API.client_size
   title =  Win32API.GetPrivateProfileString("Game", "Title")
   hWnd = Win32API.FindWindow("RGSS Player", title)
   rect = [0, 0, 0, 0].pack('l4')
   Win32API.new('user32', 'GetClientRect', %w(l p), 'i').call(hWnd, rect)
   width, height = rect.unpack('l4')[2..3]
   return width, height
 end
end

#==============================================================================
# - proceed with creation of the window
#------------------------------------------------------------------------------
# the width and height variables set the screen size.
#==============================================================================
 $width = 480
 $height = 320
 win = Win32API.SetWindowPos($width, $height)
 if(win == 0)
   p "Size change has failed!"
 end
Code:
#==============================================================================
# â–  Game_Player
#------------------------------------------------------------------------------
#  remade to be compatible with change sreen size script
#==============================================================================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● define constant
#--------------------------------------------------------------------------
CENTER_X = ($width/2 - 16) * 4    # X coordinate in the center of the screen
CENTER_Y = ($height/2 - 16) * 4   # Y coordinate in the center of the screen
end

#==============================================================================
# â–  Spriteset_Map //squall@loeher.zzn.com
#------------------------------------------------------------------------------
# remade to be compatible with change sreen size script
#==============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
 if $game_map.width >= 25 and $game_map.height >= 19
   $width2 = $width
   $height2 = $height
 elsif $game_map.width >= 25 and $game_map.height < 19
   $width2 = $width
   $height2 = 480
 elsif $game_map.width < 25 and $game_map.height >= 19
   $width2 = 640
   $height2 = $height
 elsif $game_map.width < 25 and $game_map.height < 19
   $width2 = 640
   $height2 = 480
 else
   $width2 = $width
   $height2 = $height
 end
  @viewport1 = Viewport.new(0, 0, $width2, $height2)
  @viewport2 = Viewport.new(0, 0, $width2, $height2)
  @viewport3 = Viewport.new(0, 0, $width2, $height2)
  @viewport4 = Viewport.new(640, 0, $width2-640, 480)
  @viewport5 = Viewport.new(0, 480, 640, $height2-480)
  @viewport6 = Viewport.new(640, 480, $width2-640, $height2-480)
 
@viewport2.z = 200
@viewport3.z = 5000

@tilemap = Tilemap.new(@viewport2)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

for i in 0..6
  autotile_name = $game_map.autotile_names[i]
  @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities

@panorama = Plane.new(@viewport2)
@panorama.z = -1000

@fog = Plane.new(@viewport2)
@fog.z = 3000

@character_sprites = []
for i in $game_map.events.keys.sort
  sprite = Sprite_Character.new(@viewport2, $game_map.events[i])
  @character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport2, $game_player))

@weather = RPG::Weather.new(@viewport2)

@picture_sprites = []
for i in 1..50
  @picture_sprites.push(Sprite_Picture.new(@viewport2, $game_screen.pictures[i]))
end

@timer_sprite = Sprite_Timer.new

@tilemap2 = Tilemap.new(@viewport4)
@tilemap2.tileset = RPG::Cache.tileset($game_map.tileset_name)
@tilemap3 = Tilemap.new(@viewport5)
@tilemap3.tileset = RPG::Cache.tileset($game_map.tileset_name)
@tilemap4 = Tilemap.new(@viewport6)
@tilemap4.tileset = RPG::Cache.tileset($game_map.tileset_name)

for i in 0..6
  autotile_name = $game_map.autotile_names[i]
  @tilemap2.autotiles[i] = RPG::Cache.autotile(autotile_name)
  @tilemap3.autotiles[i] = RPG::Cache.autotile(autotile_name)
  @tilemap4.autotiles[i] = RPG::Cache.autotile(autotile_name)
end

@tilemap2.map_data = $game_map.data
@tilemap3.map_data = $game_map.data
@tilemap4.map_data = $game_map.data

update
end
#--------------------------------------------------------------------------
# ● Dispose the sprite
#--------------------------------------------------------------------------
def dispose

@tilemap.tileset.dispose
@tilemap2.tileset.dispose
@tilemap3.tileset.dispose
@tilemap4.tileset.dispose

for i in 0..6
  @tilemap.autotiles[i].dispose
  @tilemap2.autotiles[i].dispose
  @tilemap3.autotiles[i].dispose
  @tilemap4.autotiles[i].dispose
end

@tilemap.dispose
@tilemap2.dispose
@tilemap3.dispose
@tilemap4.dispose

@panorama.dispose
@fog.dispose

 for sprite in @character_sprites
   sprite.dispose
 end

@weather.dispose

for sprite in @picture_sprites
  sprite.dispose
end

@timer_sprite.dispose
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose

@viewport4.dispose
@viewport5.dispose
@viewport6.dispose
end
#--------------------------------------------------------------------------
# ● Update the sprite
#--------------------------------------------------------------------------
def update

if @panorama_name != $game_map.panorama_name or
   @panorama_hue != $game_map.panorama_hue
  @panorama_name = $game_map.panorama_name
  @panorama_hue = $game_map.panorama_hue
  if @panorama.bitmap != nil
    @panorama.bitmap.dispose
    @panorama.bitmap = nil
  end
  if @panorama_name != ""
    @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
  end
  Graphics.frame_reset
end

if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
  @fog_name = $game_map.fog_name
  @fog_hue = $game_map.fog_hue
  if @fog.bitmap != nil
    @fog.bitmap.dispose
    @fog.bitmap = nil
  end
  if @fog_name != ""
    @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
  end
  Graphics.frame_reset
end

@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update

@tilemap2.ox = @tilemap.ox + 640
@tilemap2.oy = @tilemap.oy
@tilemap2.update

@tilemap3.ox = @tilemap.ox
@tilemap3.oy = @tilemap.oy + 480
@tilemap3.update

@tilemap4.ox = @tilemap.ox + 640
@tilemap4.oy = @tilemap.oy + 480
@tilemap4.update

@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8

@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone

for sprite in @character_sprites
  sprite.update
end

@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.ox = $game_map.display_x / 4
@weather.oy = $game_map.display_y / 4
@weather.update

for sprite in @picture_sprites
  sprite.update
end

@timer_sprite.update

@viewport3.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport3.color = $game_screen.flash_color
@viewport1.update
@viewport3.update
end
end

class Game_Map
 #--------------------------------------------------------------------------
# ● Scroll the map down
#     distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_down(distance)
if $height / 32.0 < self.height - 1
  @display_y = [@display_y + distance, (self.height - ($height / 32.0)) * 128].min
else
  @display_y = [@display_y + distance, (self.height - 15) * 128].min
end
end
#--------------------------------------------------------------------------
# ● Scroll the map left
#     distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_left(distance)
 @display_x = [@display_x - distance, 0].max
end
#--------------------------------------------------------------------------
# ● Scroll the map right
#     distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_right(distance)
if $width / 32.0 < self.width - 1
  @display_x = [@display_x + distance, (self.width - ($width / 32.0)) * 128].min
else
  @display_x = [@display_x + distance, (self.width - 20) * 128].min
end
end
#--------------------------------------------------------------------------
# ● Scroll the map up
#     distance : Distance to scroll in real units (4 = 1 pixel).
#--------------------------------------------------------------------------
def scroll_up(distance)
 @display_y = [@display_y - distance, 0].max
end
end
(Does not include map fixes beause you won't need 'em)

Extra edits I want include-
1. No 'Skills' menu.
2. No ATK/PDEF/MDEF in Status or Equip. In Equip use the four other status to show the influence of euipment.
3. Because I'm using the animated battlers, do not use a battler in the status screen, have the status window take up most of the screen instead of leaving a space for the battler.
4. There are only three heroes in a party at once, this'll give more room for the main menu statuseses....es
5. Normally '32' is used to space out items, lists, lines etc. I've been using '24'. Allows more in a smaller space.
6. Don't worry about images, just give them a re-sizing in Paint. I cannot picture how it'll look so I can't tell how big the images will be.

EDIT: My faces are directly in Pictures/, are 84x84 and are named 'face_[heroname]' e.g face_jirby

If there is anything else you need to know. Feel free to ask.
Thanks in advance. Credit will be given. (dur)
(Off topic: This emote is FREAKING CREEPY -> :yes: D: )
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top