질문과 답변

Extra Form
#==============================================================================
# 
# ¥ Yami Engine Ace - Charge Skill
# -- Last Updated: 2012.05.13
# -- Level: Easy
# -- Requires: none
# 
#==============================================================================

$imported = {} if $imported.nil?
$imported["YSE-ChargeSkill"] = true

#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.05.13 - Fixed Enemy Charging.
# 2012.03.30 - Fixed Skill Targets.
# 2012.03.29 - Fixed Auto Battle bug.
# 2012.03.27 - Fixed Cancel Charge bug.
# 2012.03.26 - Fixed Battle End bug.
# 2012.03.18 - Started and Finished Script.
# 
#==============================================================================
# ¥ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script provides charging skill feature. Charging Skill means that skill
# will be used after some turn it was choosen.
#
#==============================================================================
# ¥ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Skill/Item Notetags - These notetags go in the skill/item notebox in the database.
# -----------------------------------------------------------------------------
# <charge turn: x>
# Make skill be a charge skill with x charging turns.
# -----------------------------------------------------------------------------
# <start charge message>
# example
# </start charge message>
#
# Set the Charging Start Message to example.
# -----------------------------------------------------------------------------
# <continue charge message>
# example
# </continue charge message>
#
# Set the Charging Continue Message to example.
#
#==============================================================================
# ¥ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
# 
#==============================================================================

module YSE
  module CHARGE_SKILL
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Visual Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    VISUAL_SETTING = { # Start.
      # Message shows when choose a charge skill.
      # Set this to nil to disable.
      :default_msg_start      =>  "%s is charging %s!",
      # Message shows when end a charging turn.
      # Set this to nil to disable.
      :default_msg_continue   =>  "%s continue charging %s...",
    } # End.
    
  end # CHARGE_SKILL
end # YSE

#==============================================================================
# ¥ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

#==============================================================================
# ¡ Regular Expression
#==============================================================================

