# Start with OK Button in Conditional Branch v1.0 # '결정 키로 이벤트 시작' 조건분기 스크립트입니다. # # 만든이: Juwan Park # http://parkjuwan.tistory.com # # 저작권: Creative Commons BY 3.0 # (영리/비영리 여부에 관계없이 자유롭게 이용 가능합니다.) # # [사용법] # 조건분기에서 스크립트 선택 후 다음과 같이 넣으면 됩니다. # $game_player.swob? # 그리고 결정 키로 이벤트를 시작했을 경우 실행될 커맨드를 넣으면 됩니다. class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias playerinit initialize def initialize playerinit @start_with_ok_button = false end #-------------------------------------------------------------------------- # * Determine if Touch Event is Triggered #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) @start_with_ok_button = false start_map_event(x, y, [1,2], true) end #-------------------------------------------------------------------------- # * Determine if Event Start Caused by [OK] Button #-------------------------------------------------------------------------- def check_action_event return false if in_airship? check_event_trigger_here([0]) return true if $game_map.setup_starting_event @start_with_ok_button = true check_event_trigger_there([0,1,2]) $game_map.setup_starting_event end #-------------------------------------------------------------------------- # * Start with [OK] Button? #-------------------------------------------------------------------------- def swob? return @start_with_ok_button end #-------------------------------------------------------------------------- # * SWOB to false #-------------------------------------------------------------------------- def noswob @start_with_ok_button = false end end class Game_Event < Game_Character #-------------------------------------------------------------------------- # * Determine if Touch Event is Triggered #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) return if $game_map.interpreter.running? if @trigger == 2 && $game_player.pos?(x, y) $game_player.noswob start if !jumping? && normal_priority? end end #-------------------------------------------------------------------------- # * Unlock #-------------------------------------------------------------------------- def unlock if @locked @locked = false set_direction(@prelock_direction) $game_player.noswob end end end