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

Project1

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

[已经解决] 请问一下,老鹰的那个《谎言之屋》里选项的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
100
在线时间
82 小时
注册时间
2014-9-22
帖子
21
跳转到指定楼层
1
发表于 2016-3-23 22:06:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
《谎言之屋》里面可是一下子显示好几个选项然后选了其中一个选项后,下一次再选择的时候就不再弹出该选项了。
请问一下有哪个大大知道是怎么实现的么?

Lv2.观梦者

梦石
0
星屑
457
在线时间
1409 小时
注册时间
2010-9-23
帖子
557
2
发表于 2016-3-23 22:24:50 | 只看该作者
本帖最后由 黑崎一护 于 2016-3-23 22:28 编辑

脚本是本站 VIPArcher 大神写的,楼主可以去问问他。 = =


补充一下三楼大神提到的脚本,楼主可以试试。 = =

RUBY 代码复制
  1. =begin
  2.  
  3.  ▼ 選択肢拡張 ver. 3.2
  4.  
  5.  RPGツクールVXAce用スクリプト
  6.  
  7.  制作 : 木星ペンギン
  8.  URL  : [url]http://woodpenguin.blog.fc2.com/[/url]
  9.  
  10. ------------------------------------------------------------------------------
  11.  概要
  12.  
  13.  □ 選択肢を連続して設定した場合、つなげて一つの選択肢にする機能の追加。
  14.  □ 条件を設定することで、その項目を表示しない機能の追加。
  15.  □ 選択肢のカーソル初期位置を指定する機能と
  16.     現在のカーソル位置を変数に入れる機能の追加。
  17.  
  18.  □ 選択肢ウィンドウの位置を一時的に変更する機能の追加。
  19.  □ 条件を設定することで、その項目を半透明にして選択不可にする機能の追加。
  20.  □ 選択肢毎にヘルプメッセージを表示できる機能の追加。
  21.  
  22. ------------------------------------------------------------------------------
  23.  使い方
  24.  
  25.  □ 選択肢の表示を続けて配置すると、一つの選択肢にまとめられます。
  26.   ・「キャンセルの場合」の処理は、無効以外を設定したものが適用され、
  27.      複数ある場合は後の選択肢のものが適用されます。
  28.  
  29.  □ 選択肢の文章中に if(条件) と入れ、その条件が偽になると項目が表示されなくなります。
  30.   ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  31.   ・s でスイッチ、v で変数を参照できます。
  32.   ・「キャンセルの場合」の項目が表示されない場合、無効と同じ処理をします。
  33.  
  34.  □ 注釈に以下の文字列を入れることで、指定された変数の値が
  35.     カーソルの初期位置になります。
  36.  
  37.     カーソル記憶(n)
  38.     
  39.       n : カーソル初期位置の入った変数番号
  40.  
  41.   ・選択肢のカーソルの位置が変更されるたびに、
  42.     この変数に選択肢の番号が入れられるようになります。
  43.  
  44.  □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの表示位置を
  45.    一時的に変更することが出来ます。
  46.  
  47.     選択肢位置(x, y[, row])
  48.     
  49.       x   : ウィンドウを表示する X 座標。
  50.       y   : ウィンドウを表示する Y 座標。
  51.       row : 選択肢を表示する最大行数。
  52.             指定しない場合は、通常の最大行数を無視して
  53.             すべての選択肢が表示されます。
  54.  
  55.  □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの背景が非表示になります。
  56.  
  57.     背景OFF
  58.     
  59.  □ 選択肢の文章中に en(条件) と入れ、その条件が偽になると項目が半透明で表示されます。
  60.   ・条件は eval によって評価されます。(詳細は【組み込み関数】を参照)
  61.   ・s でスイッチ、v で変数を参照できます。
  62.   ・「キャンセルの場合」の項目が半透明の場合、ブザーが鳴ります。
  63.  
  64.  □ 各項目の下に、注釈で以下の文字列を入れると、続きの注釈を
  65.     項目のヘルプメッセージとしてカーソルを合わせたときに標示することができます。
  66.  
  67.     選択肢ヘルプ
  68.     
  69.  □ 詳細は下記のサイトを参照してください。
  70.  
  71.   [url]http://woodpenguin.web.fc2.com/rgss3/choice_ex.html[/url]
  72.  
  73. =end
  74. module WdTk
  75. module ChoiceEX
  76. #//////////////////////////////////////////////////////////////////////////////
  77. #
  78. # 設定項目
  79. #
  80. #//////////////////////////////////////////////////////////////////////////////
  81.   #--------------------------------------------------------------------------
  82.   # ● 選択肢の最大行数
  83.   #     選択肢を表示するウィンドウの行数の最大数です。
  84.   #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  85.   #--------------------------------------------------------------------------
  86.   RowMax = 4
  87.  
  88.   #--------------------------------------------------------------------------
  89.   # ● 選択肢ヘルプを読み取る文字列
  90.   #--------------------------------------------------------------------------
  91.   Help = "選択肢ヘルプ"
  92.  
  93. end
  94.  
  95. #//////////////////////////////////////////////////////////////////////////////
  96. #
  97. # 以降、変更する必要なし
  98. #
  99. #//////////////////////////////////////////////////////////////////////////////
  100.  
  101.   @material ||= []
  102.   @material << :ChoiceEX
  103.   def self.include?(sym)
  104.     @material.include?(sym)
  105.   end
  106.  
  107. end
  108.  
  109. #==============================================================================
  110. # ■ Game_Message
  111. #==============================================================================
  112. class Game_Message
  113.   #--------------------------------------------------------------------------
  114.   # ● 公開インスタンス変数
  115.   #--------------------------------------------------------------------------
  116.   attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  117.   attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  118.   attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  119.   attr_accessor :choice_help              # 選択肢のヘルプ
  120.   attr_accessor :choice_var_id            # 選択肢のカーソル位置を入れる変数ID
  121.   attr_accessor :choice_background        # 選択肢ウィンドウ背景の表示状態
  122.   #--------------------------------------------------------------------------
  123.   # ○ クリア
  124.   #--------------------------------------------------------------------------
  125.   alias _wdtk_choice_clear clear
  126.   def clear
  127.     _wdtk_choice_clear
  128.     @choice_x = @choice_y = nil
  129.     @choice_row_max = WdTk::ChoiceEX::RowMax
  130.     @choice_help = {}
  131.     @choice_var_id = 0
  132.     @choice_background = 0
  133.   end
  134. end
  135.  
  136. #==============================================================================
  137. # ■ Game_Interpreter
  138. #==============================================================================
  139. class Game_Interpreter
  140.   #--------------------------------------------------------------------------
  141.   # ☆ 選択肢のセットアップ
  142.   #--------------------------------------------------------------------------
  143.   def setup_choices(params)
  144.     add_choices(params, @index)
  145.     $game_message.choice_proc = Proc.new {|n| @branch[@indent] = n }
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 選択肢の追加
  149.   #--------------------------------------------------------------------------
  150.   def add_choices(params, i, d = 0)
  151.     params[0].each_with_index {|s, n| $game_message.choices[n + d] = s }
  152.     $game_message.choice_cancel_type = params[1] + d if params[1] > 0
  153.     indent = @list[i].indent
  154.     loop do
  155.       i += 1
  156.       if @list[i].indent == indent
  157.         case @list[i].code
  158.         when 402 # [**] の場合
  159.           get_help_texts(@list[i].parameters[0] + d, i + 1)
  160.         when 404 # 分岐終了
  161.           break
  162.         end
  163.       end
  164.     end
  165.     i += 1
  166.     add_choices(@list[i].parameters, i, d + 5) if @list[i].code == 102
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● ヘルプ用テキストの取得
  170.   #--------------------------------------------------------------------------
  171.   def get_help_texts(b, i)
  172.     if @list[i].code == 108 && @list[i].parameters[0] == WdTk::ChoiceEX::Help
  173.       $game_message.choice_help[b] = []
  174.       while @list[i + 1].code == 408
  175.         i += 1
  176.         $game_message.choice_help[b] << @list[i].parameters[0]
  177.       end
  178.     end
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ◯ 注釈
  182.   #--------------------------------------------------------------------------
  183.   alias _wdtk_choice_command_108 command_108
  184.   def command_108
  185.     _wdtk_choice_command_108
  186.     @comments.each do |comment|
  187.       case comment
  188.       when /選択肢位置\((\d+),\s*(\d+),?\s*(\d*)\)/
  189.         $game_message.choice_x = $1.to_i
  190.         $game_message.choice_y = $2.to_i
  191.         $game_message.choice_row_max = ($3.empty? ? 99 : $3.to_i)
  192.       when /カーソル記憶\((\d+)\)/
  193.         $game_message.choice_var_id = $1.to_i
  194.       when /背景(ON|OFF)/
  195.         $game_message.choice_background = ($1 == "ON" ? 0 : 1)
  196.       end
  197.     end
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ☆ 分岐終了の場合
  201.   #--------------------------------------------------------------------------
  202.   def command_404
  203.     if next_event_code == 102
  204.       @branch[@indent] -= 5 if @branch.include?(@indent)
  205.       @index += 1
  206.       command_skip
  207.     end
  208.   end
  209. end
  210.  
  211. #==============================================================================
  212. # ■ Window_ChoiceList
  213. #==============================================================================
  214. class Window_ChoiceList
  215.   #--------------------------------------------------------------------------
  216.   # ☆ 入力処理の開始
  217.   #--------------------------------------------------------------------------
  218.   def start
  219.     return unless close?
  220.     clear_command_list
  221.     make_command_list
  222.     if @list.empty?
  223.       $game_message.choice_proc.call(-1)
  224.       return
  225.     end
  226.     update_placement
  227.     refresh
  228.     select(0)
  229.     if $game_message.choice_var_id > 0
  230.       select_ext($game_variables[$game_message.choice_var_id])
  231.     end
  232.     open
  233.     activate
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ☆ ウィンドウ位置の更新
  237.   #--------------------------------------------------------------------------
  238.   def update_placement
  239.     self.width = [max_choice_width + 12, 96].max + padding * 2
  240.     self.width = [width, Graphics.width].min
  241.     n = [@list.size, $game_message.choice_row_max].min
  242.     self.height = fitting_height(n)
  243.     self.x = Graphics.width - width
  244.     if @message_window.y >= Graphics.height / 2
  245.       self.y = @message_window.y - height
  246.     else
  247.       self.y = @message_window.y + @message_window.height
  248.     end
  249.     self.x = $game_message.choice_x if $game_message.choice_x
  250.     self.y = $game_message.choice_y if $game_message.choice_y
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ☆ 選択肢の最大幅を取得
  254.   #--------------------------------------------------------------------------
  255.   def max_choice_width
  256.     @list.collect {|com| text_size(com[:name]).width }.max || 0
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ☆ コマンドリストの作成
  260.   #--------------------------------------------------------------------------
  261.   def make_command_list
  262.     $game_message.choices.each_with_index do |choice, i|
  263.       next unless choice
  264.       str = choice.dup
  265.       next if str.slice!(/\s*if\(([^\)]+)\)/i) && !choice_eval($1)
  266.       enable = !str.slice!(/\s*en\(([^\)]+)\)/i) || choice_eval($1)
  267.       add_command(str, :choice, enable, i)
  268.     end
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ○ 項目の描画
  272.   #--------------------------------------------------------------------------
  273.   alias _wdtk_choice_draw_item draw_item
  274.   def draw_item(index)
  275.     @choice_enabled = command_enabled?(index)
  276.     _wdtk_choice_draw_item(index)
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● テキスト描画色の変更
  280.   #--------------------------------------------------------------------------
  281.   def change_color(color, enabled = true)
  282.     super(color, enabled && @choice_enabled)
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ☆ 決定ハンドラの呼び出し
  286.   #--------------------------------------------------------------------------
  287.   def call_ok_handler
  288.     $game_message.choice_proc.call(current_ext)
  289.     close
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● キャンセルボタンが押されたときの処理
  293.   #--------------------------------------------------------------------------
  294.   def process_cancel
  295.     return super if $game_message.choice_cancel_type % 5 == 0
  296.     index = @list.index {|c| c[:ext] == $game_message.choice_cancel_type - 1 }
  297.     return unless index
  298.     return super if command_enabled?(index)
  299.     Sound.play_buzzer
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● ウィンドウを閉じる
  303.   #--------------------------------------------------------------------------
  304.   def close
  305.     @message_window.on_show_fast unless $game_message.choice_help.empty?
  306.     super
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  310.   #--------------------------------------------------------------------------
  311.   def call_update_help
  312.     update_help if active && !$game_message.choice_help.empty?
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● ヘルプウィンドウの更新
  316.   #--------------------------------------------------------------------------
  317.   def update_help
  318.     @message_window.force_clear
  319.     if $game_message.choice_help.include?(current_ext)
  320.       $game_message.texts.replace($game_message.choice_help[current_ext])
  321.     else
  322.       $game_message.texts.clear
  323.     end
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 分岐用
  327.   #--------------------------------------------------------------------------
  328.   def choice_eval(formula)
  329.     s, v = $game_switches, $game_variables
  330.     begin
  331.       Kernel.eval(formula)
  332.     rescue
  333.       msgbox "以下の条件判定でエラーが出ました。\n\n", formula
  334.       true
  335.     end
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● フレーム更新
  339.   #--------------------------------------------------------------------------
  340.   def update
  341.     last_index = @index
  342.     super
  343.     if last_index != @index && $game_message.choice_var_id > 0
  344.       $game_variables[$game_message.choice_var_id] = current_ext
  345.     end
  346.   end
  347. end
  348.  
  349. #==============================================================================
  350. # ■ Window_Message
  351. #==============================================================================
  352. class Window_Message
  353.   #--------------------------------------------------------------------------
  354.   # ○ ウィンドウ背景の更新
  355.   #--------------------------------------------------------------------------
  356.   alias _wdtk_choice_update_background update_background
  357.   def update_background
  358.     _wdtk_choice_update_background
  359.     @choice_window.opacity = $game_message.choice_background == 0 ? 255 : 0
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● 文章の標示を強制クリア
  363.   #--------------------------------------------------------------------------
  364.   def force_clear
  365.     @gold_window.close
  366.     @fiber = nil
  367.     close
  368.     if WdTk.include?(:MesEff)
  369.       @character_sprites.each do |sprite, params|
  370.         next if params.empty?
  371.         sprite.bitmap.clear
  372.         sprite.visible = false
  373.         params.clear
  374.       end
  375.     end
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● 文章を最後まで表示する
  379.   #--------------------------------------------------------------------------
  380.   def on_show_fast
  381.     @show_fast = true
  382.   end
  383. end

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

漾夕☽星化残月☾

梦石
0
星屑
8571
在线时间
3855 小时
注册时间
2015-5-12
帖子
2077

剧作品鉴家

3
发表于 2016-3-23 22:24:50 | 只看该作者
因为那个游戏不是开源所以不知道详细如何做。
但是想要实现的话、可以用事件来做。结合  木星ペンギン的 選択肢拡張(选择肢拓展)”脚本
可以通过开关控制来实现
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

4
发表于 2016-3-24 08:24:01 | 只看该作者
为什么会这么麻烦……不就是一个全局存档的问题吗……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
100
在线时间
82 小时
注册时间
2014-9-22
帖子
21
5
 楼主| 发表于 2016-3-24 20:15:37 | 只看该作者
黑崎一护 发表于 2016-3-23 22:24
脚本是本站 VIPArcher 大神写的,楼主可以去问问他。 = =

谢谢你,我去试试。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-28 06:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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