RPGXP Script
2013.10.01 06:14

Switchless Common Events

Views 884 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
=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
No. Category Subject Author Date Views Votes
288 RPGXP Script 새로운 게임 시작/로드 시 미묘한 연출 추가. 창조도시 2007.12.01 2545 1
287 RPGXP Script 대화 글씨 폰트를 원하는 폰트로 바꾸기 창조도시 2007.12.01 1669 2
286 RPGXP Script 대각선 방향 이동추가로 8방향 이동 만들기. 1 창조도시 2008.08.14 2453 1
285 RPGXP Script 맵 이름을 화면 상단에 띄우기. 1 1 file 창조도시 2008.10.12 2406 1
284 RPGXP Script 최초 시작화면에 제작자 정보를 띄워보자. 6 창조도시 2008.04.04 2205 5
283 RPGXP Script 선택 메뉴를 가운데 정렬 해보자. 1 file 창조도시 2007.12.02 1664 2
282 RPGXP Script 아이템창을 아이템 분류별로 나누어 지게 개조. 3 file 창조도시 2007.12.02 1873 1
281 RPGXP Script c[n] 명령어 줄때의 색상 결정. 창조도시 2008.02.14 1335 1
280 RPGXP Script 대화창에 얼굴 띄우기& 대화창 명령어 모음. 1 file 창조도시 2008.12.31 2357 1
279 RPGXP Script 게임도중에 글씨체를 바꿔보자. 창조도시 2008.12.31 1534 1
278 RPGXP Script 대화창에 이름&얼굴 띄우기 새로운방식. file 창조도시 2007.11.06 3882 3
277 RPGXP Script 그림자문자 사용하기.. 바탕색이 무슨색이건 상관없이 글자가 잘보인다!!! 창조도시 2007.11.06 1699 1
276 RPGXP Script 기차 파티 스크립트 2 창조도시 2008.07.24 1703 2
275 RPGXP Script 한글이름입력기 v1.76 1 1 창조도시 2008.07.24 2927 2
274 RPGXP Script 창고 시스템 2 창조도시 2008.01.18 2009 3
273 RPGXP Script 물가에가면 캐릭터를 반사시켜주는 스크립트 4 file 창조도시 2007.12.02 4780 6
272 RPGXP Script 파티 선두 캐릭터 id 변수에 넣기 Evangelista 2008.01.08 1664 1
271 RPGVX Script vx 한글이름입력 2 file 가가상 2010.05.21 3347 1
270 RPGVX Script [VX] 파티 선두 캐릭터 액터ID를 변수에 넣기 Evangelista 2008.11.28 1958 1
269 RPGVX Script [VX] 조건분기로 키입력의 처리 실행 1 Evangelista 2008.11.28 1991 1
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15


[privacy statements] | [Terms of Use] | [Contact us] | [Sponsorship] | [Indiside History]

Copyright © 1999 - 2016 INdiSide.com/CL3D Co., Ltd. All Rights Reserved.
Owner : Chunmu(Jiseon Lee) | kernys(Wonbae Kim) | Sasinji(Byungkook Kim)