XP 스크립트

참고로 타이틀도 고쳤는데 메일보내기와 홈피 띄우기가 제대로 되려면 위 파일이 프로젝트 내에 깔려 있어야 합니다. 보라색 글시에서 메일주소와 홈피주소 고치세요.

#Main위에 삽입, 그냥 복사해서 붙히시면 됩니다. 원본 출처는 KGC입니다.
#빨간색으로 주석을 달아놨으니 찾아서 세이브 파일 수를 늘릴수도 있습니다.마음대로 고치실 수도 있습니다.


#==============================================================================
# ■ Scene_File
#------------------------------------------------------------------------------
#  세이브 화면 및 로드 화면의 슈퍼 클래스입니다.
#  2000식15개 표시에 대응하고 있습니다.
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     help_text : 헬프 윈도우에 표시하는 캐릭터 라인
  #--------------------------------------------------------------------------
  def initialize(help_text)
    @help_text = help_text
    @index_y = 0
  end
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 헬프 윈도우를 작성
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    # 세이브 파일 윈도우를 작성
    @savefile_windows = []
    for i in 0...15 #원하는 세이브 파일 수만큼
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
      @savefile_windows[i].visible = false
    end
    # 마지막에 조작한 파일을 선택
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    i = 0
    if @file_index <= 12
      while i <= 2
        @savefile_windows[@file_index + i].y = 138 * i + 64
        @savefile_windows[@file_index + i].visible = true
        i += 1
        @index_y = 0
      end
    else
      while i <= 2
        @savefile_windows[@file_index - 2 + i].y = 138 * i + 64
        @savefile_windows[@file_index - 2 + i].visible = true
        i += 1
        @index_y = 2
      end
    end
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면(자) 루프를 중단
      if $scene != self
        break
      end
    end
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @help_window.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @help_window.update
    for i in @savefile_windows
      i.update
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 메소드 on_decision (계승처에서 정의) 를 부르는
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 메소드 on_cancel (계승처에서 정의) 를 부를
      on_cancel
      return
    end
    # 방향 버튼아래가 밀렸을 경우
    if Input.repeat?(Input::DOWN)
      # 방향 버튼아래의 압하 상태가 리피트가 아닌 경우인가 ,
      # 또는 커서 위치가 14 보다 전의 경우
      if Input.trigger?(Input::DOWN) or @file_index < 14 #원하는 세이브파일 수보다 1 적은 수. 이 경우 15개이므로 14.
        # 커서 SE 를 연주
        $game_system.se_play($data_system.cursor_se)
        # 커서를 아래에 이동
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 15
        @savefile_windows[@file_index].selected = true
        @index_y += 1
        # 윈도우 이동
        self.move_window
        return
      end
    end
    # 방향 버튼 위가 밀렸을 경우
    if Input.repeat?(Input::UP)
      # 방향 버튼 위의 압하 상태가 리피트가 아닌 경우인가 ,
      # 또는 커서 위치가 0 보다 뒤의 경우
      if Input.trigger?(Input::UP) or @file_index > 0
        # 커서 SE 를 연주
        $game_system.se_play($data_system.cursor_se)
        # 커서를 위에 이동
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 14) % 15
        @savefile_windows[@file_index].selected = true
        @index_y -= 1
        # 윈도우 이동
        self.move_window
        return
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 파일명의 작성
  #     file_index : 세이브 파일의 인덱스 (0~14)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
#--------------------------------------------------------------------------
# ● 세이브 윈도우의 이동
#--------------------------------------------------------------------------
def move_window
if @index_y >= 0 && @index_y <= 2
return
end
for i in 0...15 #원하는 세이브파일 수만큼
@savefile_windows[i].visible = false
end
i = 0
if @index_y == 3
if @file_index == 0
while i <= 2
@savefile_windows[@file_index + i].y = 138 * i + 64
@savefile_windows[@file_index + i].visible = true
i += 1
end
@index_y = 0
else
while i <= 2
@savefile_windows[@file_index - 2 + i].y = 138 * i + 64
@savefile_windows[@file_index - 2 + i].visible = true
i += 1
end
@index_y = 2
end
elsif @index_y == -1
if @file_index == 14
while i <= 2
@savefile_windows[@file_index - 2 + i].y = 138 * i + 64
@savefile_windows[@file_index - 2 + i].visible = true
i += 1
end
@index_y = 2
else
while i <= 2
@savefile_windows[@file_index + i].y = 138 * i + 64
@savefile_windows[@file_index + i].visible = true
i += 1
end
@index_y = 0
end
end
end


