Project1
标题:
急!遇到个续行符显示超长文章的问题!
[打印本页]
作者:
mickyhaozi
时间:
2009-5-16 00:10
标题:
急!遇到个续行符显示超长文章的问题!
如题,我用了
http://rpg.blue/viewthread.php?tid=66027
这里的长文章显示方法,但是会出现Window——Message的if $game_temp.num_input_variable_id > 0问题,说是NILclass没有 “>”的方法。弄了一下午都没能解决!
同时还有个问题,请问有没有RMXP相关的QQ群?想加入学习交流,谢谢![
QQ群,非常非常想加,有吗? [LINE]1,#dddddd[/LINE]
此贴于 2009-5-18 13:59:26 被版主darkten提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
版务信息:版主帮忙结贴~
作者:
veal
时间:
2009-5-17 18:22
猫姐的脚本哦。这个脚本有点问题,第98行多了一个or
# 下一个事件指令为处理输入数值的情况下
elsif @list[@index+1].code == 103
or
以下是修改好的脚本
#============================================================================
# ■ 续行符文章连辍显示 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] == " _"
# 如果已经达到 12 行就返回
if line_count == 12
# 清除续行标记
$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 < 12
# 事件指令不在文章两行以下的情况
else
# 如果本行末尾有续行标记则增加到 12 行
if @list[@index].parameters[0][-2, 2] == " _"
line_max = 12
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
复制代码
另外如果哪位有发布权限的版主路过也请把主站上的脚本改好吧 =v= [LINE]1,#dddddd[/LINE]
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者:
后知后觉
时间:
2009-5-17 18:55
额。。
路过,抱走{/hx}
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1