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

Project1

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

[已经解决] 事件的流程设置

[复制链接]

Lv3.寻梦者

梦石
3
星屑
65
在线时间
200 小时
注册时间
2008-7-8
帖子
180
跳转到指定楼层
1
发表于 2015-8-25 11:07:17 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
感觉事件的分支条件设置感觉有点太弱了
比如想设置: 若满足条件1 则出现ABCD选项,否则只出现ABC选项,
结果满足和不满足两边分支都要放上ABC的后续内容,而ABC这部分是完全重复的...
有没有什么方法能减少这种重复的流程设置?

Lv3.寻梦者

梦石
3
星屑
65
在线时间
200 小时
注册时间
2008-7-8
帖子
180
7
 楼主| 发表于 2015-8-26 11:09:56 | 只看该作者
未命名 发表于 2015-8-26 10:58
为什么没人想过要用:

“标签”和“标签转跳”

是的...我发现了
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
7
星屑
1113
在线时间
334 小时
注册时间
2008-1-28
帖子
1566
6
发表于 2015-8-26 10:58:59 | 只看该作者
为什么没人想过要用:

“标签”和“标签转跳”

啊!
终于有可以放在这里的游戏了……
极短13 新生 《箱子新世界》
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22698
在线时间
8622 小时
注册时间
2011-12-31
帖子
3367
5
发表于 2015-8-25 16:26:52 | 只看该作者
選択肢拡張 3.2

各種功能説明
4楼
https://rpg.blue/thread-371661-1-1.html
RUBY 代码复制
  1.  

2015/04/26 (ver. 3.2)
 追加選択肢視窗背景不表示機能。
在事件>注釈加入以下文字列選択肢選択肢視窗背景不表示。
  
    背景OFF

点评

看懂了,谢谢  发表于 2015-8-26 10:22
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
帖子
1102
4
发表于 2015-8-25 15:49:45 | 只看该作者
事件解释器神马的自己造
RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
904
在线时间
246 小时
注册时间
2015-1-24
帖子
112
3
发表于 2015-8-25 15:25:58 | 只看该作者
这难道不是只靠复制粘贴就能解决的问题吗……
优先能用事件解决的问题还是不要使用脚本的好吧……

点评

大段内容复制粘贴的话即使有缩进也很难分辨出层次,很混乱。  发表于 2015-8-26 10:24

评分

参与人数 1星屑 +5 收起 理由
taroxd + 5 第二句话不敢苟同哦~

查看全部评分

原创恐怖解谜  岛语
   原创悬疑解谜 雪疑
      原创悬疑风格伪R剧 《抉择CHoice》   【黑历史】

             一只来自北方的泥亾工作室,欢迎骚扰
回复 支持 反对

使用道具 举报

Lv6.析梦学徒

老鹰

梦石
40
星屑
34445
在线时间
6703 小时
注册时间
2012-5-26
帖子
3246

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