end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    # 戦闘テストの場合
    if $BTEST
      battle_test
      return
    end
    # データベースをロード
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    # システムオブジェクトを作成
    $game_system = Game_System.new
    # タイトルグラフィックを作成

#===============================================================================================================
###로고 띄우기
#Logo("DK1LOGO", "059-Applause01") #이 줄을 넣어준 횟수만큼 로고를 띄움. Title폴더에서 DK1LOGO라는 이름의 그래픽을
#Logo("DK1LOGO", "059-Applause01") #효과음 폴더의 059-Applause01의 음향과 함께 띄운다.
#Logo("DK1LOGO", "059-Applause01")
#===============================================================================================================

    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # コマンドウィンドウを作成
    s1 = "·시작"
    s2 = "·로드"
    s3 = "·홈페이지가기"
    s4 = "·메일보내기"
    s5 = "·종료"
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5])
    @command_window.back_opacity = 0
    # 위의 숫자 0 을 160 으로 맞추면 기본투명색이 됩니다.
    @command_window.x = 100 - @command_window.width / 2
    @command_window.y = 250
    # 320 / 288 은 기본수치.
    # 커맨드메뉴를 기본자리로 돌려놓으려면 x = 320 / y = 288 을 입력하세요.
    # セーブファイルがひとつでも存在するかどうかを調べる
    # 有効なら @continue_enabled を true、無効なら false にする
    @continue_enabled = false
    # false
    for i in 0..14 #세이브 파일을 15개로 늘린 경우 3이 아닌 14로 고쳐줍니다.
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    # コンティニューが有効な場合、カーソルをコンティニューに合わせる
    # 無効な場合、コンティニューの文字をグレー表示にする
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
    # タイトル BGM を演奏
    $game_system.bgm_play($data_system.title_bgm)
    # ME、BGS の演奏を停止
    Audio.me_stop
    Audio.bgs_stop
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # コマンドウィンドウを解放
    @command_window.dispose
    # タイトルグラフィックを解放
    @sprite.bitmap.dispose
    @sprite.dispose
  end

#로고 띄우기 메소드
def Logo(logo, 효과음)
unless $DEBUG 
Audio.se_play("Audio/SE/" + 효과음)
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title(logo)
@sprite.x = (640 - @sprite.bitmap.width) / 2
@sprite.y = (480 - @sprite.bitmap.height) / 2
@sprite.opacity = 255
Graphics.transition(40)
for i in 0..80
@sprite.opacity =240 - (i - 40) * 6 if i >= 40
Graphics.update
end
@sprite.dispose
Graphics.freeze
end
end

  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # コマンドウィンドウを更新
    @command_window.update
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # コマンドウィンドウのカーソル位置で分岐
      case @command_window.index
      when 0  # ニューゲーム
        command_new_game
      when 1  # コンティニュー
        command_continue
      when 2  # 3.
        OpenBrowser("http://rpgxp.co.kr/")
      when 3  # 4.
        OpenBrowser("mailto:dwjk@hotmail.com")
      when 4  # シャットダウン
        command_shutdown
      end
    end
  end

end #클래스 종료


