Ace 스크립트

사용법 - 이벤트에 스크립트로 입력
# 종류 / 0=아이템 1=무기 2=방어구 3=스킬 4=
#돈
type = 0
# ID  / 돈의 경우 액수를 입력
id   = 1
# 입수 텍스트/돈의 경우 무효
text = "아이템획득!"
#
e = $game_temp.streffect
e.push(Window_Getinfo.new(id, type, text))







=begin #=======================================================================
  
◆◇入手インフォメーション+マップエフェクトベース RGSS3◇◆ ※starさんの移植品

◆DEICIDE ALMA
◆レーネ 
◆http://blog.goo.ne.jp/exa_deicide_alma

★変更点
インフォの文章はヘルプの1行目の文章になります。
(<info:任意の文字列>で指定した場合はそちらを優先)

GET = true ならインフォを出したアイテムを入手します。
(アイテム、武器、防具、お金が対象)

◆導入箇所
▼素材のところ、mainより上

=end #=========================================================================
#==============================================================================
# ★RGSS2 
# STEMB_マップエフェクトベース v0.8
# ・エフェクト表示のための配列定義、フレーム更新、ビューポート関連付け
#
#==============================================================================
# ★RGSS2 
# STR20_入手インフォメーション v1.2 09/03/17
# ・マップ画面にアイテム入手・スキル修得などの際に表示するインフォです。
# ・表示内容は 任意指定の名目+アイテム名+ヘルプメッセージとなります。
# ・アイテムのメモ欄に <info:任意の文字列> と記述することで
#  通常とは別の説明文をインフォに表示させることができます。
# [仕様]インフォが表示されている間も移動できます。
#    移動させたくない場合はウェイトを入れてください。
#
#==============================================================================
class Window_Getinfo < Window_Base
  # 設定箇所
  G_ICON  = 260   # ゴールド入手インフォに使用するアイコンインデックス 
  Y_TYPE  = 0     # Y座標の位置(0 = 上基準 1 = 下基準)
  Z       = 188   # Z座標(問題が起きない限り変更しないでください)
  TIME    = 180   # インフォ表示時間(1/60sec)
  OPACITY = 32    # 透明度変化スピード
  B_COLOR = Color.new(0, 0, 0, 160)        # インフォバックの色
  INFO_SE = RPG::SE.new("fanfale", 80, 100) # インフォ表示時の効果音
  
  #STR20W  = /info\[\/(.*)\/\]/im # メモ設定ワード(VXと同じ)
  STR20W  = /<info:(.*?)>/im      # メモ設定ワード
  
  GET = true # インフォを出したアイテムを入手するかどうか(スキルは除く)
end
#
if false
# ★以下をコマンドのスクリプト等に貼り付けてテキスト表示----------------★

# 種類 / 0=アイテム 1=武器 2=防具 3=スキル 4=金
type = 0
# ID  / 金の場合は金額を入力
id   = 1
# 入手テキスト / 金の場合無効
text = "아이템 획득!"
#
e = $game_temp.streffect
e.push(Window_Getinfo.new(id, type, text))

# ★ここまで------------------------------------------------------------★
#
# ◇スキル修得時などにアクター名を直接打ち込むと
#  アクターの名前が変えられるゲームなどで問題が生じます。
#  なので、以下のようにtext部分を改造するといいかもしれません。
#
# 指定IDのアクターの名前取得
t = $game_actors[1].name 
text = t + " / 스킬 습득!"
#
end

class Game_Temp
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :streffect
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_stref initialize
  def initialize
    initialize_stref
    @streffect = []
  end
end

class Spriteset_Map
  #--------------------------------------------------------------------------
  # ● エフェクトの作成
  #--------------------------------------------------------------------------
  def create_streffect
    $game_temp.streffect = []
  end
  #--------------------------------------------------------------------------
  # ● エフェクトの解放
  #--------------------------------------------------------------------------
  def dispose_streffect
    (0...$game_temp.streffect.size).each do |i|
      $game_temp.streffect[i].dispose if $game_temp.streffect[i] != nil
    end
    $game_temp.streffect = []
  end
  #--------------------------------------------------------------------------
  # ● エフェクトの更新
  #--------------------------------------------------------------------------
  def update_streffect
    (0...$game_temp.streffect.size).each do |i|
      if $game_temp.streffect[i] != nil
        $game_temp.streffect[i].viewport = @viewport1
        $game_temp.streffect[i].update
        $game_temp.streffect.delete_at(i) if $game_temp.streffect[i].disposed?
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 遠景の作成(エイリアス)
  #--------------------------------------------------------------------------
  alias create_parallax_stref create_parallax
  def create_parallax
    create_parallax_stref
    create_streffect
  end
  #--------------------------------------------------------------------------
  # ● 解放(エイリアス)
  #--------------------------------------------------------------------------
  alias dispose_stref dispose
  def dispose
    dispose_streffect
    dispose_stref
  end
  #--------------------------------------------------------------------------
  # ● 更新(エイリアス)
  #--------------------------------------------------------------------------
  alias update_stref update
  def update
    update_stref
    update_streffect
  end
end

