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

Project1

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

[已经过期] 关于“对话框出现选项”的脚本,有谁解释下怎么用?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
62 小时
注册时间
2012-10-25
帖子
53
跳转到指定楼层
1
 楼主| 发表于 2013-2-9 03:45:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 孤客 于 2013-2-9 21:27 编辑

最下面就是那个“对话框选项”的脚本了,用过的来说明一下吧???谢谢!

看得我头晕眼花了。。而且还是日文的我搞不懂啊。。
还有听说这脚本有图片素材的,谁能给我个啊?或者给我个工程范本吧,谢谢了!

  1. #==============================================================================
  2. # □ 選択肢の作成 (for VX Ace)
  3. #------------------------------------------------------------------------------
  4. # Version : 1_20120112
  5. # by サリサ・タイクーン
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # □ 素材スイッチ
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["選択肢の作成"] = true

  13. if $rgsslab["選択肢の作成"]
  14.   
  15. #==============================================================================
  16. # □ カスタマイズポイント
  17. #==============================================================================
  18. module RGSSLAB end
  19. module RGSSLAB::Choices_Make
  20.   #--------------------------------------------------------------------------
  21.   # ○ 選択肢の作成
  22.   #    記述方法:
  23.   #    "呼び出しの文字列" => [ "選択肢",
  24.   #                            "選択肢",
  25.   #                                 …,
  26.   #                          ],
  27.   #    (最後の設定のみ、後ろのカンマを省略できます)
  28.   #
  29.   #    呼び出しの文字列は、その選択肢を呼び出す時のキーで
  30.   #    イベントコマンドのスクリプトにおいて
  31.   #    「call_choices("呼び出しの文字列")」
  32.   #    と言うように記述する為にあるものです。
  33.   #   
  34.   #    選択肢の数の範囲は、2~7まで対応します。
  35.   #
  36.   #    尚、MODEが1の場合に限り、制御文字が扱えますが
  37.   #    扱う場合は、\を1つ多く記述して下さい。
  38.   #
  39.   #    例:\N[1]の場合→ \\N[1] と言う風にして下さい。
  40.   #--------------------------------------------------------------------------
  41.   SETTING = {
  42.   # 1:選択肢画面
  43.   "選択肢画面" => [
  44.     "1番目の選択肢",
  45.     "2番目の選択肢",
  46.     "3番目の選択肢",
  47.     "4番目の選択肢",
  48.     "5番目の選択肢",
  49.     "6番目の選択肢",
  50.     "7番目の選択肢",
  51.     ],
  52.   ###
  53.    
  54.   }
  55. end

  56. # カスタマイズポイントは、ここまで

  57. #==============================================================================
  58. # □ RGSSLAB::Choices_Make [module]
  59. #==============================================================================
  60. module RGSSLAB::Choices_Make
  61.   #--------------------------------------------------------------------------
  62.   # ○ 素材設定用の定数定義
  63.   #--------------------------------------------------------------------------
  64.   MATERIAL_NAME = "選択肢の作成"
  65.   VERSION       = 1
  66.   RELEASE       = 20120112
  67. end

  68. #==============================================================================
  69. # ■ Game_Interpreter [class]
  70. #==============================================================================
  71. class Game_Interpreter
  72.   #--------------------------------------------------------------------------
  73.   # ○ モジュールの設定
  74.   #--------------------------------------------------------------------------
  75.   RGSSLAB_052_2 = RGSSLAB::Choices_Make
  76. end

  77. #==============================================================================
  78. # □ Scene_Choices [class]
  79. #==============================================================================
  80. class Scene_Choices
  81.   #--------------------------------------------------------------------------
  82.   # ○ モジュールの設定
  83.   #--------------------------------------------------------------------------
  84.   RGSSLAB_052_2 = RGSSLAB::Choices_Make
  85. end

  86. end