#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
#  세이브 화면 및 로드 화면에서 표시하는, 세이브 파일의 윈도우입니다.
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_reader   :filename                 # 파일명
  attr_reader   :selected                 # 선택 상태
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     file_index : 세이브 파일의 인덱스 (0~3)
  #     filename   : 파일명
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 64 + file_index % 15 * 138, 640, 138) #15에 주목. 원하는 세이브 파일 수만큼.
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist? (@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # 파일 번호를 묘화
    self.contents.font.color = normal_color
    name = "파일#{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name). width
    # 세이브 파일이 존재하는 경우
    if @file_exist
      # 캐릭터를 묘화
  x = 112
      for i in 0...@characters.size
        bitmap = RPG::Cache.battler(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width
        ch = bitmap.rect.height
        src_rect = Rect.new(0, 0, cw, ch)
        dest_rect = Rect.new(x, 0, cw / 2, ch / 2)
        x += dest_rect.width
        self.contents.stretch_blt(dest_rect, bitmap, src_rect)
      end
      # 플레이 시간을 묘화
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 8, 600, 32, time_string, 2)
      # 타임 스탬프를 묘화
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 40, 600, 32, time_string, 2)
      end
  end
  #--------------------------------------------------------------------------
  # ● 선택 상태의 설정
  #     selected : 새로운 선택 상태 (true=선택 false=비선택)
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 커서의 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, 32)
    else
      self.cursor_rect.empty
    end
  end
end


class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    # 텐포라리오브제크트를 재작성
    $game_temp = Game_Temp.new
    # 타임 스탬프가 최신의 파일을 선택
    $game_temp.last_file_index = 0
    latest_time = Time.at(0)
    for i in 0...15 #원하는 세이브 파일 수만큼
      filename = make_filename(i)
      if FileTest.exist? (filename)
        file = File.open(filename, "r")
        if file.mtime > latest_time
          latest_time = file.mtime
          $game_temp.last_file_index = i
        end
        file.close
      end
    end
    super("어느 것을 선택하시겠습니까?")
  end

end

Who's WMN

?
 
 

  W M  N  
                  자료공유

Comment '9'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
361 기타 무기 회피율, 방어구 공격력 지정 스크립트 6 백호 2009.02.22 1244
360 기타 무기& 방어구 레벨제한 스크립트 23 file 백호 2009.02.21 1880
359 변수/스위치 무기변수 스크립트 1 file 백호 2009.02.22 1614
358 메시지 문자 메세지 띄우기 스크립트 10 file 백호 2009.02.21 3069
357 전투 물리친 적의수 표시 file 백호 2009.02.21 1131
356 미니맵 미니맵 만들기~! 14 file 블리치캐릭셋원함 2010.11.24 4350
355 미니맵 미니맵 스크랩트 + 예재 15 file WMN 2008.03.17 2674
354 미니맵 미니맵(중복률100%? 한글번역!) 17 백호 2009.02.21 3423
353 미니맵 미니맵을 표시해주는 스크립트입니다... 41 file - 하늘 - 2009.08.05 5191
352 이동 및 탈것 밑에 KIN 님의 MP 없어지는 대쉬, 제가 손좀 봤음 1 백호 2009.02.22 1244
351 상점 밑에 글 영어로 뜨는거 수정(여관시스템) 7 file 백호 2009.02.22 1683
350 이동 및 탈것 반칸 이동하기 14 file 느싱 2009.03.09 3458
349 기타 발소리 스크립트 4 file 백호 2009.02.21 1614
348 기타 밤/낮 변화 시스템 스크립트 4 file 백호 2009.02.21 1770
347 밤낮 구별 하는 스크랩트 입니다..? 32 WMN 2008.03.17 2552
346 전투 방어시에 속성 저항,스테이트무시 스크립트 1 백호 2009.02.22 1017
345 전투 방어시회복하는거래요. 8 카르닉스 2010.02.26 1579
344 이동 및 탈것 방향키를 누름에따라 점프의 거리가 길어진다 - 출처:엑사포 의 비밀소년님과 연금술사님의 스크립트를 개량함 3 백호 2009.02.21 1234
343 전투 배틀 리포트 화면 변경 스크립트 2 file 백호 2009.02.21 1442
342 전투 배틀 스테이터스·클리어 디자인 13 file 백호 2009.02.21 2467
Board Pagination Prev 1 ... 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ... 52 Next
/ 52