class Window_Getinfo < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(id, type, text = "")
    super(-16, 0, 640 + 32, 38 + 32)
    self.z = Z
    self.contents_opacity = 0
    self.back_opacity = 0
    self.opacity = 0
    @count = 0
    @i = $game_temp.getinfo_size.index(nil)
    @i = $game_temp.getinfo_size.size if (@i == nil)
    if Y_TYPE == 0
      self.y = -14 + (@i * 40)
    else
      self.y = 480 - 58 - (@i * 40)
    end
    $game_temp.getinfo_size[@i] = true 
    refresh(id, type, text)
    INFO_SE.play
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    $game_temp.getinfo_size[@i] = nil
    super
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    self.viewport = nil
    @count += 1
    unless @count >= TIME
      self.contents_opacity += OPACITY
    else
      if Y_TYPE == 0
        self.y -= 1
      else
        self.y += 1
      end
      self.contents_opacity -= OPACITY
      dispose if self.contents_opacity == 0
    end
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh(id, type, text = "")
    case type
    when 0 ; data = $data_items[id]
    when 1 ; data = $data_weapons[id]
    when 2 ; data = $data_armors[id]
    when 3 ; data = $data_skills[id]
    when 4 ; data = id
    else   ; p "type의 값이 이상합니다."
    end
    c = B_COLOR
    self.contents.fill_rect(0, 14, 640, 24, c)
    if type < 4
      draw_item_name(data, 4, 14)
      self.contents.draw_text(250, 14, 340, line_height, description(data))##
    else
      draw_icon(G_ICON, 4, 14)
      self.contents.draw_text(28, 14, 176, line_height, 
      data.to_s + Vocab.currency_unit)
      $game_party.gain_gold(id) if GET
    end
    self.contents.font.size = 14
    w = self.contents.text_size(text).width
    self.contents.fill_rect(0, 0, w + 4, 14, c)
    self.contents.draw_text_f(4, 0, 340, 14, text)
    $game_party.gain_item(data,1) if type <= 2 && GET
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ● 解説文取得
  #--------------------------------------------------------------------------
  def description(data)
    if data.note =~ /#{STR20W}/
      return $1
    end
    text = data.description.dup
    text.sub!(/[\r\n]+.*/m, "")
    return text
  end
end

class Game_Temp
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :getinfo_size
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_str20 initialize
  def initialize
    initialize_str20
    @getinfo_size = []
  end
end

class Bitmap
unless public_method_defined?(:draw_text_f)
  #--------------------------------------------------------------------------
  # ● 文字縁取り描画
  #--------------------------------------------------------------------------
  def draw_text_f(x, y, width, height, str, align = 0, color = Color.new(64,32,128))
    shadow = self.font.shadow
    b_color = self.font.color.dup
    outline = self.font.outline
    self.font.outline = false
    font.shadow = false
    font.color = color
    draw_text(x + 1, y, width, height, str, align) 
    draw_text(x - 1, y, width, height, str, align) 
    draw_text(x, y + 1, width, height, str, align) 
    draw_text(x, y - 1, width, height, str, align) 
    font.color = b_color
    draw_text(x, y, width, height, str, align)
    font.shadow = shadow
    self.font.outline = outline
  end
  def draw_text_f_rect(r, str, align = 0, color = Color.new(64,32,128)) 
    draw_text_f(r.x, r.y, r.width, r.height, str, align, color) 
  end
end
end

Who's 폴라

profile

그냥 가끔 생각나면 제작 잠깐 하느라 제작 속도가 현저히 느립니다


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28928
217 전투 스킬 캐스팅 시스템 3 스리아씨 2013.10.12 32176
216 전투 RPG VX Ace 전투 대사 한글화 37 재규어 2012.01.04 20292
215 전투 Yanfly 엔진 - 몬스터의 레벨 설정 6 file 스리아씨 2013.11.08 13003
214 이름입력 한글 이름입력창 23 file 에틴 2012.01.23 11680
213 기타 Dialog Extractor 1.04 (VXA/VX/XP) 6 AltusZeon 2014.01.16 11672
212 기타 원하는 글씨체로 변경하기 12 조말생 2012.04.20 8847
211 이름입력 전체키 + 조합한글 + 이름입력처리 변경 47 file 허걱 2012.07.04 8200
210 전투 vx ace 애니메이션 배틀 3 gor 2012.05.27 7664
209 전투 SRPG 컨버터 for Ace (SRPGコンバータ for Ace) by AD.Bank 27 file 습작 2012.04.17 7274
208 메시지 [스크립트] Ace Message System - by. Yanfly 17 file 허걱 2012.05.21 7271
207 그래픽 [ACE][BR] Awesome Light Effects 1.0(빛관련 스크립트) 37 file 꿈꾸는사람 2012.08.02 7015
206 메뉴 Etude87's Menu Editor 44 file 습작 2014.07.17 6996
205 전투 [스크립트] Sideview Battle System ver. 1.00 (일본어) 7 file 허걱 2012.05.20 6912
204 제작도구 VXAce HUD Designer by Cidiomar R. Dias Jr 1 file 습작 2013.01.19 6762
203 메뉴 [VX Ace] 다이얼 링 메뉴 스크립트 8 file RaonHank 2012.04.16 6673
202 스킬 VXACE 패시브 스킬 스크립트 Ver. 0.82 21 file 아이미르 2012.03.07 6669
201 장비 사용자 장비 슬롯 1.1 27 file 아방스 2012.01.31 6615
200 미니맵 미니맵 표시 스크립트 21 file 아방스 2012.01.16 6488
199 전투 VXAce 사이드뷰 스크립트 (번역) 23 아이미르 2012.12.10 6356
198 전투 XAS Hero Edition Ace Experimental 0.5 6 Alkaid 2012.01.15 6130
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11