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

Project1

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

[已经解决] 脚本请求

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
帖子
100
跳转到指定楼层
1
发表于 2013-8-27 13:35:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我想请有心人帮忙写个脚本,内容就是创建一个窗口,有很多选项,可以触发事件,至于触发什么事件可以自己来设置

点评

那就直接增加游戏菜单里面的选项哦,不用再搞这个了  发表于 2013-8-27 16:51

Lv1.梦旅人

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
帖子
100
2
 楼主| 发表于 2013-8-27 13:37:17 | 只看该作者
我.....我知道这个或许有些过分......
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
552 小时
注册时间
2012-8-18
帖子
1429
3
发表于 2013-8-27 13:43:50 | 只看该作者
你是指在编辑器里面还是在游戏里面……听起来类似养成类游戏的那种?

点评

游戏的呢  发表于 2013-8-27 14:01
我要填坑!我要背单词!我要学日语!我要每天锻炼!
好吧呵呵= =
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
136
在线时间
1050 小时
注册时间
2006-5-3
帖子
774
4
发表于 2013-8-27 16:34:16 | 只看该作者
用时间中的“显示选项”不行吗?

点评

那请问,可以在主菜单中触发选项吗?可以有不止4个选项吗??  发表于 2013-8-27 16:45
漏夏同人
《咱的夏天》
下载地址:http://tieba.baidu.com/p/2681607456
人员招募:http://rpg.blue/thread-339747-1-1.html
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
352
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

5
发表于 2013-8-28 03:06:10 | 只看该作者
原站:http://forums.rpgmakerweb.com/in ... n-multiple-choices/

