VX 스크립트

우연히 옛날에 올라온 해상도 스크립트를 봤는데요,

 

쓸만한 스크립트인데 몇가지 오류가 있어서 문해결하여 수정버젼 올립니다.

 

 

main  위에 삽입 하시면 됩니다 ^^;

 

첫 두줄의 640과 480을 각기 원하는 해상도로 바꿔주세요.

 

 

 

 

 

 

 

 

WIDTH = 640
HEIGHT = 480
DELTA_WIDTH   = (WIDTH - 544).abs
DELTA_HEIGHT = (HEIGHT - 416).abs

Graphics.resize_screen(WIDTH, HEIGHT)

class Game_Map
  alias tds_vx_resolution_change_setup_scroll setup_scroll
  def setup_scroll
    tds_vx_resolution_change_setup_scroll   
    @scroll_direction = 2
    @scroll_rest = 0
    @scroll_speed = 4
    @margin_x = (width - 20) * 256 / 2  
    @margin_y = (height - 15) * 256 / 2    
  end 
  alias tds_vx_resolution_change_calc_parallax_x calc_parallax_x
  def calc_parallax_x(bitmap)
    tds_vx_resolution_change_calc_parallax_x(bitmap)   
    if bitmap == nil
      return 0
    elsif @parallax_loop_x
      return @parallax_x / 16
    elsif loop_horizontal?
      return 0
    else
      w1 = bitmap.width - WIDTH
      w2 = @map.width * 32 - WIDTH
      if w1 <= 0 or w2 <= 0
        return 0
      else
        return @parallax_x * w1 / w2 / 8
      end
    end
  end
  alias tds_vx_resolution_change_calc_parallax_y calc_parallax_y 
  def calc_parallax_y(bitmap)
    tds_vx_resolution_change_calc_parallax_y(bitmap)   
    if bitmap == nil
      return 0
    elsif @parallax_loop_y
      return @parallax_y / 16
    elsif loop_vertical?
      return 0
    else
      h1 = bitmap.height - HEIGHT
      h2 = @map.height * 32 - HEIGHT
      if h1 <= 0 or h2 <= 0
        return 0
      else
        return @parallax_y * h1 / h2 / 8
      end
    end
  end
  def scroll_down(distance)
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance
    else
      last_y = @display_y
      @display_y = [@display_y + distance, (height - 15) * 256].min
      @parallax_y += @display_y - last_y
    end
  end
  def scroll_right(distance)
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance
    else
      last_x = @display_x
      @display_x = [@display_x + distance, (width - 20) * 256].min
      @parallax_x += @display_x - last_x
    end
  end
end

class Game_Player < Game_Character
 
  CENTER_X = (WIDTH / 2 - 16) * 8    
  CENTER_Y = (HEIGHT / 2 - 16) * 8    
  alias tds_vx_resolution_change_center center 
  def center(x, y)
    tds_vx_resolution_change_center(x, y)   
    display_x = x * 256 - CENTER_X                   
    unless $game_map.loop_horizontal?            
      max_x = ($game_map.width - 20) * 256   
      display_x = [0, [display_x, max_x].min].max  
    end
    display_y = y * 256 - CENTER_Y             
    unless $game_map.loop_vertical?                 
      max_y = ($game_map.height - 15) * 256  
      display_y = [0, [display_y, max_y].min].max  
    end
    $game_map.set_display_pos(display_x, display_y)  
  end
end

class Sprite_Base < Sprite
  alias tds_vx_resolution_change_start_animation start_animation 
  def start_animation(animation, mirror = false)
    tds_vx_resolution_change_start_animation(animation, mirror = false)   
    dispose_animation
    @animation = animation
    return if @animation == nil
    @animation_mirror = mirror
    @animation_duration = @animation.frame_max * 4 + 1
    load_animation_bitmap
    @animation_sprites = []
    if @animation.position != 3 or not @@animations.include?(animation)
      if @use_sprite
        for i in 0..15
          sprite = ::Sprite.new(viewport)
          sprite.visible = false
          @animation_sprites.push(sprite)
        end
        unless @@animations.include?(animation)
          @@animations.push(animation)
        end
      end
    end
    if @animation.position == 3
      if viewport == nil
        @animation_ox = WIDTH/ 2
        @animation_oy = HEIGHT / 2
      else
        @animation_ox = viewport.rect.width / 2
        @animation_oy = viewport.rect.height / 2
      end
    else
      @animation_ox = x - ox + width / 2
      @animation_oy = y - oy + height / 2
      if @animation.position == 0
        @animation_oy -= height / 2
      elsif @animation.position == 2
        @animation_oy += height / 2
      end
    end
  end
