查看: 4906|回复: 13

[已经解决] 脚本请求

[复制链接]
梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
发表于 2013-8-27 13:35:36 | 显示全部楼层 |阅读模式

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

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

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

点评

那就直接增加游戏菜单里面的选项哦,不用再搞这个了  发表于 2013-8-27 16:51
梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-8-27 13:37:17 | 显示全部楼层
我.....我知道这个或许有些过分......
回复

使用道具 举报

梦石
0
星屑
122
在线时间
552 小时
注册时间
2012-8-18
回帖
1392
发表于 2013-8-27 13:43:50 | 显示全部楼层
你是指在编辑器里面还是在游戏里面……听起来类似养成类游戏的那种?

点评

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

使用道具 举报

梦石
0
星屑
136
在线时间
1050 小时
注册时间
2006-5-3
回帖
602
发表于 2013-8-27 16:34:16 | 显示全部楼层
用时间中的“显示选项”不行吗?
QQ截图20130827163401.png

点评

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

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-8-28 03:06:10 | 显示全部楼层
原站:http://forums.rpgmakerweb.com/in ... n-multiple-choices/

腳本
  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. This script combines groups of "show choice" options together as one large
  28. command. This allows you to create more than 4 choices by simply creating
  29. several "show choice" commands.
  30. ------------------------------------------------------------------------------
  31. ** Usage

  32. Add a show choice command.
  33. If you want more choices, add another one, and fill it out as usual.

  34. Note that you should only specify one cancel choice (if you specify more than
  35. one, then the last one is taken).

  36. For "branch" canceling, note that *all* cancel branches are executed.
  37. You should only have a cancel branch on the last set of choices

  38. You can disable automatic choice combining by enabling the "Manual Combine"
  39. option, which will require you to make this script call before the first
  40. show choice command

  41.     combine_choices
  42.    
  43. In order to combine choices together
  44. #==============================================================================
  45. =end
  46. $imported = {} if $imported.nil?
  47. $imported["TH_LargeChoices"] = true
  48. #==============================================================================
  49. # ** Configuration
  50. #==============================================================================
  51. module TH
  52.   module Large_Choices
  53.    
  54.     # Turning this option on will require you to manually specify that
  55.     # a sequence of Show Choice options should be combined
  56.     Manual_Combine = false
  57.    
  58. #==============================================================================
  59. # ** Rest of the script
  60. #==============================================================================     
  61.     Code_Filter = [402, 403, 404]
  62.     Regex = /<large choices>/i
  63.   end
  64. end

  65. class Game_Temp
  66.   
  67.   # temp solution to get this working
  68.   attr_accessor :branch_choice
  69.   
  70.   def branch_choice
  71.     @branch_choice || 5
  72.   end
  73. end

  74. class Game_Interpreter
  75.   
  76.   #-----------------------------------------------------------------------------
  77.   # Clean up
  78.   #-----------------------------------------------------------------------------
  79.   alias :th_large_choices_clear :clear
  80.   def clear
  81.     th_large_choices_clear
  82.     @first_choice_cmd = nil
  83.     @choice_search = 0
  84.     @combine_choices = false
  85.   end
  86.   
  87.   #-----------------------------------------------------------------------------
  88.   # Prepare for more choices
  89.   #-----------------------------------------------------------------------------
  90.   alias :th_large_choices_setup_choices :setup_choices
  91.   def setup_choices(params)
  92.     # start with our original choices
  93.     th_large_choices_setup_choices(params)
  94.    
  95.     return if TH::Large_Choices::Manual_Combine && !@combine_choices

  96.     # store our "first" choice in the sequence
  97.     @first_choice_cmd = @list[@index]
  98.    
  99.     # reset branch choice
  100.     $game_temp.branch_choice = @first_choice_cmd.parameters[1]
  101.    
  102.     # Start searching for more choices
  103.     @num_choices = $game_message.choices.size
  104.     @choice_search = [url=home.php?mod=space&uid=370741]@Index[/url] + 1
  105.     search_more_choices
  106.   end
  107.   
  108.   def combine_choices
  109.     @combine_choices = true
  110.   end
  111.   
  112.   #-----------------------------------------------------------------------------
  113.   # New. Check whether the next command (after all branches) is another choice
  114.   # command. If so, merge it with the first choice command.
  115.   #-----------------------------------------------------------------------------
  116.   def search_more_choices
  117.     skip_choice_branches
  118.     next_cmd = @list[@choice_search]
  119.    
  120.     # Next command isn't a "show choice" so we're done
  121.     return if next_cmd.code != 102
  122.    
  123.     @choice_search += 1
  124.     # Otherwise, push the choices into the first choice command to merge
  125.     # the commands.
  126.     @first_choice_cmd.parameters[0].concat(next_cmd.parameters[0])
  127.    
  128.     # Update all cases to reflect merged choices
  129.     update_show_choices(next_cmd.parameters)
  130.     update_cancel_choice(next_cmd.parameters)
  131.     update_choice_numbers
  132.    
  133.     # delete the command to effectively merge the branches
  134.     @list.delete(next_cmd)
  135.    
  136.     # Now search for more
  137.     search_more_choices
  138.   end

  139.   #-----------------------------------------------------------------------------
  140.   # New. Update the options for the first "show choice" command
  141.   #-----------------------------------------------------------------------------
  142.   def update_show_choices(params)
  143.     params[0].each {|s| $game_message.choices.push(s) }
  144.   end
  145.   
  146.   #-----------------------------------------------------------------------------
  147.   # New. If cancel specified, update it to reflect merged choice numbers
  148.   # The last one is taken if multiple cancel choices are specified
  149.   #-----------------------------------------------------------------------------
  150.   def update_cancel_choice(params)
  151.    
  152.     # disallow, just ignore
  153.     return if params[1] == 0   
  154.    
  155.     # branch on cancel
  156.     return update_branch_choice if params[1] == 5
  157.    
  158.     # num_choices is not one-based
  159.     cancel_choice = params[1] + (@num_choices)
  160.     # update cancel choice, as well as the first choice command
  161.     $game_message.choice_cancel_type = cancel_choice
  162.     @first_choice_cmd.parameters[1] = cancel_choice
  163.   end
  164.   
  165.   #-----------------------------------------------------------------------------
  166.   # New. Set the initial choice command to "branch cancel"
  167.   #-----------------------------------------------------------------------------
  168.   def update_branch_choice
  169.     branch_choice = $game_message.choices.size + 1
  170.     $game_message.choice_cancel_type = branch_choice
  171.     $game_temp.branch_choice = branch_choice
  172.     @first_choice_cmd.parameters[1] = branch_choice
  173.   end
  174.   
  175.   def command_403
  176.     command_skip if @branch[@indent] != $game_temp.branch_choice - 1
  177.   end
  178.   
  179.   #-----------------------------------------------------------------------------
  180.   # New. For each branch, update it to reflect the merged choice numbers.
  181.   #-----------------------------------------------------------------------------
  182.   def update_choice_numbers
  183.    
  184.     # Begin searching immediately after cmd 102 (show choice)
  185.     i = @choice_search
  186.    
  187.     # Rough search for "When" commands. The search must skip nested commands
  188.     while TH::Large_Choices::Code_Filter.include?(@list[i].code) || @list[i].indent != @indent
  189.       if @list[i].code == 402 && @list[i].indent == @indent
  190.         @list[i].parameters[0] = @num_choices
  191.         @num_choices += 1
  192.       end
  193.       i += 1
  194.     end
  195.   end
  196.   
  197.   #-----------------------------------------------------------------------------
  198.   # New. Returns the next command after our choice branches
  199.   #-----------------------------------------------------------------------------
  200.   def skip_choice_branches
  201.     # start search at the next command
  202.     # skip all choice branch-related commands and any branches
  203.     while TH::Large_Choices::Code_Filter.include?(@list[@choice_search].code) || @list[@choice_search].indent != @indent
  204.       @choice_search += 1
  205.     end
  206.     return @choice_search
  207.   end
  208. end
复制代码


插入main以上

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

点评

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

评分

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

查看全部评分


回复

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-8-28 09:54:21 | 显示全部楼层
@540486098
累死了

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

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

点评

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

回复

使用道具 举报

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-8-28 10:02:14 | 显示全部楼层
本帖最后由 540486098 于 2013-8-28 10:03 编辑
76213585 发表于 2013-8-28 09:54
@540486098
累死了



我知道你累←注意看
等等,这个怎么办
QQ图片20130828095611.jpg
回复

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-8-28 10:07:11 | 显示全部楼层
540486098 发表于 2013-8-27 19:02
我知道你累←注意看
等等,这个怎么办

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

回复

使用道具 举报

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-8-28 10:16:37 | 显示全部楼层
76213585 发表于 2013-8-28 10:07
论譚代碼問題
把@INDEX 旁的URL等等刪掉即可

删掉之后......
QQ图片20130828095611.jpg

点评

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

使用道具 举报

梦石
0
星屑
55
在线时间
87 小时
注册时间
2013-7-11
回帖
75
 楼主| 发表于 2013-8-28 10:37:43 | 显示全部楼层
@76213585 可以是可以了,但是为什么不可以选择呢??

点评

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

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部