设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1014|回复: 4
打印 上一主题 下一主题

[已经解决] 这个脚本怎么用

[复制链接]

Lv1.梦旅人

梦石
0
星屑
54
在线时间
197 小时
注册时间
2012-12-15
帖子
689
跳转到指定楼层
1
发表于 2014-1-20 13:29:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 闇·貘良 于 2014-1-20 14:41 编辑

貌似是关于聊天泡泡的
  1. #===========================================================================
  2. # ◆ A1 Scripts ◆
  3. #    吹き出しメッセージ(RGSS3)
  4. #
  5. # バージョン   : 1.00 (2012/01/12)
  6. # 作者         : A1
  7. # URL     : http://a1tktk.web.fc2.com/
  8. #---------------------------------------------------------------------------
  9. # 機能:
  10. # ・吹き出しメッセージを表示します
  11. #---------------------------------------------------------------------------
  12. # 更新履歴   :2012/01/12 Ver1.00 リリース
  13. #---------------------------------------------------------------------------
  14. # 設置場所      
  15. #    A1共通スクリプト以下
  16. #    (ネームウィンドウ以下)
  17. #
  18. # 必要スクリプト
  19. #    A1共通スクリプトVer4.00以上
  20. #
  21. # 必要ファイル
  22. #    Window_Popup.png  ※ Graphics/System にインポート
  23. #---------------------------------------------------------------------------
  24. # 使い方
  25. #   ■ 設定項目 に設定
  26. #
  27. #   イベントコマンド「注釈」に記述
  28. #
  29. #     並列吹き出し
  30. #
  31. #       指定後1回のの文章を並列吹き出しとして表示します
  32. #       並列吹き出しは、吹き出し表示中でもプレイヤーの移動や
  33. #       イベントコマンドの実行・続行が可能です
  34. #
  35. #       また、他の吹き出しと同時に閉じることがなくなります
  36. #
  37. #     イベント吹き出し event_id
  38. #
  39. #       イベントを直接指定して吹き出しを表示します
  40. #
  41. #     吹き出しクローズ key
  42. #
  43. #       指定した吹き出しを閉じます
  44. #       設定項目で設定した [歩行グラフィック名]_[歩行グラフィックIndex] を
  45. #       key に指定します
  46. #
  47. #       例:吹き出しクローズ Actor4_0
  48. #
  49. #     吹き出しクローズ [イベント,event_id]
  50. #
  51. #       イベント吹き出しで表示した吹き出しを閉じます
  52. #
  53. #       例:吹き出しクローズ [イベント,5]
  54. #
  55. #           ※先に「イベント吹き出し」でevent_id 5 のイベントに
  56. #             吹き出しを表示させているものとします
  57. #
  58. #     吹き出し使用 on|off
  59. #
  60. #       吹き出しの使用を切り替えます
  61. #       on で吹き出し使用、off で吹き出し使用しなくなります
  62. #
  63. #
  64. #   メッセージウィンドウコマンド
  65. #
  66. #     \CC[count] :クローズカウントを設定します(フレーム数)
  67. #                  設定項目のデフォルト値より優先されます
  68. #
  69. #     \KP        :吹き出しのヒレが「考え中」になります
  70. #
  71. #     \PR        :並列吹き出し状態として表示した吹き出しの
  72. #                  並列吹き出し状態をメッセージ終了後に解除します
  73. #
  74. #                  解除された場合、他の吹き出しと同時に閉じるようになります
  75. #==============================================================================
  76. $imported ||= {}
  77. $imported["A1_PopupMassage"] = true
  78. if $imported["A1_Common_Script"]
  79. old_common_script("吹き出しメッセージ", "4.00") if common_version < 4.00
  80. #==============================================================================
  81. # ■ 設定項目
  82. #==============================================================================
  83. module A1_System::CnildMassageWindowConfig
  84.   #--------------------------------------------------------------------------
  85.   # 顔グラフィックと歩行グラフィックの対応
  86.   #
  87.   #  "[顔グラフィック名]_[Index]" => "[歩行グラフィック名]_[Index]" ※Index毎に設定
  88.   #  "[顔グラフィック名]"         => "[歩行グラフィック名]_[Index]" ※該当顔グラフィック全てに適用
  89.   #
  90.   #  歩行グラフィックは配列で複数指定することが可能です
  91.   #--------------------------------------------------------------------------
  92.   LINK_FACE       = {
  93.    # 顔グラフィック => 歩行グラフィック
  94.     "Actor4_0"      => "Actor4_0",
  95.     "Actor4_4"      => "Actor4_4",
  96.     "Actor4_5"      => "Actor4_5",
  97.   }
  98.   #--------------------------------------------------------------------------
  99.   # 文字入力待ちでないウィンドウが閉じるまでの時間(フレーム)のデフォルト値
  100.   #   -1 にすると手動で閉じるかイベント終了まで閉じません
  101.   #   -1 にすると「並列吹き出し」にしたウィンドウは手動で閉じるまでずっと閉じません
  102.   #--------------------------------------------------------------------------
  103.   DEFAULT_CLOSE_COUNT = -1
  104.   #--------------------------------------------------------------------------
  105.   # 吹き出しメッセージ使用のデフォルト値
  106.   #--------------------------------------------------------------------------
  107.   DEFAULT_ENABLE_POPUP = true
  108. end
  109. #==============================================================================
  110. # ■ Cache
  111. #------------------------------------------------------------------------------
  112. #  各種グラフィックを読み込み、Bitmap オブジェクトを作成、保持するモジュール
  113. # です。読み込みの高速化とメモリ節約のため、作成した Bitmap オブジェクトを内部
  114. # のハッシュに保存し、同じビットマップが再度要求されたときに既存のオブジェクト
  115. # を返すようになっています。
  116. #==============================================================================

  117. module Cache
  118.   #--------------------------------------------------------------------------
  119.   # ○ 顔グラフィックの取得
  120.   #--------------------------------------------------------------------------
  121.   def self.half_face(filename)
  122.     load_file_name = "Graphics/Faces/#{filename}"
  123.     key            = "#{load_file_name}_halfface"
  124.     load_resize_bitmap(load_file_name, key, [-0.5, -0.5])
  125.   end
  126. end
  127. #==============================================================================
  128. # ■ Window_Message
  129. #------------------------------------------------------------------------------
  130. #  文章表示に使うメッセージウィンドウです。
  131. #==============================================================================

  132. class Window_Message < Window_Base
  133.   #--------------------------------------------------------------------------
  134.   # ○ 定数
  135.   #--------------------------------------------------------------------------
  136.   LINK_FACE = A1_System::CnildMassageWindowConfig::LINK_FACE
  137.   #--------------------------------------------------------------------------
  138.   # ○ 子メッセージウィンドウのキーを取得
  139.   #--------------------------------------------------------------------------
  140.   def child_key
  141.     return event_id_key if $game_temp.event_popup_id
  142.     key = LINK_FACE["#{$game_message.face_name}_#{$game_message.face_index}"]
  143.     key = LINK_FACE["#{$game_message.face_name}"] unless key
  144.     return key
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ○ イベントIDからキーを設定
  148.   #--------------------------------------------------------------------------
  149.   def event_id_key
  150.     key = "event_id_key_#{$game_temp.event_popup_id}"
  151.     $game_temp.event_popup_id = nil
  152.     return key
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ☆ 全ウィンドウの作成
  156.   #--------------------------------------------------------------------------
  157.   alias a1_child_message_window_wm_create_all_windows create_all_windows
  158.   def create_all_windows
  159.     a1_child_message_window_wm_create_all_windows
  160.     @child_message_window = {}
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ☆ 全ウィンドウの解放
  164.   #--------------------------------------------------------------------------
  165.   alias a1_child_message_window_wm_dispose_all_windows dispose_all_windows
  166.   def dispose_all_windows
  167.     a1_child_message_window_wm_dispose_all_windows
  168.     @child_message_window.values.each {|window| window.dispose }
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ☆ 全ウィンドウの更新
  172.   #--------------------------------------------------------------------------
  173.   alias a1_child_message_window_wm_update_all_windows update_all_windows
  174.   def update_all_windows
  175.     a1_child_message_window_wm_update_all_windows
  176.     @child_message_window.values.each {|window| window.update }
  177.     close_window = $game_message.close_message
  178.     @child_message_window[close_window].close if close_window && @child_message_window[close_window]
  179.     $game_message.close_message = nil
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ☆ 全テキストの処理
  183.   #--------------------------------------------------------------------------
  184.   alias a1_child_message_window_wm_process_all_text process_all_text
  185.   def process_all_text
  186.     @use_child = false
  187.     return a1_child_message_window_wm_process_all_text unless need_setup?
  188.     @child_key = child_key
  189.     return if setup_child_message if @child_key && !@child_key.empty?
  190.     a1_child_message_window_wm_process_all_text
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ○ 子メッセージウィンドウのセットアップが必要?
  194.   #--------------------------------------------------------------------------
  195.   def need_setup?
  196.     return false if $game_party.in_battle
  197.     return false if @my_child_window
  198.     return $game_system.enable_child_msg
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ○ 子メッセージウィンドウのセットアップ
  202.   #--------------------------------------------------------------------------
  203.   def setup_child_message
  204.     @child_message_window[@child_key] ||= create_child_message
  205.     return false unless @child_message_window[@child_key].link_event
  206.     close
  207.     process_child_message_window(@child_message_window[@child_key])
  208.     return true
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ 子メッセージウィンドウの作成
  212.   #--------------------------------------------------------------------------
  213.   def create_child_message
  214.     window = Window_ChildMessage.new
  215.     return set_link_event_id(window, $1.to_i) if @child_key =~ /event_id_key_(\d+)/
  216.     return window if link_player(window)
  217.     $game_map.events.values.each {|event| break if link_event(event, window) }
  218.     return window
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ○ リンクするプレイヤーの取得
  222.   #--------------------------------------------------------------------------
  223.   def link_player(window)
  224.     return true if link_event($game_player, window)
  225.     $game_player.followers.each {|follower| return true if link_event(follower, window) }
  226.     return false
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ○ リンクするイベントの取得
  230.   #--------------------------------------------------------------------------
  231.   def link_event(event, window)
  232.     return false unless search_link_event(event.character_name, event.character_index)
  233.     set_link_event(window, event)
  234.     return true
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ○ リンクするイベントの検索
  238.   #--------------------------------------------------------------------------
  239.   def search_link_event(name, index)
  240.     return "#{name}_#{index}" == @child_key unless @child_key.is_a?(Array)
  241.     @child_key.each {|key| return true if "#{name}_#{index}" == key }
  242.     return false
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ○ リンクするイベントの設定(ID)
  246.   #--------------------------------------------------------------------------
  247.   def set_link_event_id(window, event_id)
  248.     window.link_event = $game_map.events[event_id]
  249.     return window
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ○ リンクするイベントの設定
  253.   #--------------------------------------------------------------------------
  254.   def set_link_event(window, event)
  255.     window.link_event = event
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ○ 子メッセージウィンドウの処理
  259.   #--------------------------------------------------------------------------
  260.   def process_child_message_window(window)
  261.     @child_window = window
  262.     window.position     = $game_message.position
  263.     text                = convert_escape_characters($game_message.all_text)
  264.     text_width          = $a1_common.text_width(window.contents.font, text)
  265.     $game_message.texts = text.split("\n")
  266.     window.set_face_info($game_message.face_name, $game_message.face_index)
  267.     window.set_width(window.new_line_x + text_width + standard_padding * 2)
  268.     window.background   = $game_message.background
  269.     window.create_contents
  270.     setup_priority(window)
  271.     window.process_all_text
  272.     @use_child = true
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ○ 子メッセージウィンドウの表示優先度の設定
  276.   #--------------------------------------------------------------------------
  277.   def setup_priority(now_window)
  278.     @priority_order ||= []
  279.     @priority_order.delete(@child_key)
  280.     @priority_order.insert(0, @child_key)
  281.     @priority_order.each_with_index {|key, i | @child_message_window[key].priority = @priority_order.size - i }
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # ○ クローズカウントのセット
  285.   #--------------------------------------------------------------------------
  286.   def set_close_count(value)
  287.     @child_window.close_count = value
  288.     return ""
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ○ ポップアップ種別のセット
  292.   #--------------------------------------------------------------------------
  293.   def set_popup_kind
  294.     @child_window.popup_kind = 1
  295.     return ""
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ☆ 入力待ち処理
  299.   #--------------------------------------------------------------------------
  300.   alias a1_child_message_window_wm_input_pause input_pause
  301.   def input_pause
  302.     return if @use_child
  303.     a1_child_message_window_wm_input_pause
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ☆ ウィンドウを閉じ、完全に閉じるまで待つ
  307.   #--------------------------------------------------------------------------
  308.   alias a1_child_message_window_wm_close_and_wait close_and_wait
  309.   def close_and_wait
  310.     @child_message_window.values.each {|window| window.close if window.input_wait }
  311.     a1_child_message_window_wm_close_and_wait
  312.     @priority_order = []
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ☆ 全ウィンドウが完全に閉じているか判定
  316.   #--------------------------------------------------------------------------
  317.   alias a1_child_message_window_wm_all_close? all_close?
  318.   def all_close?
  319.     return false unless a1_child_message_window_wm_all_close?
  320.     @child_message_window.values.each {|window| return false unless window.close? if window.input_wait }
  321.     return true
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ☆ 背景と位置の変更判定
  325.   #--------------------------------------------------------------------------
  326.   alias a1_child_message_window_wm_settings_changed? settings_changed?
  327.   def settings_changed?
  328.     return false if $game_system.enable_child_msg
  329.     a1_child_message_window_wm_settings_changed?
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ○ 吹き出しの初期化
  333.   #--------------------------------------------------------------------------
  334.   def init_popup_message
  335.     @child_message_window.values.each {|window| window.dispose }
  336.     @child_message_window = {}
  337.   end
  338. end
  339. #==============================================================================
  340. # ■ Window_ChildMessage
  341. #==============================================================================

  342. class Window_ChildMessage < Window_Message
  343.   #--------------------------------------------------------------------------
  344.   # ○ 定数
  345.   #--------------------------------------------------------------------------
  346.   CLOSE_COUNT      = A1_System::CnildMassageWindowConfig::DEFAULT_CLOSE_COUNT
  347.   POS_UP           = 0
  348.   POS_MIDDLE       = 1
  349.   POS_DOWN         = 2
  350.   POPUP_RECT       = { POS_UP     => [Rect.new( 0,  0, 32, 64), Rect.new( 0, 64, 32, 64)],
  351.                        POS_MIDDLE => [Rect.new( 0,  0, 32, 64), Rect.new( 0, 64, 32, 64)],
  352.                        POS_DOWN   => [Rect.new(32,  0, 32, 64), Rect.new(32, 64, 32, 64)],
  353.                      }
  354.   #--------------------------------------------------------------------------
  355.   # ○ オブジェクト初期化
  356.   #--------------------------------------------------------------------------
  357.   def initialize
  358.     @my_child_window = true
  359.     @screen_width = Graphics.width
  360.     super
  361.     create_popup
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ○ 表示優先度の設定
  365.   #--------------------------------------------------------------------------
  366.   def priority=(value)
  367.     self.z = 200 + value
  368.     @popup_sprite.z = 200 + value
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ○ 吹き出しスプライトの作成
  372.   #--------------------------------------------------------------------------
  373.   def create_popup
  374.     @popup_sprite = Sprite.new
  375.     @popup_sprite.visible = false
  376.     @popup_bitmap = Cache.system("Window_Popup")
  377.     bitmap = Bitmap.new(32, 64)
  378.     @popup_sprite.bitmap = bitmap
  379.     @input_wait = true
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ○ 顔グラフィックの情報を設定
  383.   #--------------------------------------------------------------------------
  384.   def set_face_info(name, index)
  385.     @face_name  = name
  386.     @face_index = index
  387.     @name_window_key = show_name(@face_name, @face_index) if $imported["A1_Name_Window"]
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ○ リンクするイベントの取得
  391.   #--------------------------------------------------------------------------
  392.   def link_event
  393.     @event
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ○ リンクするイベントの設定
  397.   #--------------------------------------------------------------------------
  398.   def link_event=(event)
  399.     @event = event
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ○ 表示位置の設定
  403.   #--------------------------------------------------------------------------
  404.   def position=(pos)
  405.     @position = pos
  406.     @position = 0 if @position == 1
  407.     set_popup_bitmap(0)
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # ○ 背景の設定
  411.   #--------------------------------------------------------------------------
  412.   def background=(type)
  413.     @background = type
  414.     self.opacity = @background == 0 ? 255 : 0
  415.     setup_back_ground if @background == 1
  416.     @back_sprite.visible = false if @back_sprite && @background != 1
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ○ 背景のセットアップ
  420.   #--------------------------------------------------------------------------
  421.   def setup_back_ground
  422.     @back_bitmap.dispose if @back_bitmap
  423.     create_back_bitmap_ex
  424.     @back_sprite = Sprite.new unless @back_sprite
  425.     setup_back_sprite
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ○ 背景のビットマップ作成
  429.   #--------------------------------------------------------------------------
  430.   def create_back_bitmap_ex
  431.     @back_bitmap = Bitmap.new(width, height)
  432.     rect1 = Rect.new(0, 0, width, 12)
  433.     rect2 = Rect.new(0, 12, width, height - 24)
  434.     rect3 = Rect.new(0, height - 12, width, 12)
  435.     @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
  436.     @back_bitmap.fill_rect(rect2, back_color1)
  437.     @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ○ 背景のスプライトの作成
  441.   #--------------------------------------------------------------------------
  442.   def setup_back_sprite
  443.     @back_sprite.bitmap = @back_bitmap
  444.     @back_sprite.z = z - 1
  445.     @back_sprite.visible = false
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ○ 背景ビットマップの解放
  449.   #--------------------------------------------------------------------------
  450.   def dispose_back_bitmap
  451.     super if @back_bitmap
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ○ 背景スプライトの解放
  455.   #--------------------------------------------------------------------------
  456.   def dispose_back_sprite
  457.     super if @back_sprite
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ○ 背景スプライトの更新
  461.   #--------------------------------------------------------------------------
  462.   def update_back_sprite
  463.     return unless @back_sprite && @background == 1
  464.     @back_sprite.x = self.x
  465.     @back_sprite.y = self.y
  466.     @back_sprite.visible = true
  467.     @back_sprite.opacity = openness
  468.     @back_sprite.update
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ○ ウィンドウ背景の更新
  472.   #--------------------------------------------------------------------------
  473.   def update_background
  474.     self.opacity = @background == 0 ? 255 : 0
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ○ フレーム更新
  478.   #--------------------------------------------------------------------------
  479.   def update
  480.     return unless @event
  481.     update_pos
  482.     super
  483.     update_close_count
  484.     update_background
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # ○ クローズカウントの更新
  488.   #--------------------------------------------------------------------------
  489.   def update_close_count
  490.     return unless @close_count
  491.     return if @close_count < 0
  492.     @close_count -= 1
  493.     auto_close if @close_count == 0
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ○ ポップアップスプライト位置の設定
  497.   #--------------------------------------------------------------------------
  498.   def set_popup_pos
  499.     @popup_sprite.x = @event.screen_x
  500.     @popup_sprite.y = self.y + popup_pos_y
  501.     @popup_sprite.visible = open? && @background == 0
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ○ ポップアップビットマップの設定
  505.   #--------------------------------------------------------------------------
  506.   def set_popup_bitmap(kind)
  507.     @popup_sprite.bitmap.clear
  508.     @popup_sprite.bitmap.blt(0, 0, @popup_bitmap, POPUP_RECT[@position][kind])
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ○ ポップアップ種別の設定
  512.   #--------------------------------------------------------------------------
  513.   def popup_kind=(kind)
  514.     set_popup_bitmap(1)
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ○ ウィンドウ位置の更新
  518.   #--------------------------------------------------------------------------
  519.   def update_pos
  520.     self.x = @event.screen_x + @pos_x
  521.     self.y = @event.screen_y + pos_y
  522.     set_popup_pos
  523.     set_name_window_pos if $imported["A1_Name_Window"]
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ○ ネームウィンドウの位置設定
  527.   #--------------------------------------------------------------------------
  528.   def set_name_window_pos
  529.     return unless @name_windows[@name_window_key]
  530.     @name_windows[@name_window_key].x = self.x + 24
  531.     @name_windows[@name_window_key].y = name_window_y
  532.     @name_windows[@name_window_key].z = self.z
  533.     @name_windows[@name_window_key].set_name_sprite_pos
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # ○ ネームウィンドウのy座標設定
  537.   #--------------------------------------------------------------------------
  538.   def name_window_y
  539.     return self.y + self.height - 12 if @position == 2
  540.     self.y - 16
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # ○ ウィンドウx座標の取得
  544.   #--------------------------------------------------------------------------
  545.   def set_pos_x
  546.     base = @event.screen_x - 64
  547.     return @pos_x = (@screen_width - self.width) - (base + 64) if base + self.width > @screen_width
  548.     @pos_x = -64
  549.   end
  550.   #--------------------------------------------------------------------------
  551.   # ○ ウィンドウy座標の取得
  552.   #--------------------------------------------------------------------------
  553.   def pos_y
  554.     return -116 if @position == 0
  555.     return  16 if @position == 2
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ○ ポップアップy座標の取得
  559.   #--------------------------------------------------------------------------
  560.   def popup_pos_y
  561.     return self.height - 32 if @position == 0
  562.     return -32 if @position == 2
  563.   end
  564.   #--------------------------------------------------------------------------
  565.   # ○ 自動で閉じる
  566.   #--------------------------------------------------------------------------
  567.   def auto_close
  568.     close
  569.     @close_count = nil
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ○ 解放
  573.   #--------------------------------------------------------------------------
  574.   def dispose
  575.     @popup_sprite.bitmap.dispose
  576.     @popup_sprite.dispose
  577.     super
  578.   end
  579.   #--------------------------------------------------------------------------
  580.   # ○ 制御文字の事前変換
  581.   #--------------------------------------------------------------------------
  582.   def convert_escape_characters(text)
  583.     text
  584.   end
  585.   #--------------------------------------------------------------------------
  586.   # ○ 背景ビットマップの作成
  587.   #--------------------------------------------------------------------------
  588.   def create_back_bitmap
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ○ 背景スプライトの作成
  592.   #--------------------------------------------------------------------------
  593.   def create_back_sprite
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ○ 全ウィンドウの作成
  597.   #--------------------------------------------------------------------------
  598.   def create_all_windows
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ○ 全ウィンドウの解放
  602.   #--------------------------------------------------------------------------
  603.   def dispose_all_windows
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ○ 全ウィンドウの更新
  607.   #--------------------------------------------------------------------------
  608.   def update_all_windows
  609.   end
  610.   #--------------------------------------------------------------------------
  611.   # ○ 全ウィンドウが完全に閉じているか判定
  612.   #--------------------------------------------------------------------------
  613.   def all_close?
  614.     close?
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ○ ファイバーの更新
  618.   #--------------------------------------------------------------------------
  619.   def update_fiber
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # ○ 入力処理
  623.   #--------------------------------------------------------------------------
  624.   def process_input
  625.     input_pause unless @pause_skip
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ○ ウィンドウ幅の取得
  629.   #--------------------------------------------------------------------------
  630.   def window_width
  631.     return self.width unless self.disposed?
  632.     Graphics.width
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ○ ウィンドウ高さの取得
  636.   #--------------------------------------------------------------------------
  637.   def window_height
  638.     fitting_height(visible_line_number)
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ○ 表示行数の取得
  642.   #--------------------------------------------------------------------------
  643.   def visible_line_number
  644.     return 2
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ○ ウィンドウ幅の設定
  648.   #--------------------------------------------------------------------------
  649.   def set_width(width)
  650.     self.width         = width
  651.   end
  652.   #--------------------------------------------------------------------------
  653.   # ○ テキストの設定
  654.   #--------------------------------------------------------------------------
  655.   def text=(text)
  656.     @text = text
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ○ 全テキストの処理
  660.   #--------------------------------------------------------------------------
  661.   def process_all_text
  662.     @input_wait = $game_temp.input_wait
  663.     $game_temp.input_wait = true
  664.     set_pos_x
  665.     super
  666.     @init_close_count = CLOSE_COUNT unless @init_close_count
  667.     input_pause
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # ○ ウィンドウを開き、完全に開くまで待つ
  671.   #--------------------------------------------------------------------------
  672.   def open_and_wait
  673.     open
  674.     Fiber.yield until open? if @input_wait
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ○ 入力待ち取得
  678.   #--------------------------------------------------------------------------
  679.   def input_wait
  680.     @input_wait
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ○ 入力待ち取得
  684.   #--------------------------------------------------------------------------
  685.   def input_wait
  686.     @input_wait
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ○ 入力待ち処理
  690.   #--------------------------------------------------------------------------
  691.   def input_pause
  692.     reset_close_count
  693.     super if @input_wait
  694.     @input_wait = true if @parallel_release
  695.     @parallel_release = false
  696.     start_close_count
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # ○ クローズカウントの開始
  700.   #--------------------------------------------------------------------------
  701.   def start_close_count
  702.     @close_count = @init_close_count
  703.     @init_close_count = nil
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ○ クローズカウントの設定
  707.   #--------------------------------------------------------------------------
  708.   def close_count=(count)
  709.     @init_close_count = count
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ○ クローズカウントのリセット
  713.   #--------------------------------------------------------------------------
  714.   def reset_close_count
  715.     @close_count      = nil
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ○ ウィンドウを閉じる
  719.   #--------------------------------------------------------------------------
  720.   def close
  721.     reset_close_count
  722.     super
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # ○ 改行位置の取得
  726.   #--------------------------------------------------------------------------
  727.   def new_line_x
  728.     $game_message.face_name.empty? ? 0 : 56
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # ○ 制御文字の処理
  732.   #     code : 制御文字の本体部分(「\C[1]」なら「C」)
  733.   #     text : 描画処理中の文字列バッファ(必要なら破壊的に変更)
  734.   #     pos  : 描画位置 {:x, :y, :new_x, :height}
  735.   #--------------------------------------------------------------------------
  736.   def process_escape_character(code, text, pos)
  737.     case code.upcase
  738.     when 'PR'
  739.       @parallel_release = true
  740.     else
  741.       super
  742.     end
  743.   end
  744.   #--------------------------------------------------------------------------
  745.   # ○ ネームウィンドウの表示
  746.   #--------------------------------------------------------------------------
  747.   def show_name_window(face_name, face_index, x, size = 96)
  748.     super
  749.     set_name_window_pos
  750.   end
  751. end
  752. #==============================================================================
  753. # ■ Window_Base
  754. #------------------------------------------------------------------------------
  755. #  ゲーム中の全てのウィンドウのスーパークラスです。
  756. #==============================================================================

  757. class Window_Base < Window
  758.   #--------------------------------------------------------------------------
  759.   # ☆ 顔グラフィックの描画
  760.   #     enabled : 有効フラグ。false のとき半透明で描画
  761.   #--------------------------------------------------------------------------
  762.   alias a1_child_message_window_wb_draw_face draw_face
  763.   def draw_face(face_name, face_index, x, y, size = 96)
  764.     return draw_face_half(face_name, face_index, x, y, size) if @my_child_window
  765.     a1_child_message_window_wb_draw_face(face_name, face_index, x, y, size)
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ○ 顔グラフィックの描画(ハーフサイズ)
  769.   #     enabled : 有効フラグ。false のとき半透明で描画
  770.   #--------------------------------------------------------------------------
  771.   def draw_face_half(face_name, face_index, x, y, enabled = true)
  772.     draw_half_face(face_name, face_index, x, y, enabled) unless face_name.empty?
  773.     show_name_window(face_name, face_index, x, 48) if $imported["A1_Name_Window"]
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ○ 顔グラフィックの描画(ハーフサイズ)
  777.   #--------------------------------------------------------------------------
  778.   def draw_half_face(face_name, face_index, x, y, enabled)
  779.     bitmap = Cache.half_face(face_name)
  780.     rect = Rect.new(face_index % 4 * 48, face_index / 4 * 48, 48, 48)
  781.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ☆ 制御文字の事前変換
  785.   #    実際の描画を始める前に、原則として文字列に変わるものだけを置き換える。
  786.   #    文字「\」はエスケープ文字(\e)に変換。
  787.   #--------------------------------------------------------------------------
  788.   alias a1_child_message_window_wb_convert_escape_characters convert_escape_characters
  789.   def convert_escape_characters(text)
  790.     result = a1_child_message_window_wb_convert_escape_characters(text)
  791.     result.gsub!(/\eCC\[(\d+)\]/i)          { set_close_count($1.to_i) }
  792.     result.gsub!(/\eKP/i)                   { set_popup_kind }
  793.     result
  794.   end
  795. end
  796. #==============================================================================
  797. # ■ Game_Message
  798. #------------------------------------------------------------------------------
  799. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。この
  800. # クラスのインスタンスは $game_message で参照されます。
  801. #==============================================================================

  802. class Game_Message
  803.   #--------------------------------------------------------------------------
  804.   # ○ 公開インスタンス変数
  805.   #--------------------------------------------------------------------------
  806.   attr_accessor :close_message
  807.   #--------------------------------------------------------------------------
  808.   # ☆ オブジェクト初期化
  809.   #--------------------------------------------------------------------------
  810.   alias a1_child_message_window_gm_initialize initialize
  811.   def initialize
  812.     a1_child_message_window_gm_initialize
  813.     @input_wait    = true
  814.     @close_message = nil
  815.   end
  816.   #--------------------------------------------------------------------------
  817.   # ○ 表示するテキストの設定
  818.   #--------------------------------------------------------------------------
  819.   def texts=(text)
  820.     @texts = text
  821.   end
  822. end
  823. #==============================================================================
  824. # ■ Game_Temp
  825. #------------------------------------------------------------------------------
  826. #  セーブデータに含まれない、一時的なデータを扱うクラスです。このクラスのイン
  827. # スタンスは $game_temp で参照されます。
  828. #==============================================================================

  829. class Game_Temp
  830.   #--------------------------------------------------------------------------
  831.   # ○ 公開インスタンス変数
  832.   #--------------------------------------------------------------------------
  833.   attr_accessor :input_wait
  834.   attr_accessor :event_popup_id
  835.   #--------------------------------------------------------------------------
  836.   # ☆ オブジェクト初期化
  837.   #--------------------------------------------------------------------------
  838.   alias a1_child_message_gt_initialize initialize
  839.   def initialize
  840.     a1_child_message_gt_initialize
  841.     @input_wait     = true
  842.     @event_popup_id = nil
  843.   end
  844. end
  845. #==============================================================================
  846. # ■ Game_System
  847. #------------------------------------------------------------------------------
  848. #  システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
  849. # します。このクラスのインスタンスは $game_system で参照されます。
  850. #==============================================================================

  851. class Game_System
  852.   #--------------------------------------------------------------------------
  853.   # ○ 公開インスタンス変数
  854.   #--------------------------------------------------------------------------
  855.   attr_accessor :enable_child_msg
  856.   #--------------------------------------------------------------------------
  857.   # ☆ オブジェクト初期化
  858.   #--------------------------------------------------------------------------
  859.   alias a1_child_message_gs_initialize initialize
  860.   def initialize
  861.     a1_child_message_gs_initialize
  862.     @enable_child_msg = A1_System::CnildMassageWindowConfig::DEFAULT_ENABLE_POPUP
  863.   end
  864. end
  865. #==============================================================================
  866. # ■ A1_System::CommonModule
  867. #==============================================================================

  868. class A1_System::CommonModule
  869.   #--------------------------------------------------------------------------
  870.   # ☆ 注釈コマンド定義
  871.   #--------------------------------------------------------------------------
  872.   alias a1_child_message_define_command define_command
  873.   def define_command
  874.     a1_child_message_define_command
  875.     @cmd_108["並列吹き出し"]     = :sub_message
  876.     @cmd_108["吹き出しクローズ"] = :close_popup
  877.     @cmd_108["吹き出し使用"]     = :use_popup_message
  878.     @cmd_108["イベント吹き出し"] = :event_popup_message
  879.   end
  880. end
  881. #==============================================================================
  882. # ■ Game_Interpreter
  883. #------------------------------------------------------------------------------
  884. #  イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
  885. # Game_Troop クラス、Game_Event クラスの内部で使用されます。
  886. #==============================================================================

  887. class Game_Interpreter
  888.   #--------------------------------------------------------------------------
  889.   # ○ 並列吹き出し
  890.   #--------------------------------------------------------------------------
  891.   def sub_message(params)
  892.     $game_temp.input_wait = false
  893.   end
  894.   #--------------------------------------------------------------------------
  895.   # ○ 吹き出しクローズ
  896.   #--------------------------------------------------------------------------
  897.   def close_popup(params)
  898.     return close_popup_id(params[0]) if params[0].is_a?(Array)
  899.     $game_message.close_message = params[0]
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ○ 吹き出しクローズ(ID)
  903.   #--------------------------------------------------------------------------
  904.   def close_popup_id(params)
  905.     $game_message.close_message = "event_id_key_#{params[1].to_i}" if params[0] == "イベント"
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ○ 吹き出し使用
  909.   #--------------------------------------------------------------------------
  910.   def use_popup_message(params)
  911.     $game_system.enable_child_msg = params[0] == "on" ? true : false
  912.   end
  913.   #--------------------------------------------------------------------------
  914.   # ○ イベント吹き出し
  915.   #--------------------------------------------------------------------------
  916.   def event_popup_message(params)
  917.     $game_temp.event_popup_id = params[0].to_i
  918.   end
  919. end
  920. #==============================================================================
  921. # ■ Scene_Map
  922. #------------------------------------------------------------------------------
  923. #  マップ画面の処理を行うクラスです。
  924. #==============================================================================

  925. class Scene_Map < Scene_Base
  926.   #--------------------------------------------------------------------------
  927.   # ☆ 場所移動の処理
  928.   #--------------------------------------------------------------------------
  929.   alias a1_child_message_sm_perform_transfer perform_transfer
  930.   def perform_transfer
  931.     prev_map = $game_map.map_id
  932.     a1_child_message_sm_perform_transfer
  933.     @message_window.init_popup_message if prev_map != $game_map.map_id
  934.   end
  935. end
  936. #==============================================================================
  937. # ■ ネームウィンドウインポート時処理
  938. #==============================================================================
  939. if $imported["A1_Name_Window"]
  940. #==============================================================================
  941. # ■ Window_FaceName
  942. #==============================================================================

  943. class Window_FaceName < Window_Base
  944.   #--------------------------------------------------------------------------
  945.   # ○ ネームスプライトの位置設定
  946.   #--------------------------------------------------------------------------
  947.   def set_name_sprite_pos
  948.     @name_sprite.x = self.x + self.width / 2
  949.     @name_sprite.y = self.y + self.height / 2
  950.   end
  951. end;end
  952. end
