RPGXP スクリプト
2013.10.01 06:14

Switchless Common Events

閲覧数 882 推奨数 0 コメント 0
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
=begin

 Switchless Common Events v1.1
 by PK8
 Created: 5/6/2012
 Modified: 5/27/2012
 ──────────────────────────────────────────────────────────────────────────────
 ■ Author's Notes
   This was a fairly quick script I wrote. It was an idea I had in my head
   for a little while.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Introduction
   Remember how in RPG Maker 2000 and 2003, you didn't need to rely on switches
   in order for your common events to run on parallel process and autorun? Well,
   it's back. This script lets you set which common events are going to run in
   either parallel processing or automatically, without the use of conditional
   switches.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Features
   o Set which common events are going to use autorun or parallel process
     triggering without a conditional switch.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Methods Aliased
   Scene_Title.command_new_game
   Interpreter.setup_starting_event
   Game_CommonEvent.refresh
 ──────────────────────────────────────────────────────────────────────────────
 ■ Changelog
   v1   (05/06/2012): Initial Release
   v1.1 (05/27/2012): Removed Custom Conditionals feature because it was
                      unnecessary and could easily be accomplished through
                      conditional branches. I also reduced a lot of code.
   
=end

#==============================================================================
# ** Configuration
#==============================================================================

module PK8
  class Switchless_CommonEvents
    #--------------------------------------------------------------------------
    # * Do not modify
    #--------------------------------------------------------------------------
    Autorun, Parallel = [], []
    
    #--------------------------------------------------------------------------
    # * Decide which common events would autorun/process without a switch.
    # Autorun/Parallel = [Common Event IDs]
    #--------------------------------------------------------------------------
    #Autorun  = [10, 9]
    #Parallel = [8, 7]
  end
end

#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  unless method_defined?(:pk8_sce_command_new_game)
    alias_method(:pk8_sce_command_new_game, :command_new_game)
  end
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  def command_new_game
    pk8_sce_command_new_game
    PK8::Switchless_CommonEvents::Autorun.each { | id |
      ceid = $data_common_events[id]; ceid.trigger, ceid.switch_id = 0, 0 }
    PK8::Switchless_CommonEvents::Parallel.each { | id |
      ceid = $data_common_events[id]; ceid.trigger, ceid.switch_id = 0, 0 }
  end
end

#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  unless method_defined?(:pk8_sce_setup_starting_event)
    alias_method(:pk8_sce_setup_starting_event, :setup_starting_event)
  end
  #--------------------------------------------------------------------------
  # * Starting Event Setup
  #--------------------------------------------------------------------------
  def setup_starting_event
    pk8_sce_setup_starting_event
    $data_common_events.compact.each { | ce | setup(ce.list, 0) if (
      PK8::Switchless_CommonEvents::Autorun.include?(ce.id)) }
  end
end

#==============================================================================
# ** Game_CommonEvent
#------------------------------------------------------------------------------
#  This class handles common events. It includes execution of parallel process
#  event. This class is used within the Game_Map class ($game_map).
#==============================================================================

class Game_CommonEvent
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  unless method_defined?(:pk8_sce_refresh)
    alias_method(:pk8_sce_refresh, :refresh)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    pk8_sce_refresh
    if PK8::Switchless_CommonEvents::Parallel.include?(@common_event_id)
      @interpreter = Interpreter.new if @interpreter == nil
    end
  end
end
?

List of Articles
番号 カテゴリ タイトル 投稿者 日付 閲覧数 推奨数
288 RPG MVプラグイン Mog_Battle_hud(MZ버전도 있습니다) 스트레이보우 2021.03.05 2010 0
287 RPG MVプラグイン 컷신 플러그인 스트레이보우 2020.10.30 2692 0
286 RPG MVプラグイン 업적플러그인 스트레이보우 2020.09.02 2260 0
285 RPGXP スクリプト 한글조합입력기(영어가능) file 조규진1 2019.11.10 1199 0
284 RPG MVプラグイン 게임에서 제공해주는 노래가 아닌 외부에서 다운받고 안에 넣어쓰려면 어떻게 해야하나요? 3 BigOrca 2019.07.26 1649 0
283 RPG MVプラグイン Ghost Effect 러닝은빛 2019.01.20 1323 0
282 RPGXP スクリプト RPG XP Xas액알 1 file 심심치 2018.10.30 1323 0
281 RPG MVプラグイン 커스텀 숫자 입력 패드 1 file 러닝은빛 2018.10.19 1392 0
280 RPG MVプラグイン 9마리 이상의 몬스터 설정 | More Enemies 러닝은빛 2018.08.31 1150 0
279 RPG MVプラグイン 동적 맵 타일 수정 플러그인 베지테리안카카오 2018.07.17 1249 0
278 RPG VX Ace スクリプト VXA에서 XBOX360 컨트롤러 사용 여부 체크 file 러닝은빛 2018.07.15 1053 0
277 RPG MVプラグイン RMMV 옵션 창에 메시지 속도 및 글자 크기 변경 기능 추가 file 러닝은빛 2018.07.15 1794 0
276 RPG MVプラグイン 한글 데미지 표시 file 러닝은빛 2018.07.09 1609 0
275 RPG MVプラグイン [ MV ] 심장[체력표시 하트] 플러그인 file 수성의물 2018.07.01 2405 0
274 RPG MVプラグイン [鳥小屋] 실적 플러그인(인게임 트로피 시스템) file 이니군 2017.10.31 1908 0
273 RPG VX Ace スクリプト LuD Script Package 1 file LuD 2017.08.16 1819 0
272 RPG VX Ace スクリプト [VXAce] 레이어 맵 <layer> 시스템 file LuD 2017.08.07 1477 0
271 RPG MVプラグイン [RPG MV] 퀘스트 마커 지속 표시 플러그인 file lklslel 2017.04.09 1872 0
270 RPG MVプラグイン Mirror Area - RPG Maker MV 2 file 러닝은빛 2017.01.03 5180 0
269 RPG MVプラグイン Keyboard Event - RPG Maker MV 1 러닝은빛 2017.01.03 2456 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15