XP 스크립트

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
  # Make sprite set
  @spriteset = Spriteset_Map.new
  # Make message window
  @message_window = Window_Message.new
  # Transition run
  Graphics.transition
  # Main loop
  loop do
    # Update game screen
    Graphics.update
    # Update input information
    Input.update
    # Frame update
    update
    # Abort loop if screen is changed
    if $scene != self
      break
    end
  end
  # Prepare for transition
  Graphics.freeze
  # Dispose of sprite set
  @spriteset.dispose
  # Dispose of message window
  @message_window.dispose
  # If switching to title screen
  if $scene.is_a?(Scene_Title)
    # Fade out screen
    Graphics.transition
    Graphics.freeze
  end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
  # Loop
  loop do
    # Update map, interpreter, and player order
    # (this update order is important for when conditions are fulfilled
    # to run any event, and the player isn't provided the opportunity to
    # move in an instant)
    $game_map.update
    $game_system.map_interpreter.update
    $game_player.update
    # Update system (timer), screen
    $game_system.update
    $game_screen.update
    # Abort loop if player isn't place moving
    unless $game_temp.player_transferring
      break
    end
    # Run place move
    transfer_player
    # Abort loop if transition processing
    if $game_temp.transition_processing
      break
    end
  end
  # Update sprite set
  @spriteset.update
  # Update message window
  @message_window.update
  # If game over
  if $game_temp.gameover
    # Switch to game over screen
    $scene = Scene_Gameover.new
    return
  end
  # If returning to title screen
  if $game_temp.to_title
    # Change to title screen
    $scene = Scene_Title.new
    return
  end
  # If transition processing
  if $game_temp.transition_processing
    # Clear transition processing flag
    $game_temp.transition_processing = false
    # Execute transition
    if $game_temp.transition_name == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $game_temp.transition_name)
    end
  end
  # If showing message window
  if $game_temp.message_window_showing
    return
  end
  # If encounter list isn't empty, and encounter count is 0
  if $game_player.encounter_count == 0 and $game_map.encounter_list != []
    # If event is running or encounter is not forbidden
    unless $game_system.map_interpreter.running? or
            $game_system.encounter_disabled
      # Confirm troop
      n = rand($game_map.encounter_list.size)
      troop_id = $game_map.encounter_list[n]
      # If troop is valid
      if $data_troops[troop_id] != nil
        # Set battle calling flag
        $game_temp.battle_calling = true
        $game_temp.battle_troop_id = troop_id
        $game_temp.battle_can_escape = true
        $game_temp.battle_can_lose = false
        $game_temp.battle_proc = nil
      end
    end
  end
  # If the interpreter is not running
  if not $game_system.map_interpreter.running?
  # Save the file
    file = File.open("Save1.rxdata", "wb")
    write_save_data(file)
    file.close
  end
  # If B button was pressed
  if Input.trigger?(Input::B)
    # If event is running, or menu is not forbidden
    unless $game_system.map_interpreter.running? or
            $game_system.menu_disabled
      # Set menu calling flag or beep flag
      $game_temp.menu_calling = true
      $game_temp.menu_beep = true
    end
  end
  # If debug mode is ON and F9 key was pressed
  if $DEBUG and Input.press?(Input::F9)
    # Set debug calling flag
    $game_temp.debug_calling = true
  end
  # If player is not moving
  unless $game_player.moving?
    # Run calling of each screen
    if $game_temp.battle_calling
      call_battle
    elsif $game_temp.shop_calling
      call_shop
    elsif $game_temp.name_calling
      call_name
    elsif $game_temp.menu_calling
      call_menu
    elsif $game_temp.save_calling
      call_save
    elsif $game_temp.debug_calling
      call_debug
    end
  end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
  # Clear battle calling flag
  $game_temp.battle_calling = false
  # Clear menu calling flag
  $game_temp.menu_calling = false
  $game_temp.menu_beep = false
  # Make encounter count
  $game_player.make_encounter_count
  # Memorize map BGM and stop BGM
  $game_temp.map_bgm = $game_system.playing_bgm
  $game_system.bgm_stop
  # Play battle start SE
  $game_system.se_play($data_system.battle_start_se)
  # Play battle BGM
  $game_system.bgm_play($game_system.battle_bgm)
  # Straighten player position
  $game_player.straighten
  # Switch to battle screen
  $scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
  # Clear shop call flag
  $game_temp.shop_calling = false
  # Straighten player position
  $game_player.straighten
  # Switch to shop screen
  $scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
  # Clear name input call flag
  $game_temp.name_calling = false
  # Straighten player position
  $game_player.straighten
  # Switch to name input screen
  $scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
  # Clear menu call flag
  $game_temp.menu_calling = false
  # If menu beep flag is set
  if $game_temp.menu_beep
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Clear menu beep flag
    $game_temp.menu_beep = false
  end
  # Straighten player position
  $game_player.straighten
  # Switch to menu screen
  $scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
  # Straighten player position
  $game_player.straighten
  # Switch to save screen
  $scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
  # Clear debug call flag
  $game_temp.debug_calling = false
  # Play decision SE
  $game_system.se_play($data_system.decision_se)
  # Straighten player position
  $game_player.straighten
  # Switch to debug screen
  $scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
  # Clear player place move call flag
  $game_temp.player_transferring = false
  # If move destination is different than current map
  if $game_map.map_id != $game_temp.player_new_map_id
    # Set up a new map
    $game_map.setup($game_temp.player_new_map_id)
  end
  # Set up player position
  $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
  # Set player direction
  case $game_temp.player_new_direction
  when 2  # down
    $game_player.turn_down
  when 4  # left
    $game_player.turn_left
  when 6  # right
    $game_player.turn_right
  when 8  # up
    $game_player.turn_up
  end
  # Straighten player position
  $game_player.straighten
  # Update map (run parallel process event)
  $game_map.update
  # Remake sprite set
  @spriteset.dispose
  @spriteset = Spriteset_Map.new
  # If processing transition
  if $game_temp.transition_processing
    # Clear transition processing flag
    $game_temp.transition_processing = false
    # Execute transition
    Graphics.transition(20)
  end
  # Run automatic change for BGM and BGS set on the map
  $game_map.autoplay
  # Frame reset
  Graphics.frame_reset
  # Update input information
  Input.update