复制代码
不会的话也回复一下好了···

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2012-3-3
帖子
65
2
发表于 2014-1-20 14:55:10 | 只看该作者
# 必要スクリプト

#    A1共通スクリプトVer4.00以上
是不是还少了点什么基础脚本啊?

点评

顺便往下看  发表于 2014-1-20 14:59
好像没有啊  发表于 2014-1-20 14:57
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
197 小时
注册时间
2012-12-15
帖子
689
3
 楼主| 发表于 2014-1-20 14:59:19 | 只看该作者
我发个下载原来的(脚本在里面)

204556ce4rk02pereynh5n.rar

17.9 KB, 下载次数: 10

点评

要把上面那个A1共同那个脚本一起贴上  发表于 2014-1-20 15:03
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
197 小时
注册时间
2012-12-15
帖子
689
4
 楼主| 发表于 2014-1-20 15:07:30 | 只看该作者
@Mr丶木头
要把上面那个A1共同那个脚本一起贴上

什么意思,还是不知道这个脚本具体怎么用。····

点评

它的使用方法在24-74行,你用词典粗略翻译一下, 用这个脚本的话要把你发的那个压缩包里的两个脚本都贴在你的工程里。  发表于 2014-1-20 15:17
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
121 小时
注册时间
2013-9-19
帖子
163
5
发表于 2014-1-20 19:13:12 | 只看该作者

评分

参与人数 1星屑 +100 收起 理由
Sion + 100 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-25 13:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表