module YSE
  module REGEXP
  module USABLEITEM
    
    CHARGE_TURN = /<(?:CHARGE_TURN|charge turn):[ ](\d+)?>/i
    START_MSG_BEGIN = /<(?:START_CHARGE_MESSAGE|start charge message)>/i
    START_MSG_END = /<\/(?:START_CHARGE_MESSAGE|start charge message)>/i
    CONT_MSG_BEGIN = /<(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i
    CONT_MSG_END = /<\/(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i
    
  end # STATE
  end # REGEXP
end # YSE

#==============================================================================
# ¡ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_ysecs load_database; end
  def self.load_database
    load_database_ysecs
    load_notetags_ysecs
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_ysecs
  #--------------------------------------------------------------------------
  def self.load_notetags_ysecs
    groups = [$data_skills, $data_items]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_ysecs
      end
    end
  end
  
end # DataManager

#==============================================================================
# ¡ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :charge_turn
  attr_accessor :start_msg
  attr_accessor :continue_msg
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_ysecs
  #--------------------------------------------------------------------------
  def load_notetags_ysecs
    @start_begin = false
    @continue_begin = false
    @charge_turn = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YSE::REGEXP::USABLEITEM::CHARGE_TURN
        @charge_turn = $1.to_i
      when YSE::REGEXP::USABLEITEM::START_MSG_BEGIN
        @start_begin = true
      when YSE::REGEXP::USABLEITEM::START_MSG_END
        @start_begin = false
      when YSE::REGEXP::USABLEITEM::CONT_MSG_BEGIN
        @continue_begin = true
      when YSE::REGEXP::USABLEITEM::CONT_MSG_END
        @continue_begin = false
      else
        @start_msg = line.to_s if @start_msg.nil? && @start_begin
        @start_msg += line.to_s if @start_begin
        @continue_msg = line.to_s if @continue_msg.nil? && @continue_begin
        @continue_msg += line.to_s if @continue_begin
      end
    } # self.note.split
    #---
    @charge_turn = nil if @charge_turn <= 0
    @start_msg = YSE::CHARGE_SKILL::VISUAL_SETTING[:default_msg_start]
    @continue_msg = YSE::CHARGE_SKILL::VISUAL_SETTING[:default_msg_continue]
    @start_msg = nil if @start_msg == ""
    @continue_msg = nil if @continue_msg == ""
  end
  
end # RPG::UsableItem

#==============================================================================
# ¡ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :charged
  attr_accessor :first_charge

  #--------------------------------------------------------------------------
  # alias method: auto_battle?
  #--------------------------------------------------------------------------
  alias yse_auto_battle_cs auto_battle?
  def auto_battle?
    charging? ? false : yse_auto_battle_cs
  end
  
  #--------------------------------------------------------------------------
  # new method: charging?
  #--------------------------------------------------------------------------
  def charging?
    !@charging_cache.nil? || @charged
  end
  
  #--------------------------------------------------------------------------
  # new method: start_charge
  #--------------------------------------------------------------------------
  def start_charge
    return false if charging?
    return false if current_action.item.charge_turn.nil?
    @charging_cache = current_action.clone
    @charge_turn = current_action.item.charge_turn
    return true
  end
  
  #--------------------------------------------------------------------------
  # new method: current_charging
  #--------------------------------------------------------------------------
  def current_charging
    @charging_cache
  end
  
  #--------------------------------------------------------------------------
  # new method: end_charge
  #--------------------------------------------------------------------------
  def end_charge
    @actions.push(@charging_cache)
    @charging_cache = nil
    @charge_turn = nil
    @charged = true
    return true
  end
  
  #--------------------------------------------------------------------------
  # new method: cancel_charge
  #--------------------------------------------------------------------------
  def cancel_charge
    clear_actions
    @charging_cache = nil
    @charge_turn = nil
    @charged = false
  end
  
  #--------------------------------------------------------------------------
  # new method: update_charge_skill
  #--------------------------------------------------------------------------
  def update_charge_skill
    @charge_turn -= 1
    return end_charge if @charge_turn == 0
    return false
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_battle_end
  #--------------------------------------------------------------------------
  alias yse_on_battle_end_cs on_battle_end
  def on_battle_end
    cancel_charge
    yse_on_battle_end_cs
  end

end # Game_Battler

#==============================================================================
# ¡ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: inputable?
  #--------------------------------------------------------------------------
  alias yse_inputable_cs inputable?
  def inputable?
    yse_inputable_cs && !charging?
  end
  
end # Game_Actor

#==============================================================================
# ¡ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: make_actions
  #--------------------------------------------------------------------------
  alias yse_make_actions_cs make_actions
  def make_actions
    return super if charging?
    yse_make_actions_cs
  end
  
end # Game_Enemy

#==============================================================================
# ¡ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: execute_action
  #--------------------------------------------------------------------------
  alias yse_execute_action_bacs execute_action
  def execute_action
    return start_charge if @subject.start_charge
    yse_execute_action_bacs
  end
    
  #--------------------------------------------------------------------------
  # alias method: process_action_end
  #--------------------------------------------------------------------------
  alias yse_process_action_end_bacs process_action_end
  def process_action_end
    process_charge_skill
    yse_process_action_end_bacs
  end
  
  #--------------------------------------------------------------------------
  # new method: start_charge
  #--------------------------------------------------------------------------
  def start_charge
    @subject.first_charge = true
    return if @subject.current_action.item.start_msg.nil?
    str = @subject.current_action.item.start_msg
    skill = @subject.current_action.item
    skill_text = sprintf("\\i[%d]%s", skill.icon_index, skill.name)
    text = sprintf(str, @subject.name, skill_text)
    @log_window.add_text(text)
    3.times do @log_window.wait end
    @log_window.back_one
  end

  #--------------------------------------------------------------------------
  # new method: process_charge_skill
  #--------------------------------------------------------------------------
  def process_charge_skill
    return @subject.first_charge = false if @subject.first_charge
    return unless @subject.charging?
    return unless check_charge_turn
    process_action_charge
  end

  #--------------------------------------------------------------------------
  # new method: check_charge_turn
  #--------------------------------------------------------------------------
  def check_charge_turn
    continue = @subject.update_charge_skill
    if continue
      return true
    else
      return false if @subject.current_charging.item.continue_msg.nil?
      str = @subject.current_charging.item.continue_msg
      skill = @subject.current_charging.item
      skill_text = sprintf("\\i[%d]%s", skill.icon_index, skill.name)
      text = sprintf(str, @subject.name, skill_text)
      @log_window.add_text(text)
      3.times do @log_window.wait end
      @log_window.back_one
    end
    return false
  end
  
  #--------------------------------------------------------------------------
  # new method: process_action_charge
  #--------------------------------------------------------------------------
  def process_action_charge
    loop do
      break if $game_troop.all_dead?
      break unless @subject.current_action
      @subject.current_action.prepare
      execute_action if @subject.current_action.valid?
      @subject.remove_current_action
    end
    @subject.charged = false
  end
  
end # Scene_Battle

#==============================================================================
# 
# ¥ End of File
# 
#==============================================================================

이런식으로 스킬을 시전하는데 1턴,2턴 이런식으로 선턴을 조절할수있는 스크립트인데

이상하게

START_MSG_BEGIN = /<(?:START_CHARGE_MESSAGE|start charge message)>/i START_MSG_END = /<\/(?:START_CHARGE_MESSAGE|start charge message)>/i CONT_MSG_BEGIN = /<(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i CONT_MSG_END = /<\/(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i

이 부분이 제대로 작동을 해야되는데 작동을 안하네요. 제작자한테 물어볼려고해도 블로그에도 없고

포럼에 잇길레 질문을 하고 싶어도 어떻게 해야될지 모르겠고. 이곳 스크립트 고수분들한테 질문드립니다.

제가 어떤걸 잘못건드렸길레 메시지 출력이 되지 않는건가여?

건든건 하나도 없습니다 ㄷㄷ;

Who's 뿌잉뿌잉쨔응

profile

펭귄의 귀여움은 그 모든것을 이깁니다.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12397
턴제 전투 RMMV [MV] 전투 중 몬스터 부활기능 4 BMsoft 2020.12.11 290
기타 [Construct Classic]활성화 애니메이션 효과 13 말라야 2014.04.11 857
RMVXA [ACE] Khas Awesome Light Effects 스크립트중 선택지와 수치입력 2 file Galafrey 2012.10.10 1668
기타 [2d격투2nd] Hit 그래픽이 표시되지 않습니다! 줄기 2015.07.05 115
기타 [2d격겜만2nd] 타이틀과 셀렉트화면 질문입니다 file 줄기 2014.08.21 672
기타 [2d 격투 만들기 2nd] 점프중 이동 질문입니다 file 줄기 2015.09.03 152
RMXP [ 액알 ] 공격모션하고스킬 키를모르겟어요 ㅠㅠ 2 야구에달인 2011.09.04 2046
RMVX [ Vx Vampyr SBABS ] 액알 스크립트에 관해!!!!! 3 히트맨 2010.12.17 826
RMVX [ KGC_CategorizeSkill]스킬 사용 취소시, 카테고리창이 출력되지 않는 현상에 대한 질문입니다. 3 file 니노미야 2011.09.29 1871
RMVX ziifee's Wait Gauge Battle 이 배틀 시스템에 질문있어요~ 빡새 2013.05.18 609
RMVX ziifee's Wait Gauge Battle 사용시 궁금점 피망군 2013.05.02 596
RMVXA z,x키가 안먹힙니다. 5 재회 2013.08.03 743
RMVXA yse 엔진의 Charge skill 스크립트에 대해 질문합니다. 뿌잉뿌잉쨔응 2013.07.16 674
RMMV YEP의 Free Grid Plugin을 꼭 실행하고 싶.은.데.!!!! 버전이 요구하는 버전보다 이하라는 콘솔창이 계속 뜹니다!! ㅜㅜ 3 파란소리 2017.12.31 203
스크립트 사용 RMMV YEP셀프변수 플러그인은 구매할수밖에 없나요? 7 카르네스아리엔 2021.01.07 282
플러그인 사용 RMMV YEP_Battle A.I core를 이용해서 적의 행동패턴을 짜다가 문제가 생겼습니다. 2 file 프랑도르 2021.07.23 90
에러 해결 RMMV YEP_AnimatedSVEnemies를 쓰다가 문제가 발생했습니다.... 2 file JDG 2020.04.06 76
스크립트 추천 RMVXA yep message core같은 스크립트 있을까요? 4 설님 2021.03.02 178
RMMV yep item core 과 itembook 호환방법 8 푸른바람avangs 2017.08.02 126
플러그인 사용 RMMV YEP Grid-free Doodads 플러그인 사용하시는 분들 구매해서 사용하셨나요? 3 하하이 2023.02.19 77
Board Pagination Prev 1 ... 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 ... 516 Next
/ 516