질문과 답변

Extra Form

게임을 만들다 보니까 이런저런 스크립트 쓰면서 맵에 이벤트도 많다보니까

렉이 심해져서 렉을 줄일 방법이 없을까 찾아보다 발견한건데

사용법을 잘모르겠네요 주석을 읽어봐도 스크립트의 사용효과 정도는 알겠는데

정확한 'How to use' 안써져있는 것 같아서 질문드립니다.

(내가 발견못한건가...?;;)

 

일단 효과는 맵에 많은 이벤트가 존재할때 발생하는 렉을

해당 맵에서 플레이할때 화면 밖에 존재하는 이벤트를 생략함으로 렉을 줄여준다는 것 같은데

잘몰라서 그냥 붙여넣고 사용해봤더니 아래에  메세지만 뜨고 게임이 종료되네요..ㅜㅠ

 

ps. 스크립트 원문을 올린 것이 문제가 될 경우 삭제하겠습니다.

 

#==============================================================================
# ** Victor Engine - Anti Lag
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
#  v 1.00 - 2012.08.03 > First release
#  v 1.01 - 2012.08.04 > Fixed issue when teleport to the same map
#------------------------------------------------------------------------------
#  This script was designed to reduce the lag cause by many events on map.
# Most anti lag script just skip the update of events that outside the screen
# while still loops though all of them. This one, instead, dinamically manage
# the list of events for update, and keeps events that aren't going to be 
# updated outside of the list.
#------------------------------------------------------------------------------
# Compatibility
#   Requires the script 'Victor Engine - Basic Module' v 1.00 or higher
#
# * Overwrite methods
#   class Game_Map
#     def update_events
#     def event_list
#
#   class Spriteset_Map
#     def update_characters
#
# * Alias methods
#   class Game_Map
#     def setup(map_id)
#     def refresh
#
#   class Game_Event < Game_Character
#     def setup_page_settings
#
#   class Spriteset_Map
#     def create_characters
#
#------------------------------------------------------------------------------
# Instructions:
#  To instal the script, open you script editor and paste this script on
#  a new section bellow the Materials section. This script must also
#  be bellow the script 'Victor Engine - Basic'
#
#------------------------------------------------------------------------------
# Comment boxes note tags:
#   Tags to be used on events Comment boxes. They're different from the
#   comment call, they're called always the even refresh.
# 
#  <always update>
#   Events with this comment on the active page will be always updated
# 
#  <never update>
#   Events with this comment on the active page will be never updated
#   Useful for decoration only events.
# 
#------------------------------------------------------------------------------
# Additional instructions:
#
#  Parallel process events and auto start events will be always updated no
#  matter their positions.
#
#  Remember that your hardware specification still have influence on the
#  performance
#==============================================================================

#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
#   Setting module for the Victor Engine
#==============================================================================

module Victor_Engine
  #--------------------------------------------------------------------------
  # * Setup the update buffer
  #   Setting values higher than 0, you increase the tile area of update
  #   By default, only events on the screen area or 1 tile near the visible
  #   área updates. Increasing the buff increase the update área, but also
  #   increase the potential lag.
  #--------------------------------------------------------------------------
  VE_UPDATE_BUFFER = 0
  #--------------------------------------------------------------------------
  # * required
  #   This method checks for the existance of the basic module and other
  #   VE scripts required for this script to work, don't edit this
  #--------------------------------------------------------------------------
  def self.required(name, req, version, type = nil)
    if !$imported[:ve_basic_module]
      msg = "The script '%s' requires the script\n"
      msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
      msg += "Go to http://victorscripts.wordpress.com/ to download this script."
      msgbox(sprintf(msg, self.script_name(name), version))
      exit
    else
      self.required_script(name, req, version, type)
    end
  end
  #--------------------------------------------------------------------------
  # * script_name
  #   Get the script name base on the imported value
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "VE")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end

