제작도구

게임제작에 필수인 테스트 플레이 고속화 스크립트! ! ! !

by 양념통닼 posted May 30, 2008
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

=begin
 설명

 테스트 플레이에서X버튼…초기설정으로 키보드의"A"키를 누르고 있는 동안,
    게임 속도가 빨라집니다.
 고속화중에는 메세지도 자동 스킵 됩니다.
 또, 전투시 파티 메뉴(싸운다/도망친다) 표시중에
   키보드의"S"(을)를 누르면 적이 전멸 합니다.

개조 방법
 15행목의SPEED = 3 의 값을 변경하는 것으로써, 고속 스피드를 변경할 수 있습니다.
 수치를 크게 하면보다 고속화합니다.
=end
#==============================================================================
# ■ Graphics
#------------------------------------------------------------------------------
#  그래픽 전반의 처리를 실시하는 클래스입니다.
#==============================================================================

class << Graphics
  #--------------------------------------------------------------------------
  # ● 정수
  #--------------------------------------------------------------------------
  SPEED    = 3                            # 스피드
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  alias :update_spd :update unless method_defined?("update_spd")
  def update
    if $TEST and Input.press?(Input::X) and Graphics.frame_count % SPEED > 0
      Graphics.frame_count += 1
    else
      update_spd
    end
  end
  #--------------------------------------------------------------------------
  # ● 웨이트 처리
  #--------------------------------------------------------------------------
  alias :wait_spd :wait unless method_defined?("wait_spd")
  def wait(duration)
    if $TEST and Input.press?(Input::X)
      wait_spd(duration / SPEED)
    else
      wait_spd(duration)
    end
  end
  #--------------------------------------------------------------------------
  # ● 용명 처리
  #--------------------------------------------------------------------------
  alias :fadein_spd :fadein unless method_defined?("fadein_spd")
  def fadein(duration)
    if $TEST and Input.press?(Input::X)
      fadein_spd(duration / SPEED)
    else
      fadein_spd(duration)
    end
  end
  #--------------------------------------------------------------------------
  # ● 페이드아웃 처리
  #--------------------------------------------------------------------------
  alias :fadeout_spd :fadeout unless method_defined?("fadeout_spd")
  def fadeout(duration)
    if $TEST and Input.press?(Input::X)
      fadeout_spd(duration / SPEED)
    else
      fadeout_spd(duration)
    end
  end
  #--------------------------------------------------------------------------
  # ● 트란지션 처리
  #--------------------------------------------------------------------------
  alias :transition_spd :transition unless method_defined?("transition_spd")
  def transition(duration = 10, filename = "", vague = 40)
    if $TEST and Input.press?(Input::X)
      transition_spd(duration / SPEED, filename, vague)
    else
      transition_spd(duration, filename, vague)
    end
  end
end

#==============================================================================
# ■ Window_Message
#------------------------------------------------------------------------------
#  문장 표시에 사용하는 메세지 윈도우입니다.
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 빨리 감기 플래그의 갱신
  #--------------------------------------------------------------------------
  def update_show_fast
    if self.pause or self.openness < 255
      @show_fast = false
    elsif ($TEST and Input.press?(Input::X)) or
        (Input.trigger?(Input::C) and @wait_count < 2)
      @show_fast = true
    elsif not Input.press?(Input::C)
      @show_fast = false
    end
    if @show_fast and @wait_count > 0
      @wait_count -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 문장송의 입력 처리
  #--------------------------------------------------------------------------
  def input_pause
    if ($TEST and Input.press?(Input::X)) or
        Input.trigger?(Input::B) or Input.trigger?(Input::C)
      self.pause = false
      if @text != nil and not @text.empty?
        new_page if @line_count >= MAX_LINE
      else
        terminate_message
      end
    end
  end
end


#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● 파티 커멘드 선택의 갱신
  #--------------------------------------------------------------------------
  alias :update_party_command_selection_spd :update_party_command_selection
  def update_party_command_selection
    update_party_command_selection_spd
    if $TEST and Input.trigger?(Input::Y)
      Sound.play_decision
      $game_troop.increase_turn
      @info_viewport.visible = false
      @info_viewport.ox = 0
      @message_window.visible = true
      @party_command_window.active = false
      @actor_command_window.active = false
      @status_window.index = @actor_index = -1
      @active_battler = nil
      @message_window.clear
      $game_party.clear_actions
      $game_troop.clear_actions
      make_action_orders
      for enemy in $game_troop.members
        enemy.hp -= 999999
        enemy.perform_collapse
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 빨리 감기 판정
  #--------------------------------------------------------------------------
  def show_fast?
    return (($TEST and Input.press?(Input::X)) or
      Input.press?(Input::A) or Input.press?(Input::C))
  end
end








메인 위에 추가 하시면 되고 사용법은 스크립트에 첨부 해놨으니 잘 쓰시길