2
发表于 2015-8-25 12:21:22 | 只看该作者
选择框的选项里写if()表示条件满足时出现选项,en()表示条件不满足时为半透明不可选
v[x]表示变量,s[x]表示开关
该脚本自带多选项和选择框显示位置    選択肢位置(x, y[, row])  在选择前面添加注释即可,
多选项直接插入多个选择支,中间不要有间隔
  1. =begin

  2. ▼ 選択肢拡張 ver. 2.3

  3. RPGツクールVXAce用スクリプト

  4. 制作 : 木星ペンギン
  5. URL  : [url]http://woodpenguin.blog.fc2.com/[/url]

  6. ------------------------------------------------------------------------------
  7. 概要

  8. □ 選択肢を連続して設定した場合、つなげて一つの選択肢にする機能の追加。
  9. □ 条件を設定することで、その項目を表示しない機能の追加。
  10. □ 選択肢内容が前回と同じだった場合、
  11.     カーソルの初期位置を前回選んだ項目にする機能の追加。
  12. □ 選択肢ウィンドウの位置を一時的に変更する機能の追加。
  13. □ 条件を設定することで、その項目を半透明にして選択不可にする機能の追加。
  14. □ 選択肢毎にヘルプメッセージを表示できる機能の追加。

  15. ------------------------------------------------------------------------------
  16. 使い方

  17. □ 選択肢の表示を続けて配置すると、一つの選択肢にまとめられます。
  18.   ・「キャンセルの場合」の処理は、無効以外を設定したものが適用され、
  19.      複数ある場合は後に設定された選択肢のものが適用されます。
  20.   
  21. □ 選択肢の文章中に if(条件) と入れ、その条件が偽になると項目が表示されなくなります。
  22.   ・s でスイッチ、v で変数を参照できます。
  23.   ・「キャンセルの場合」の項目が表示されない場合、無効と同じ処理をします。

  24. □ 注釈に以下の文字列を入れることで、選択肢ウィンドウの表示位置を
  25.    一時的に変更することが出来ます。
  26.   
  27.     選択肢位置(x, y[, row])
  28.    
  29.       x   : ウィンドウを表示する X 座標。
  30.       y   : ウィンドウを表示する Y 座標。
  31.       row : 選択肢を表示する最大行数。
  32.             指定しない場合は、通常の最大行数を無視して
  33.             すべての選択肢が表示されます。
  34.   
  35. □ 選択肢の文章中に en(条件) と入れ、その条件が偽になると項目が半透明で表示されます。
  36.   
  37. □ 各項目の下に、注釈で以下の文字列を入れると、続きの文章を
  38.     項目のヘルプメッセージとしてカーソルを合わせたときに標示することができます。
  39.   
  40.     選択肢ヘルプ
  41.    
  42. □ 詳細は下記のサイトを参照してください。

  43.   [url]http://woodpenguin.web.fc2.com/rgss3/choice_ex.html[/url]
  44.   
  45. =end
  46. module WdTk
  47. module ChoiceEX
  48. #//////////////////////////////////////////////////////////////////////////////
  49. #
  50. # 設定項目
  51. #
  52. #//////////////////////////////////////////////////////////////////////////////
  53.   #--------------------------------------------------------------------------
  54.   # ● 選択肢の最大行数
  55.   #     選択肢を表示するウィンドウの行数の最大数です。
  56.   #     選択肢がこの数より小さければ、選択肢の数に合わせます。
  57.   #--------------------------------------------------------------------------
  58.   RowMax = 4

  59.   #--------------------------------------------------------------------------
  60.   # ● 選択肢の位置記憶
  61.   #     前回表示した選択肢と全く同じ内容の選択肢を表示する場合、
  62.   #     カーソルの初期位置を前回選んだ項目にする機能です。
  63.   #     false で無効化できます。
  64.   #--------------------------------------------------------------------------
  65.   Store = true

  66.   #--------------------------------------------------------------------------
  67.   # ● 選択肢ヘルプを読み取る文字列
  68.   #--------------------------------------------------------------------------
  69.   Help = "選択肢ヘルプ"

  70. end

  71. #//////////////////////////////////////////////////////////////////////////////
  72. #
  73. # 以降、変更する必要なし
  74. #
  75. #//////////////////////////////////////////////////////////////////////////////

  76.   @material ||= []
  77.   @material << :ChoiceEX
  78.   def self.include?(sym)
  79.     @material.include?(sym)
  80.   end

  81. end

  82. #==============================================================================
  83. # ■ Game_Message
  84. #------------------------------------------------------------------------------
  85. #  文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。この
  86. # クラスのインスタンスは $game_message で参照されます。
  87. #==============================================================================

  88. class Game_Message
  89.   #--------------------------------------------------------------------------
  90.   # ● 公開インスタンス変数
  91.   #--------------------------------------------------------------------------
  92.   attr_accessor :choice_x                 # 選択肢ウィンドウの表示 X 座標
  93.   attr_accessor :choice_y                 # 選択肢ウィンドウの表示 Y 座標
  94.   attr_accessor :choice_row_max           # 選択肢ウィンドウの表示行数
  95.   attr_accessor :choice_enables           # 選択肢の有効状態
  96.   attr_accessor :choice_help              # 選択肢のヘルプ
  97.   #--------------------------------------------------------------------------
  98.   # ○ クリア
  99.   #--------------------------------------------------------------------------
  100.   alias _wdtk_choice_clear clear
  101.   def clear
  102.     _wdtk_choice_clear
  103.     @choice_x = @choice_y = nil
  104.     @choice_row_max = WdTk::ChoiceEX::RowMax
  105.     @choice_enables = []
  106.     @choice_help = {}
  107.   end
  108. end

  109. #==============================================================================
  110. # ■ Game_Interpreter
  111. #==============================================================================
  112. class Game_Interpreter
  113.   #--------------------------------------------------------------------------
  114.   # ☆ 選択肢のセットアップ
  115.   #--------------------------------------------------------------------------
  116.   def setup_choices(params)
  117.     result = []
  118.     add_choices(params, @index, result)
  119.     $game_message.choice_enables = $game_message.choices.collect do |c|
  120.       !c.slice!(/\s*en\(([^\)]+)\)/i) || choice_eval($1)
  121.     end
  122.     unless $game_message.choices.empty?
  123.       m = result.index($game_message.choice_cancel_type - 1)
  124.       $game_message.choice_enables << (!m || $game_message.choice_enables[m])
  125.       result << $game_message.choice_cancel_type - 1
  126.       $game_message.choice_proc = Proc.new {|n| @branch[@indent] = result[n] }
  127.     else
  128.       @branch[@indent] = -1
  129.     end
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 選択肢の追加
  133.   #--------------------------------------------------------------------------
  134.   def add_choices(params, i, result, d = 0)
  135.     params[0].each_with_index do |s, n|
  136.       choice = s.dup
  137.       next if choice.slice!(/\s*if\(([^\)]+)\)/i) && !choice_eval($1)
  138.       $game_message.choices << choice
  139.       result << n + d
  140.     end
  141.     if params[1] == 5 || (params[1] > 0 && result.include?(params[1] + d - 1))
  142.       $game_message.choice_cancel_type = params[1] + d
  143.     end
  144.     indent = @list[i].indent
  145.     loop do
  146.       i += 1
  147.       if @list[i].indent == indent
  148.         case @list[i].code
  149.         when 402 # [**] の場合
  150.           m = result.index(@list[i].parameters[0] + d)
  151.           get_help_texts(m, i + 1) if m
  152.         when 404 # 分岐終了
  153.           break
  154.         end
  155.       end
  156.     end
  157.     i += 1
  158.     add_choices(@list[i].parameters, i, result, d + 5) if @list[i].code == 102
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 分岐用
  162.   #--------------------------------------------------------------------------
  163.   def choice_eval(formula)
  164.     s, v = $game_switches, $game_variables
  165.     begin
  166.       Kernel.eval(formula)
  167.     rescue
  168.       msgbox "以下の条件判定でエラーが出ました。\n\n", formula
  169.       true
  170.     end
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● ヘルプ用テキストの取得
  174.   #--------------------------------------------------------------------------
  175.   def get_help_texts(b, i)
  176.     if @list[i].code == 108 && @list[i].parameters[0] == WdTk::ChoiceEX::Help
  177.       $game_message.choice_help[b] = []
  178.       loop do
  179.         i += 1
  180.         break if @list[i].code != 408
  181.         $game_message.choice_help[b] << @list[i].parameters[0]
  182.       end
  183.     end
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ◯ 注釈
  187.   #--------------------------------------------------------------------------
  188.   alias _wdtk_choice_command_108 command_108
  189.   def command_108
  190.     _wdtk_choice_command_108
  191.     @comments.each do |comment|
  192.       if comment =~ /選択肢位置\((\d+),\s*(\d+),?\s*(\d*)\)/
  193.         $game_message.choice_x = $1.to_i
  194.         $game_message.choice_y = $2.to_i
  195.         $game_message.choice_row_max = ($3.empty? ? 99 : $3.to_i)
  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. #~     else
  208. #~       @branch.delete(@indent)
  209.     end
  210.   end
  211. end

  212. #==============================================================================
  213. # ■ Window_ChoiceList
  214. #==============================================================================
  215. class Window_ChoiceList
  216.   #--------------------------------------------------------------------------
  217.   # ☆ 入力処理の開始
  218.   #--------------------------------------------------------------------------
  219.   def start
  220.     return unless close?
  221.     last_choices = @list.collect {|c| c[:name] }
  222.     update_placement
  223.     refresh
  224.     unless WdTk::ChoiceEX::Store && last_choices == $game_message.choices
  225.       select(0)
  226.     end
  227.     open
  228.     activate
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ○ ウィンドウ位置の更新
  232.   #--------------------------------------------------------------------------
  233.   alias _wdtk_choice_update_placement update_placement
  234.   def update_placement
  235.     _wdtk_choice_update_placement
  236.     self.height = [height, fitting_height($game_message.choice_row_max)].min
  237.     if @message_window.y >= Graphics.height / 2
  238.       self.y = @message_window.y - height
  239.     else
  240.       self.y = @message_window.y + @message_window.height
  241.     end
  242.     self.x = $game_message.choice_x if $game_message.choice_x
  243.     self.y = $game_message.choice_y if $game_message.choice_y
  244.   end
  245.   #--------------------------------------------------------------------------
  246.   # ☆ コマンドリストの作成
  247.   #--------------------------------------------------------------------------
  248.   def make_command_list
  249.     $game_message.choices.each_with_index do |choice, i|
  250.       add_command(choice, :choice, $game_message.choice_enables[i])
  251.     end
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 項目の描画
  255.   #--------------------------------------------------------------------------
  256.   alias _wdtk_choice_draw_item draw_item
  257.   def draw_item(index)
  258.     @choice_enabled = command_enabled?(index)
  259.     _wdtk_choice_draw_item(index)
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● テキスト描画色の変更
  263.   #--------------------------------------------------------------------------
  264.   def change_color(color, enabled = true)
  265.     super(color, enabled && @choice_enabled)
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● キャンセルボタンが押されたときの処理
  269.   #--------------------------------------------------------------------------
  270.   def process_cancel
  271.     if $game_message.choice_enables[item_max]
  272.       super
  273.     else
  274.       Sound.play_buzzer
  275.     end
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ☆ キャンセルハンドラの呼び出し
  279.   #--------------------------------------------------------------------------
  280.   def call_cancel_handler
  281.     $game_message.choice_proc.call(item_max)
  282.     close
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ● ウィンドウを閉じる
  286.   #--------------------------------------------------------------------------
  287.   def close
  288.     @message_window.on_show_fast unless $game_message.choice_help.empty?
  289.     super
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  293.   #--------------------------------------------------------------------------
  294.   def call_update_help
  295.     update_help if active && !$game_message.choice_help.empty?
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● ヘルプウィンドウの更新
  299.   #--------------------------------------------------------------------------
  300.   def update_help
  301.     @message_window.force_clear
  302.     if $game_message.choice_help.include?(index)
  303.       $game_message.texts.replace($game_message.choice_help[index])
  304.     else
  305.       $game_message.texts.clear
  306.     end
  307.   end
  308. end

  309. #==============================================================================
  310. # ■ Window_Message
  311. #==============================================================================
  312. class Window_Message
  313.   #--------------------------------------------------------------------------
  314.   # ● 文章の標示を強制クリア
  315.   #--------------------------------------------------------------------------
  316.   def force_clear
  317.     @gold_window.close
  318.     @fiber = nil
  319.     close
  320.     if WdTk.include?(:MesEff)
  321.       @character_sprites.each do |sprite, params|
  322.         next if params.empty?
  323.         sprite.bitmap.clear
  324.         sprite.visible = false
  325.         params.clear
  326.       end
  327.     end
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 文章を最後まで表示する
  331.   #--------------------------------------------------------------------------
  332.   def on_show_fast
  333.     @show_fast = true
  334.   end
  335. end
复制代码

点评

谢谢  发表于 2015-8-26 10:22

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 你是个好人

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 12:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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