end
#--------------------------------------------------------------------------
# * Write Save Data
#--------------------------------------------------------------------------
  def write_save_data(file)
  # Make character data for drawing save file
  characters = []
  for i in 0...$game_party.actors.size
    actor = $game_party.actors[i]
    characters.push([actor.character_name, actor.character_hue])
  end
  # Write character data for drawing save file
  Marshal.dump(characters, file)
  # Wrire frame count for measuring play time
  Marshal.dump(Graphics.frame_count, file)
  # Increase save count by 1
  $game_system.save_count += 20
  # Save magic number
  # (A random value will be written each time saving with editor)
  $game_system.magic_number = $data_system.magic_number
  # Write each type of game object
  Marshal.dump($game_system, file)
  Marshal.dump($game_switches, file)
  Marshal.dump($game_variables, file)
  Marshal.dump($game_self_switches, file)
  Marshal.dump($game_screen, file)
  Marshal.dump($game_actors, file)
  Marshal.dump($game_party, file)
  Marshal.dump($game_troop, file)
  Marshal.dump($game_map, file)
  Marshal.dump($game_player, file)
end
end
--------------------------------------------------------------------------

별다른 세이브를 안눌러도 자동으로 세이브해주는 시스템입니다.

main 위에 찌르시면 돼겟습니다^^

프레임이 1 당 저장을해서 렉이 난거갓습니다.

제가 프레임을 20으로 변경해놧구요^^ 렉은없을껄로보입니다.

그리고 만약 프레임카운터를 줄이시거나 늘이시려면

  Marshal.dump(Graphics.frame_count, file)
  # Increase save count by 1
  $game_system.save_count += 50
  # Save magic number

여기서    $game_system.save_count += 50<----이숫자를 변경해주시면됍니다^^

즐거운하루 보내세요^^

아참 그리고

카운터 100이 5초
카운터 50가 2.5초
카운터 20이 1초 입니다.

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6202
1021 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11828
1020 온라인 채팅 가능 온라인 스크립트 배포 107 file 아방스 2009.01.03 10685
1019 온라인 RPG 만들기 xp 온라인 스크립트 33 아방스 2007.11.09 9601
1018 맵/타일 [유니크급] RPG XP 게임을 3D화로 보자! Neo Mode7 script / 52 file 쉴더 2009.02.28 9447
1017 온라인 온라인 스크립트 Unis Net RMXP 공식 배포! 25 file 뮤바보 2011.12.25 9403
1016 온라인 광넷[ 광땡 온라인 + 넷플레이 ] 62 - 하늘 - 2009.08.02 9003
1015 전투 [액알]neo_a-rpg_module_1[1][1].2 스크립트 83 file 은빛바람 2009.10.03 8307
1014 이름입력 대화창에 얼굴, 이름 띄우기 37 킬라롯 2008.11.09 7497
1013 온라인 넷플레이1.7.0+abs5.5+한챗 49 쀍뛝쒧 2009.01.24 7289
1012 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 7145
1011 메시지 대화창에 얼굴 그래픽 띠우기 73 아방스 2007.11.09 7119
1010 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6920
1009 전투 [신기술 체험] 강회된 횡스크롤 액알 13 file 백호 2009.02.22 6841
1008 메뉴 온라인메뉴처럼!! 메이플 메뉴처럼!! 변신~스크립트 33 WMN 2008.03.17 6824
1007 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6566
1006 온라인 Mr.Metring NPE 1.0 [RPG XP 온라인 스크립트] 35 아방스 2009.01.07 6535
1005 이름입력 케릭터 위에 또는 NPC 위에 이름 뛰우기 [헬악이님 제공] 49 file 아방스 2007.11.09 6414
1004 액터 시트르산의 XP용 감정 말풍선 표시 스크립트 37 file 시트르산 2011.01.25 6114
1003 HUD 주인공,NPC이름 머리 나타내기 49 file 송긔 2010.11.28 6067
1002 전투 액알 스크립트 24 백호 2009.02.22 6017
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52