腳本
RUBY 代码复制
  1. =begin
  2. #==============================================================================
  3.  ** Large Choices
  4.  Author: Tsukihime
  5.  Date: Apr 10, 2013
  6. ------------------------------------------------------------------------------
  7.  ** Change log
  8.  Apr 10, 2013
  9.    - added option to disable automatic show combining
  10.  Mar 26, 2013
  11.    - fixed bug where cancel choice was not properly updated
  12.  Jan 12, 2013
  13.    - fixed bug where the first set of nested options were numbered incorrectly
  14.  Dec 7, 2012
  15.    - implemented proper branch canceling
  16.  Dec 6, 2012
  17.    - Initial release
  18. ------------------------------------------------------------------------------   
  19.  ** Terms of Use
  20.  * Free to use in commercial/non-commercial projects
  21.  * No real support. The script is provided as-is
  22.  * Will do bug fixes, but no compatibility patches
  23.  * Features may be requested but no guarantees, especially if it is non-trivial
  24.  * Preserve this header
  25. ------------------------------------------------------------------------------
  26.  ** Description
  27.  
  28.  This script combines groups of "show choice" options together as one large
  29.  command. This allows you to create more than 4 choices by simply creating
  30.  several "show choice" commands.
  31. ------------------------------------------------------------------------------
  32.  ** Usage
  33.  
  34.  Add a show choice command.
  35.  If you want more choices, add another one, and fill it out as usual.
  36.  
  37.  Note that you should only specify one cancel choice (if you specify more than
  38.  one, then the last one is taken).
  39.  
  40.  For "branch" canceling, note that *all* cancel branches are executed.
  41.  You should only have a cancel branch on the last set of choices
  42.  
  43.  You can disable automatic choice combining by enabling the "Manual Combine"
  44.  option, which will require you to make this script call before the first
  45.  show choice command
  46.  
  47.     combine_choices
  48.     
  49.  In order to combine choices together
  50. #==============================================================================
  51. =end
  52. $imported = {} if $imported.nil?
  53. $imported["TH_LargeChoices"] = true
  54. #==============================================================================
  55. # ** Configuration
  56. #==============================================================================
  57. module TH
  58.   module Large_Choices
  59.  
  60.     # Turning this option on will require you to manually specify that
  61.     # a sequence of Show Choice options should be combined
  62.     Manual_Combine = false
  63.  
  64. #==============================================================================
  65. # ** Rest of the script
  66. #==============================================================================     
  67.     Code_Filter = [402, 403, 404]
  68.     Regex = /<large choices>/i
  69.   end
  70. end
  71.  
  72. class Game_Temp
  73.  
  74.   # temp solution to get this working
  75.   attr_accessor :branch_choice
  76.  
  77.   def branch_choice
  78.     @branch_choice || 5
  79.   end
  80. end
  81.  
  82. class Game_Interpreter
  83.  
  84.   #-----------------------------------------------------------------------------
  85.   # Clean up
  86.   #-----------------------------------------------------------------------------
  87.   alias :th_large_choices_clear :clear
  88.   def clear
  89.     th_large_choices_clear
  90.     @first_choice_cmd = nil
  91.     @choice_search = 0
  92.     @combine_choices = false
  93.   end
  94.  
  95.   #-----------------------------------------------------------------------------
  96.   # Prepare for more choices
  97.   #-----------------------------------------------------------------------------
  98.   alias :th_large_choices_setup_choices :setup_choices
  99.   def setup_choices(params)
  100.     # start with our original choices
  101.     th_large_choices_setup_choices(params)
  102.  
  103.     return if TH::Large_Choices::Manual_Combine && !@combine_choices
  104.  
  105.     # store our "first" choice in the sequence
  106.     @first_choice_cmd = @list[@index]
  107.  
  108.     # reset branch choice
  109.     $game_temp.branch_choice = @first_choice_cmd.parameters[1]
  110.  
  111.     # Start searching for more choices
  112.     @num_choices = $game_message.choices.size
  113.     @choice_search = [url=home.php?mod=space&uid=370741]@Index[/url] + 1
  114.     search_more_choices
  115.   end
  116.  
  117.   def combine_choices
  118.     @combine_choices = true
  119.   end
  120.  
  121.   #-----------------------------------------------------------------------------
  122.   # New. Check whether the next command (after all branches) is another choice
  123.   # command. If so, merge it with the first choice command.
  124.   #-----------------------------------------------------------------------------
  125.   def search_more_choices
  126.     skip_choice_branches
  127.     next_cmd = @list[@choice_search]
  128.  
  129.     # Next command isn't a "show choice" so we're done
  130.     return if next_cmd.code != 102
  131.  
  132.     @choice_search += 1
  133.     # Otherwise, push the choices into the first choice command to merge
  134.     # the commands.
  135.     @first_choice_cmd.parameters[0].concat(next_cmd.parameters[0])
  136.  
  137.     # Update all cases to reflect merged choices
  138.     update_show_choices(next_cmd.parameters)
  139.     update_cancel_choice(next_cmd.parameters)
  140.     update_choice_numbers
  141.  
  142.     # delete the command to effectively merge the branches
  143.     @list.delete(next_cmd)
  144.  
  145.     # Now search for more
  146.     search_more_choices
  147.   end
  148.  
  149.   #-----------------------------------------------------------------------------
  150.   # New. Update the options for the first "show choice" command
  151.   #-----------------------------------------------------------------------------
  152.   def update_show_choices(params)
  153.     params[0].each {|s| $game_message.choices.push(s) }
  154.   end
  155.  
  156.   #-----------------------------------------------------------------------------
  157.   # New. If cancel specified, update it to reflect merged choice numbers
  158.   # The last one is taken if multiple cancel choices are specified
  159.   #-----------------------------------------------------------------------------
  160.   def update_cancel_choice(params)
  161.  
  162.     # disallow, just ignore
  163.     return if params[1] == 0   
  164.  
  165.     # branch on cancel
  166.     return update_branch_choice if params[1] == 5
  167.  
  168.     # num_choices is not one-based
  169.     cancel_choice = params[1] + (@num_choices)
  170.     # update cancel choice, as well as the first choice command
  171.     $game_message.choice_cancel_type = cancel_choice
  172.     @first_choice_cmd.parameters[1] = cancel_choice
  173.   end
  174.  
  175.   #-----------------------------------------------------------------------------
  176.   # New. Set the initial choice command to "branch cancel"
  177.   #-----------------------------------------------------------------------------
  178.   def update_branch_choice
  179.     branch_choice = $game_message.choices.size + 1
  180.     $game_message.choice_cancel_type = branch_choice
  181.     $game_temp.branch_choice = branch_choice
  182.     @first_choice_cmd.parameters[1] = branch_choice
  183.   end
  184.  
  185.   def command_403
  186.     command_skip if @branch[@indent] != $game_temp.branch_choice - 1
  187.   end
  188.  
  189.   #-----------------------------------------------------------------------------
  190.   # New. For each branch, update it to reflect the merged choice numbers.
  191.   #-----------------------------------------------------------------------------
  192.   def update_choice_numbers
  193.  
  194.     # Begin searching immediately after cmd 102 (show choice)
  195.     i = @choice_search
  196.  
  197.     # Rough search for "When" commands. The search must skip nested commands
  198.     while TH::Large_Choices::Code_Filter.include?(@list[i].code) || @list[i].indent != @indent
  199.       if @list[i].code == 402 && @list[i].indent == @indent
  200.         @list[i].parameters[0] = @num_choices
  201.         @num_choices += 1
  202.       end
  203.       i += 1
  204.     end
  205.   end
  206.  
  207.   #-----------------------------------------------------------------------------
  208.   # New. Returns the next command after our choice branches
  209.   #-----------------------------------------------------------------------------
  210.   def skip_choice_branches
  211.     # start search at the next command
  212.     # skip all choice branch-related commands and any branches
  213.     while TH::Large_Choices::Code_Filter.include?(@list[@choice_search].code) || @list[@choice_search].indent != @indent
  214.       @choice_search += 1
  215.     end
  216.     return @choice_search
  217.   end
  218. end