复制代码

  1. #==============================================================================
  2. # □ 選択肢画面 (for VX Ace)
  3. #------------------------------------------------------------------------------
  4. # Version : 2_20120223
  5. # by サリサ・タイクーン
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # □ 素材スイッチ
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["選択肢画面"] = true

  13. if $rgsslab["選択肢画面"]
  14.   
  15. #==============================================================================
  16. # □ カスタマイズポイント
  17. #==============================================================================
  18. module RGSSLAB end
  19. module RGSSLAB::Scene_Choices
  20.   #--------------------------------------------------------------------------
  21.   # ○ 結果内容を受け取る変数
  22.   #    受け取る変数を指定します。
  23.   #
  24.   #    注意:
  25.   #    変数拡張の変数に設定する事はできません。
  26.   #--------------------------------------------------------------------------
  27.   RESULT_VARIABLE = 3
  28.   #--------------------------------------------------------------------------
  29.   # ○ 選択肢の番号表示
  30.   #    0 : アラビア数字
  31.   #    1 : アルファベット
  32.   #    2 : ローマ数字
  33.   #    3 : 漢数字
  34.   #
  35.   #    上記以外は、0として扱われます。
  36.   #--------------------------------------------------------------------------
  37.   DRAW = 0
  38.   #--------------------------------------------------------------------------
  39.   # ○ モードの選択(New!)
  40.   #    この素材のモードを選択します。
  41.   #
  42.   #    0 : 通常モード(制御文字は使えません)
  43.   #    1 : 制御文字モード
  44.   #
  45.   #    これら以外の数値は0として扱われます。
  46.   #
  47.   #    使えない制御文字もありますので、ご注意下さい。
  48.   #--------------------------------------------------------------------------
  49.   MODE = 0
  50. end

  51. # カスタマイズポイントは、ここまで

  52. #==============================================================================
  53. # □ RGSSLAB::Scene_Choices [module]
  54. #==============================================================================
  55. module RGSSLAB::Scene_Choices
  56.   #--------------------------------------------------------------------------
  57.   # ○ 素材設定用の定数定義
  58.   #--------------------------------------------------------------------------
  59.   MATERIAL_NAME = "選択肢画面"
  60.   VERSION       = 2
  61.   RELEASE       = 20120223
  62.   #--------------------------------------------------------------------------
  63.   # ○ 操作エラー
  64.   #     error_number : エラー番号
  65.   #--------------------------------------------------------------------------
  66.   def self.operate_error(error_number)
  67.     text = "【RGSS研究所:#{MATERIAL_NAME}】"
  68.     case error_number
  69.     when 1
  70.       msgbox_p text,
  71.       "呼び出しの文字列を記述して下さい。"
  72.     when 2
  73.       msgbox_p text,
  74.       "呼び出しの文字列:#{string}は存在しない為、実行できません。"
  75.     when 3
  76.       msgbox_p text,
  77.       "選択肢の数が2よりも小さい為、実行できません。"
  78.     when 4
  79.       msgbox_p text,
  80.       "選択肢の数が7よりも多い為、実行できません。"
  81.     end
  82.   end
  83. end

  84. #==============================================================================
  85. # ■ Game_Interpreter [class]
  86. #==============================================================================
  87. class Game_Interpreter
  88.   #--------------------------------------------------------------------------
  89.   # ○ モジュールの設定
  90.   #--------------------------------------------------------------------------
  91.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  92.   #--------------------------------------------------------------------------
  93.   # ○ 選択肢画面の呼び出し
  94.   #     index : 選択肢の種類
  95.   #--------------------------------------------------------------------------
  96.   def call_choices(index)
  97.     if index == nil
  98.       RGSSLAB_052.operate_error(1)
  99.       return
  100.     end
  101.     if RGSSLAB_052_2::SETTING[index] == nil
  102.       RGSSLAB_052.operate_error(2, index)
  103.       return
  104.     end
  105.     if RGSSLAB_052_2::SETTING[index].size < 2
  106.       RGSSLAB_052.operate_error(3)
  107.       return
  108.     end
  109.     if RGSSLAB_052_2::SETTING[index].size > 7
  110.       RGSSLAB_052.operate_error(4)
  111.       return
  112.     end
  113.     SceneManager.call(Scene_Choices)
  114.     SceneManager.scene.prepare(index)
  115.     Fiber.yield
  116.   end
  117. end

  118. #==============================================================================
  119. # □ Window_Dummy_052 [class]
  120. #==============================================================================
  121. class Window_Dummy_052 < Window_Base
  122.   #--------------------------------------------------------------------------
  123.   # ○ オブジェクト初期化 [オーバーライド]
  124.   #--------------------------------------------------------------------------
  125.   def initialize
  126.     if $rgsslab["XP画面サイズ"]
  127.       super(48, 288, 544, 160)
  128.     else
  129.       super(0, 256, 544, 160)
  130.     end
  131.   end
  132. end

  133. #==============================================================================
  134. # □ Window_Choices_Display [class]
  135. #==============================================================================
  136. class Window_Choices_Display < Window_Base
  137.   #--------------------------------------------------------------------------
  138.   # ○ モジュールの設定
  139.   #--------------------------------------------------------------------------
  140.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  141.   #--------------------------------------------------------------------------
  142.   # ○ オブジェクト初期化 [オーバーライド]
  143.   #     text : 最初に描画させる選択肢の文字列
  144.   #--------------------------------------------------------------------------
  145.   def initialize(text = "")
  146.     if $rgsslab["XP画面サイズ"]
  147.       super(48, 288, 544, 80)
  148.     else
  149.       super(0, 256, 544, 80)
  150.     end
  151.     self.opacity  = 0
  152.     refresh(text)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ○ リフレッシュ
  156.   #     text : 現在選択中の選択肢の文字列
  157.   #--------------------------------------------------------------------------
  158.   def refresh(text)
  159.     contents.clear
  160.     contents.font.color = normal_color
  161.     case RGSSLAB_052::MODE
  162.     when 0 ; contents.draw_text(4, 0, self.width - 40, 32, text)
  163.     when 1 ; draw_text_ex(4, 0, text)
  164.     else   ; contents.draw_text(4, 0, self.width - 40, 32, text)
  165.     end
  166.   end
  167. end

  168. #==============================================================================
  169. # □ Window_Label_Display [class]
  170. #==============================================================================
  171. class Window_Label_Display < Window_Selectable
  172.   #--------------------------------------------------------------------------
  173.   # ○ モジュールの設定
  174.   #--------------------------------------------------------------------------
  175.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  176.   #--------------------------------------------------------------------------
  177.   # ○ オブジェクト初期化 [オーバーライド]
  178.   #     item_max : 候補数
  179.   #--------------------------------------------------------------------------
  180.   def initialize(item_max)
  181.     @item_max     = item_max
  182.     if $rgsslab["XP画面サイズ"]
  183.       super(48, 368, 544, 80)
  184.     else
  185.       super(0, 336, 544, 80)
  186.     end
  187.     self.index    = -1
  188.     self.opacity  = 0
  189.     case RGSSLAB_052::DRAW
  190.     when 1 ; @label = ["A", "B", "C", "D", "E", "F", "G"]
  191.     when 2 ; @label = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ"]
  192.     when 3 ; @label = ["一", "二", "三", "四", "五", "六", "七"]
  193.     else   ; @label = ["1", "2", "3", "4", "5", "6", "7"]
  194.     end
  195.     refresh
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ○ 桁数の取得 [オーバーライド]
  199.   #--------------------------------------------------------------------------
  200.   def col_max
  201.     return 7
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ○ 項目数の取得 [オーバーライド]
  205.   #--------------------------------------------------------------------------
  206.   def item_max
  207.     @item_max
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ○ リフレッシュ
  211.   #--------------------------------------------------------------------------
  212.   def refresh
  213.     contents.clear
  214.     for i in 0...@item_max
  215.       draw_item(i)
  216.     end
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ○ 項目の描画
  220.   #     index : 項目番号
  221.   #--------------------------------------------------------------------------
  222.   def draw_item(index)
  223.     rect = Rect.new(10 + index * 32, 0, 32, 32)
  224.     self.contents.draw_text(rect, @label[index])
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ○ カーソルの矩形更新 [オーバーライド]
  228.   #--------------------------------------------------------------------------
  229.   def update_cursor
  230.     if @index < 0
  231.       self.cursor_rect.empty
  232.     else
  233.       self.cursor_rect.set(4 + @index * 32, 0, 32, 32)
  234.     end
  235.   end
  236. end

  237. #==============================================================================
  238. # □ Scene_Choices [class]
  239. #==============================================================================
  240. class Scene_Choices < Scene_Base
  241.   #--------------------------------------------------------------------------
  242.   # ○ モジュールの設定
  243.   #--------------------------------------------------------------------------
  244.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  245.   #--------------------------------------------------------------------------
  246.   # ○ 準備
  247.   #     index : 選択肢の種類
  248.   #--------------------------------------------------------------------------
  249.   def prepare(index)
  250.     @index    = RGSSLAB_052_2::SETTING[index]
  251.     @item_max = RGSSLAB_052_2::SETTING[index].size
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 開始処理 [オーバーライド]
  255.   #--------------------------------------------------------------------------
  256.   def start
  257.     super
  258.     create_spriteset
  259.     create_all_windows
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ○ スプライトセットの作成
  263.   #--------------------------------------------------------------------------
  264.   def create_spriteset
  265.     @spriteset = Spriteset_Map.new
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ○ 全ウィンドウの作成
  269.   #--------------------------------------------------------------------------
  270.   def create_all_windows
  271.     [url=home.php?mod=space&uid=37298]@Window[/url]              = Window_Dummy_052.new
  272.     @choices_window      = Window_Choices_Display.new(@index[0])
  273.     @label_window        = Window_Label_Display.new(@item_max)
  274.     @label_window.index  = 0
  275.     @label_window.active = true
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ○ フレーム更新 [オーバーライド]
  279.   #--------------------------------------------------------------------------
  280.   def update
  281.     super
  282.     update_choices
  283.     update_input
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ○ 選択肢の更新
  287.   #--------------------------------------------------------------------------
  288.   def update_choices
  289.     @choices_window.refresh(@index[@label_window.index])
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ○ 入力
  293.   #--------------------------------------------------------------------------
  294.   def update_input
  295.     if Input.trigger?(:C)
  296.       Sound.play_ok
  297.       $game_variables[RGSSLAB_052::RESULT_VARIABLE] = @label_window.index + 1
  298.       return_scene
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ○ 終了処理 [オーバーライド]
  303.   #--------------------------------------------------------------------------
  304.   def terminate
  305.     super
  306.     dispose_spriteset
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ○ スプライトセットの解放
  310.   #--------------------------------------------------------------------------
  311.   def dispose_spriteset
  312.     @spriteset.dispose
  313.   end
  314. end

  315. end