$imported ||= {}
$imported[:ve_anti_lag] = 1.01
Victor_Engine.required(:ve_anti_lag, :ve_basic_module, 1.00, :above)

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Overwrite method: update_events
  #--------------------------------------------------------------------------
  def update_events
    @update_list.each   {|event| event.update }
    @common_events.each {|event| event.update }
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: event_list
  #--------------------------------------------------------------------------
  def event_list
    @event_list
  end
  #--------------------------------------------------------------------------
  # * Alias method: setup
  #--------------------------------------------------------------------------
  alias :setup_ve_anti_lag :setup
  def setup(map_id)
    @event_list  = []
    @update_list = []
    setup_ve_anti_lag(map_id)
  end
  #--------------------------------------------------------------------------
  # * Alias method: refresh
  #--------------------------------------------------------------------------
  alias :refresh_ve_anti_lag :refresh
  def refresh
    refresh_ve_anti_lag
    refresh_event_list
  end
  #--------------------------------------------------------------------------
  # * New method: screen_moved?
  #--------------------------------------------------------------------------
  def screen_moved?
    @last_screen_x != @display_x.to_i || @last_screen_y != @display_y.to_i
  end
  #--------------------------------------------------------------------------
  # * New method: refresh_screen_position
  #--------------------------------------------------------------------------
  def refresh_screen_position
    @last_screen_x = @display_x.to_i
    @last_screen_y = @display_y.to_i
  end
  #--------------------------------------------------------------------------
  # * New method: refresh_event_list
  #--------------------------------------------------------------------------
  def refresh_event_list
    @event_list  = events.values.select {|event| event.on_screen? }
    @update_list = events.values.select {|event| event.update? }
  end
end

#==============================================================================
# ** Game_CharacterBase
#------------------------------------------------------------------------------
#  This class deals with characters. Common to all characters, stores basic
# data, such as coordinates and graphics. It's used as a superclass of the
# Game_Character class.
#==============================================================================

class Game_CharacterBase
  #--------------------------------------------------------------------------
  # * New method: update?
  #--------------------------------------------------------------------------
  def update?(*args)
    return true
  end
  #--------------------------------------------------------------------------
  # * New method: near_the_screen?
  #--------------------------------------------------------------------------
  def near_the_screen?(*args)
    return true
  end
  #--------------------------------------------------------------------------
  # * New method: on_buffer_area?
  #--------------------------------------------------------------------------
  def on_screen?(*args)
    return true
  end
end

#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page 
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Alias method: setup_page_settings
  #--------------------------------------------------------------------------
  alias :setup_page_settings_ve_anti_lag :setup_page_settings
  def setup_page_settings
    setup_page_settings_ve_anti_lag
    @mode = nil
    @mode = :always if note =~ /<ALWAYS UPDATE>/i
    @mode = :never  if note =~ /<NEVER UPDATE>/i
  end
  #--------------------------------------------------------------------------
  # * New method: update?
  #--------------------------------------------------------------------------
  def update?
    return false if @mode == :never
    on_screen?(12, 8)
  end
  #--------------------------------------------------------------------------
  # * New method: auto_event?
  #--------------------------------------------------------------------------
  def auto_event?
    @mode == :always || @trigger == 3 || @trigger == 4
  end
  #--------------------------------------------------------------------------
  # * New method: on_screen?
  #--------------------------------------------------------------------------
  def on_screen?(x = 14, y = 10)
    z = [VE_UPDATE_BUFFER, 0].max
    near_the_screen?(x + z, y + z) || auto_event?
  end