插入main以上

使用方法:
如果有兩个以上的選則項目 將會合並為一个  
可是一定要連在一起  中途如有任何的非選項事件則不會合並

点评

没听明白,具体的使用方法是神马??还有可以造成10个以上的选项吗?还有如果有两个以上的选择项目将合并为一个是什么意思,难道只可以有一个!  发表于 2013-8-28 09:49

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 认可答案

查看全部评分


回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
352
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

6
发表于 2013-8-28 09:54:21 | 只看该作者
@540486098
累死了

不超出屏目應該就可以  我也沒去試过超出
不过10个應該可以的说

就是事件有"顯示選項"
然後如果有兩个連續的"顯示選項"
在畫面中就會合而為一  變為1个大選項.
可以用於突破4个的上限

点评

哦明白了啦  发表于 2013-8-28 09:57

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
帖子
100
7
 楼主| 发表于 2013-8-28 10:02:14 | 只看该作者
本帖最后由 540486098 于 2013-8-28 10:03 编辑
76213585 发表于 2013-8-28 09:54
@540486098
累死了



我知道你累←注意看
等等,这个怎么办

QQ图片20130828095611.jpg (18.54 KB, 下载次数: 30)

QQ图片20130828095611.jpg
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
352
在线时间
1292 小时
注册时间
2013-1-12
帖子
3590

贵宾

8
发表于 2013-8-28 10:07:11 | 只看该作者
540486098 发表于 2013-8-27 19:02
我知道你累←注意看
等等,这个怎么办

论譚代碼問題
把@INDEX 旁的URL等等刪掉即可

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
帖子
100
9
 楼主| 发表于 2013-8-28 10:16:37 | 只看该作者
76213585 发表于 2013-8-28 10:07
论譚代碼問題
把@INDEX 旁的URL等等刪掉即可

删掉之后......

QQ图片20130828095611.jpg (17.21 KB, 下载次数: 32)

QQ图片20130828095611.jpg

点评

總之所有這樣子的都把URL那段刪掉就對了  发表于 2013-8-28 10:27
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
帖子
100
10
 楼主| 发表于 2013-8-28 10:37:43 | 只看该作者
@76213585 可以是可以了,但是为什么不可以选择呢??

点评

應該是可以的说 載圖?  发表于 2013-8-28 10:46
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-26 05:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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