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

Project1

 找回密码
 注册会员
搜索
查看: 1957|回复: 5

[已经过期] 长文章脚本为什么无法收纳数值输入

[复制链接]

Lv4.逐梦者

梦石
0
星屑
5197
在线时间
1256 小时
注册时间
2018-1-16
帖子
366
发表于 2019-8-13 12:35:09 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 l734273398 于 2019-8-14 13:55 编辑

长文章脚本为什么无法收纳接受数值的变量输入????


#============================================================================
# ■ 续行符文章连辍显示 by SailCat
#============================================================================
class Window_Message
alias sailcat_refresh refresh
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
   lines = 0
   $game_temp.message_text.each {lines += 1}
   lines = 4 if lines < 4
   self.height = lines * 32 + 32
   self.contents = Bitmap.new(width - 32, height - 32)
   reset_window
   sailcat_refresh
end
#--------------------------------------------------------------------------
# ● 设置窗口位置与不透明度
#--------------------------------------------------------------------------
def reset_window
   if $game_temp.in_battle
     self.y = 16
   else
     case $game_system.message_position
     when 0  # 上
       self.y = 16
     when 1  # 中
       self.y = 240 - self.height / 2
     when 2  # 下
       self.y = 464 - self.height
     end
   end
   if $game_system.message_frame == 0
     self.opacity = 255
   else
     self.opacity = 0
   end
   self.back_opacity = 160
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 显示文章
#--------------------------------------------------------------------------
def command_101
   # 另外的文章已经设置过 message_text 的情况下
   if $game_temp.message_text != nil
     # 结束
     return false
   end
   # 设置信息结束后待机和返回调用标志
   @message_waiting = true
   $game_temp.message_proc = Proc.new { @message_waiting = false }
   # message_text 设置为 1 行
   $game_temp.message_text = @list[@index].parameters[0] + "\n"
   line_count = 1
   # 最大 4 行
   line_max = 4
   # 循环
   loop do
     # 下一个事件指令为文章两行以上的情况
     if @list[@index+1].code == 401
       # message_text 添加到第 2 行以下
       $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
       line_count += 1
     # 下一个事件指令为显示文章,且本行末尾有续行标记的情况
     elsif @list[@index+1].code == 101 and @list[@index].parameters[0][-2, 2] == " _"
       # 如果已经达到 14 行就返回
       if line_count == 14
         # 清除续行标记
         $game_temp.message_text.gsub!(/ _$/, "")
         # 继续
         return true
       end
       # message_text 添加到第 2 行以下
       $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
       line_count += 1
       # 增加 4 行空间,最多 12 行
       line_max += 4 if line_max < 14
     # 事件指令不在文章两行以下的情况
     else
       # 如果本行末尾有续行标记则增加到 12 行
       if @list[@index].parameters[0][-2, 2] == " _"
         line_max = 14
       end
       # 下一个事件指令为显示选择项的情况下
       if @list[@index+1].code == 102
         # 如果选择项能收纳在画面里
         if @list[@index+1].parameters[0].size <= line_max - line_count
           # 推进索引
           @index += 1
           # 设置选择项
           $game_temp.choice_start = line_count
           setup_choices(@list[@index].parameters)
         end
       # 下一个事件指令为处理输入数值的情况下
       elsif @list[@index+1].code == 103
         # 如果数值输入窗口能收纳在画面里
         if line_count < line_max
           # 推进索引
           @index += 1
           # 设置输入数值
           $game_temp.num_input_start = line_count
           $game_temp.num_input_variable_id = @list[@index].parameters[0]
           $game_temp.num_input_digits_max = @list[@index].parameters[1]
         end
       end
       # 清除续行标记
       $game_temp.message_text.gsub!(/ _$/, "")
       # 继续
       return true
     end
     # 推进索引
     @index += 1
   end
end
end

Lv4.逐梦者

梦石
0
星屑
5197
在线时间
1256 小时
注册时间
2018-1-16
帖子
366
 楼主| 发表于 2019-8-13 19:36:08 | 显示全部楼层
有人没?????????????????????????
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5197
在线时间
1256 小时
注册时间
2018-1-16
帖子
366
 楼主| 发表于 2019-8-14 09:07:43 | 显示全部楼层
哪位好心人告诉一下啊
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
14038
在线时间
2069 小时
注册时间
2016-9-20
帖子
844
发表于 2019-8-14 11:27:02 | 显示全部楼层
問題不夠詳細, 收纳是什么意思, 什么作用的
内容仅供参考,
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5197
在线时间
1256 小时
注册时间
2018-1-16
帖子
366
 楼主| 发表于 2019-8-14 13:52:55 | 显示全部楼层
ppspssss 发表于 2019-8-14 11:27
問題不夠詳細, 收纳是什么意思, 什么作用的

收纳接受数值的变量
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5197
在线时间
1256 小时
注册时间
2018-1-16
帖子
366
 楼主| 发表于 2019-8-15 09:41:17 | 显示全部楼层
有人没???????????????????
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 18:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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