end

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Overwrite method: update_characters
  #--------------------------------------------------------------------------
  def update_characters
    refresh_characters if @map_id != $game_map.map_id
    refresh_sprites    if $game_map.screen_moved?
    @screen_sprites.each {|sprite| sprite.update }
  end
  #--------------------------------------------------------------------------
  # * Alias method: create_characters
  #--------------------------------------------------------------------------
  alias :create_characters_ve_anti_lag :create_characters
  def create_characters
    create_characters_ve_anti_lag
    refresh_characters_sprites
  end
  #--------------------------------------------------------------------------
  # * New method: refresh_characters_sprites
  #--------------------------------------------------------------------------
  def refresh_characters_sprites
    @screen_sprites = []
    @character_sprites.each do |sprite|
      sprite.update
      @screen_sprites.push(sprite) if sprite.character.on_screen?
    end
  end
  #--------------------------------------------------------------------------
  # * New method: refresh_sprites
  #--------------------------------------------------------------------------
  def refresh_sprites
    refresh_characters_sprites
    $game_map.refresh_event_list
    $game_map.refresh_screen_position
  end
end
 
 
 - 출처 -
http://victorscripts.wordpress.com/
Comment '3'
  • ?
    미루 2013.03.03 23:50

    자동적용됩니다.

  • ?
    임프R 2013.03.04 00:33
    아... 제가 주석에서 사용법만 찾고있느라 중요한걸 간과했네요;;
    베이지 모듈 스크립트가 있으면 되는거였구나
    답변 감사합니다. 덕분에 해결됬네요
  • ?
    미루 2013.03.03 23:52
    Requires the script 'Victor Engine - Basic Module' v 1.00 or higher

    이것때문아닐까 하는 생각이 드는데...

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
RMVX vx bgm 사운드가 안나와요~ 3 촤PD 2014.01.25 973
RMVX Vx ATB 이도류 질문 카린저 2010.11.17 745
한글 패치 RMVXA VX Ace툴 스팀 버전 한글패치는 없는 건가요? 자유와바람 2019.11.07 316
스크립트 사용 RMVXA vx ace의 한 칸의 크기가 32x32인데 이걸 더 늘릴수 있나요? 2 무명유실 2019.11.11 118
툴선택 VX ACE의 그래픽으로도 충분히 공포 연출이 가능할까요? 6 AVANGS주니 2013.10.24 1291
RMMV VX ace용으로 만들어진 이펙트를 MV에서 사용하는법 1 잠행인 2016.09.17 129
RMVXA Vx Ace용 빅토르 스크립트의 안티렉 스크립트 사용법 질문입니다. 3 임프R 2013.03.03 2898
RMMV VX Ace와 MV 연동 질문 4 Luckypup1 2015.12.26 194
vx ace에서 한글 폰트가 깨져서 나와요 ㅠㅠ 8 file 아이펀사 2014.06.22 3108
기타 기타 vx ace에서 플에이어가 직접 커스터마이징 할수 있는 기능이 있을까요? file 묘윤 2023.04.08 40
RMVXA vx ace에서 파티원을 정해진 직업(스텟,그래픽 등)으로 변경하고 싶을때... 5 슈아ll 2016.04.05 173
RMVXA VX ACE에서 탈것중에 마차 어떻게하죠? 2 큰놈 2013.12.27 870
RMVXA vx ace에서 짧은 동굴 같은 느낌 내기 흰강아지 2014.03.26 640
RMVXA VX ACE에서 RPG2000 해상도로 확실하게 변경하는 방법이 있나요? mona 2013.04.16 900
RMVXA vx ace에서 4방향 통행 2 하얀너울 2012.12.20 1088
RMVXA vx ace맵칩 이벤트문제 4 큰놈 2014.01.18 861
RMVXA vx ace랑 vx랑 스크립트 연동 안되나요? 1 동뼉 2012.01.08 3524
RMVXA VX ACE는 키 입력이 없나요? 3 비비드 2012.12.20 850
RMVXA vx ace는 암호화 해지 툴이 없나요? 1 emblock 2013.11.12 1114
RMVXA VX ace는 사이드뷰배틀이없나요? 2 WOL 2012.11.10 1234
Board Pagination Prev 1 ... 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 ... 516 Next
/ 516