end


class Spriteset_Map
  def create_viewports
    @viewport1 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport3 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2.z = 50
    @viewport3.z = 100
  end
end

class Spriteset_Battle
  def create_viewports
    @viewport1 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport3 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2.z = 50
    @viewport3.z = 100
  end
end

class Window_Base < Window
  def x=(x)
    super(x + DELTA_WIDTH / 2)
  end
 
  def y=(y)
    super(y + DELTA_HEIGHT/ 2)
  end
end


class Scene_Battle < Scene_Base
  def create_info_viewport
    @info_viewport = Viewport.new(0, 288, WIDTH, HEIGHT)
    @info_viewport.z = 100
    @status_window = Window_BattleStatus.new
    @party_command_window = Window_PartyCommand.new
    @actor_command_window = Window_ActorCommand.new
    @status_window.viewport = @info_viewport
    @party_command_window.viewport = @info_viewport
    @actor_command_window.viewport = @info_viewport
    @status_window.x = 128
    @actor_command_window.x = 544
    @info_viewport.visible = false
  end
end

class Scene_Item < Scene_Base
   def start
    super
    create_menu_background
    @viewport = Viewport.new(0, 0, WIDTH, HEIGHT)
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @item_window = Window_Item.new(0, 56, 544, 360)
    @item_window.help_window = @help_window
    @item_window.active = false
    @target_window = Window_MenuStatus.new(0,  0)
    hide_target_window
  end
 
  def show_target_window(right)
    @item_window.active = false
    width_remain = WIDTH - @target_window.width
    @target_window.x = right ? width_remain : 0
    @target_window.visible = true
    @target_window.active = true
    if right
      @viewport.rect.set(0, 0, width_remain, HEIGHT)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, HEIGHT)
      @viewport.ox = @target_window.width
    end
  end
 
  def hide_target_window
    @item_window.active = true
    @target_window.visible = false
    @target_window.active = false
    @viewport.rect.set(0, 0, WIDTH, HEIGHT)
    @viewport.ox = 0
  end
end

class Scene_Skill < Scene_Base
  def start
    super
    create_menu_background
    @actor = $game_party.members[@actor_index]
    @viewport = Viewport.new(0, 0, WIDTH, HEIGHT)
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @status_window = Window_SkillStatus.new(0, 56, @actor)
    @status_window.viewport = @viewport
    @skill_window = Window_Skill.new(0, 112, 544, 304, @actor)
    @skill_window.viewport = @viewport
    @skill_window.help_window = @help_window
    @target_window = Window_MenuStatus.new(0, 0)
    hide_target_window
  end
 
  def show_target_window(right)
    @skill_window.active = false
    width_remain = WIDTH - @target_window.width
    @target_window.x = right ? width_remain : 0
    @target_window.visible = true
    @target_window.active = true
    if right
      @viewport.rect.set(0, 0, width_remain, HEIGHT)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, HEIGHT)
      @viewport.ox = @target_window.width
    end
  end

  def hide_target_window
    @skill_window.active = true
    @target_window.visible = false
    @target_window.active = false
    @viewport.rect.set(0, 0, WIDTH, HEIGHT)
    @viewport.ox = 0
  end
end


class Spriteset_Map
 
  alias tds_vx_resolution_change_create_viewports create_viewports
  def create_viewports
    tds_vx_resolution_change_create_viewports   
    @viewport1 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport3 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2.z = 50
    @viewport3.z = 100
  end
end

 

