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

Project1

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

[已经解决] 想问下变量数值输入的上限要如何改呢

[复制链接]

Lv2.观梦者

梦石
0
星屑
604
在线时间
23 小时
注册时间
2020-6-22
帖子
27

极短22参与

跳转到指定楼层
1
发表于 2022-8-11 03:02:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
就是一个道具我希望使用它的时候直接可以输入密码,可是上限是8,我设置的密码是十位,鼓捣了半天也不会,希望有大佬帮忙!
美术/剧本/工程修炼中

Lv5.捕梦者

梦石
0
星屑
24272
在线时间
5044 小时
注册时间
2016-3-8
帖子
1618
2
发表于 2022-8-11 09:48:26 | 只看该作者
本帖最后由 alexncf125 于 2022-8-11 09:51 编辑

使用方法

在输入数字事件命令之后,创建注释并写入

   <num input digits: x>
  
其中 `x` 是您想要的位数

例子:
<num input digits: 10>

  1. =begin
  2. #===============================================================================
  3. Title: More Input Digits
  4. Author: Hime
  5. Date: Jan 29, 2015
  6. URL: http://himeworks.com/2015/01/more-input-digits/
  7. --------------------------------------------------------------------------------
  8. ** Change log
  9. Jan 29, 2015
  10.    - Initial release
  11. --------------------------------------------------------------------------------   
  12. ** Terms of Use
  13. * Free to use in non-commercial projects
  14. * Contact me for commercial use
  15. * No real support. The script is provided as-is
  16. * Will do bug fixes, but no compatibility patches
  17. * Features may be requested but no guarantees, especially if it is non-trivial
  18. * Credits to Hime Works in your project
  19. * Preserve this header
  20. --------------------------------------------------------------------------------
  21. ** Description

  22. This script allows you to set more digits for your number input event command.
  23. By default, the event editor only supports up to 8 digits.

  24. --------------------------------------------------------------------------------
  25. ** Installation

  26. In the script editor, place this script below Materials and above Main

  27. --------------------------------------------------------------------------------
  28. ** Usage

  29. Right after an input number event command, create a comment and write

  30.    <num input digits: x>
  31.   
  32. Where `x` is the number of digits you would like
  33. #===============================================================================
  34. =end
  35. $imported = {} if $imported.nil?
  36. $imported[:TH_MoreInputDigits] = true
  37. #===============================================================================
  38. # ** Configuration
  39. #===============================================================================
  40. module TH
  41.   module More_Input_Digits
  42.     Regex = /<num[-_ ]input[-_ ]digits:\s*(\d+)\s*>/i
  43.   end
  44. end
  45. #===============================================================================
  46. # ** Rest of script
  47. #===============================================================================
  48. module RPG
  49.   class Event::Page
  50.     alias :th_more_input_digits_list :list
  51.     def list
  52.       parse_more_input_digits unless @more_input_digits_parsed
  53.       th_more_input_digits_list
  54.     end
  55.    
  56.     def parse_more_input_digits
  57.       @more_input_digits_parsed = true
  58.       i = 0
  59.       while i < @list.size
  60.         cmd = @list[i]
  61.         
  62.         # Number Input command
  63.         if cmd.code == 103         
  64.                     
  65.           # Collect all comments under it
  66.           next_cmd = @list[i+1]
  67.           comment = ""
  68.           while next_cmd.code == 108 || next_cmd.code == 408
  69.             i += 1
  70.             comment << "\n" << next_cmd.parameters[0]
  71.             next_cmd = @list[i+1]            
  72.           end
  73.          
  74.           # Check if there's something special
  75.           if comment =~ TH::More_Input_Digits::Regex
  76.             num = $1.to_i         
  77.             cmd.parameters[1] = num            
  78.           end
  79.         end
  80.         i += 1
  81.       end      
  82.     end
  83.   end
  84. end
复制代码
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
604
在线时间
23 小时
注册时间
2020-6-22
帖子
27

极短22参与

3
 楼主| 发表于 2022-8-11 19:37:50 | 只看该作者
alexncf125 发表于 2022-8-11 09:48
使用方法

在输入数字事件命令之后,创建注释并写入

谢谢您!但是这个脚本貌似公共事件不行,因为我是在公共事件里写的再插入到道具使用里,是还要加点别的嘛
美术/剧本/工程修炼中
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24272
在线时间
5044 小时
注册时间
2016-3-8
帖子
1618
4
发表于 2022-8-11 20:01:50 | 只看该作者
55行的class Event::Page改成class CommonEvent吧?
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
20945
在线时间
9332 小时
注册时间
2012-6-19
帖子
7106

开拓者短篇九导演组冠军

5
发表于 2022-8-12 00:47:29 | 只看该作者
插入这个脚本
https://script.miaowm5.com/post/27

然后在数值输入处理指令前插入一个执行脚本指令执行以下代码
  1. m520150501_change({2=>10})
复制代码


评分

参与人数 1+1 收起 理由
alexncf125 + 1 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 07:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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