复制代码
= =我发现这脚本后半段有问题啊。。
如图,那个【/url】后的部分。。。= =要怎么才能变正常啊。。

Lv2.观梦者

梦石
0
星屑
743
在线时间
2064 小时
注册时间
2011-10-3
帖子
1686
2
发表于 2013-2-9 15:05:53 | 只看该作者
记得有工程下载的,你搜索下选项加强

点评

这个。。。我搜了下,发现没有VA版的啊。。  发表于 2013-2-9 21:22
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22037
在线时间
8575 小时
注册时间
2011-12-31
帖子
3362
3
发表于 2013-2-9 18:34:29 | 只看该作者
【自定義點】

    接收結果的變量
 指定接收結果的變量。

    顯示數字的選擇
    0 : 阿拉伯數字
    1 : 字母
    2 : 罗马数字
    3 : 中国数字

    除了以上描述的那些,其他被视为0。
    モードの選択
    この素材のモードを選択します。

    0 : 正常模式(控制字符不能使用)
    1 : 控制字符模式

   除了以上描述的那些,其他被视为0。

    请注意,有些制御文字可能不能使用。

 【選択肢の作成】
 次に、選択肢の作成で選択肢を作ります。
 (これがないと、選択肢画面は扱う事ができません)

 有关编写,请参阅的内部的脚本。

 【如何调用屏幕上的选择】
 在事件中编辑,脚本中使用call_choices("選択肢")。

 "選択肢"、す選択肢の作成で作った選択肢キーで。
接下来,根据自定義变量的値在条件分支选择指令,


因为完成后,屏幕上的选项,事件停止再次恢复

你不需要在每一种情况下完成事件。

点评

我改了后变成250行的“class Scene_Choices < Scene_Base”出问题了。。  发表于 2013-2-10 01:05
这个不需要另外找什么窗口图片素材  发表于 2013-2-9 22:46
2那行応改成 280 @window = Window_Dummy_052.new  发表于 2013-2-9 22:45
这个不需要另外找什么窗口图片素材么?0.0还有,那个脚本的后半部出问题了,,就是[/url]那里,后面全红掉了= =,测试老提示出错。。要怎么改啊?  发表于 2013-2-9 21:31
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-17 08:59

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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