Comment '11'
  • profile
    천공대전 2011.07.19 17:05

    스크립트는 괜찮은데

    써보면 영...

     

  • ?
    카리스 2011.07.19 18:43

    기본적으로 이상한데는 수정했는데, 마음에 안드시는 부분 있으시거든 말씀해주세요 ^^;

  • profile
    천공대전 2011.08.06 11:53

    이제 잘 되는군요 감사합니다 ^^

  • ?
    석진이 2011.07.19 20:40

    아니설마, 이제 640x480제한이 아니라 아무 크기든지 가능하게 만드신겁니까???

  • ?
    카리스 2011.07.19 21:25

    한번 알아봐야겠습니다 그쪽도...  으워어어 너무 자기 비하하지 마세요 ㅜㅜㅜㅜ

    저도 정말 대단할거 없는 놈입니다;; 이 스크립트도 원래 있던거 수정한거에 지나지 않으니까요;;

  • ?
    석진이 2011.07.19 21:00

    그렇군요... dll을 아무나 손대는게 아니군요...  그래도 대단하십니다.  저같은놈은 상상도 할 수 없는 영역입니다.  스크립트들 만들어주셔서 감사합니다.

  • ?
    카리스 2011.07.19 20:44

    아니요 아쉽게도 저도 640x480입니다 ㅜㅜ

    기존 아방스 스크립트는 경계밖으로 벗어나거나 할때 버그가 있어 그부분을 살짝 건드려준겁니다... 으으..

    640x480은 프로그래밍적으로 잠겨있는 값으로 보이며 그 이상으로 수정하기 위해서는 아마 winAPI를 통하거나 아니면 실행파일 자체를 뜯어봐야될것 같네요... 스크립트로 어떻게 되는 부분은 아닐것 같습니다 제 짧은 지식으로는..

  • ?
    매디 2011.07.19 21:20

    전체화면이 먹히나요? 먹히면 좋을텐데...쩝

  • ?
    카리스 2011.07.19 21:28

    댓글 읽고 혹시나 해서 얼른 테스트 해봤는데 잘 됩니다 ^^;

  • ?
    모험소년 2011.08.17 22:35

    이런걸 변경했을때 메시지 영역은 어떻게 설정하나요?? 저는 400x300으로 작게 했는데 메시지가 짤려서 안보이네요 ..

  • ?
    포인트퍙퍙 2011.09.21 19:19

    좋은스크립트네요


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
557 기타 요리 시스템을 도입하는 스크립트입니다. 9 file 스페나로츠 2011.08.18 3141
556 기타 화면 확대 스크립트 12 file 에돌이 2011.07.22 3059
» 기타 해상도 변경 스크립트 11 카리스 2011.07.19 2723
554 스킬 강화주문서, SW_EchantScroll by 시옷전사(SiotWarrior) 21 file 시옷전사 2011.07.13 2605
553 온라인 RPGVX 3D스크립트 11 file 고자몬 2011.07.10 5049
552 스킬 스킬북으로 스킬 레벨업!, 'SW_BookSkill' by SiotWarrior(재수정) 21 file 시옷전사 2011.05.15 2817
551 키입력 한글입력기(펌) 수정 10 전설의달빛조각사 2011.04.03 2674
550 스킬 훔치기 스킬을 만드는 스크립트! 5 우켈킁 2011.03.31 2390
549 기타 KGC counter 스크립트. 반격기 추가스크립트입니다. 4 우켈킁 2011.03.31 1812
548 전투 VX SRPG 스크립트를 살짝 손대봤습니다. 13 아이미르 2011.03.31 3428
547 스킬 스킬 필요조건에 살짝 손대봤습니다. -- 수정 18 아이미르 2011.03.23 2499
546 전투 [덮어씌우기]Window_ActorCommand_EX 4 맛난호빵 2011.03.12 2341
545 이름입력 아이템, 장비, 스킬 이름 색깔 바꾸기 14 까까까 2011.03.04 3732
544 타이틀/게임오버 [NO.0 간단 스크립트] 타이틀에 제작자 정보 올려보기 14 file NO.0 2011.01.30 3362
543 상점 상점에서 아이템 분류 5 file 파이어 2011.01.23 3510
542 기타 IEX - Script Library 1.0 by IceDragon 8 Alkaid 2011.01.11 2619
541 타이틀/게임오버 KGC_TitleDirection 알기쉽게 설명추가 5 파이어 2011.01.03 2662
540 메시지 소설풍(노벨풍) 문자 스크립트 31 file 맛난호빵 2011.01.03 5551
539 상태/속성 MOG - Menu Status V 2.0 16 아방스 2011.01.01 3316
538 메시지 캐릭터 대화상자 - Character's Textbox ver 1.0 6 아방스 2010.12.17 6455
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32