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

Project1

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

[已经解决] 关于新版Quack无法存档的问题

[复制链接]

Lv5.捕梦者

梦石
0
星屑
24287
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
跳转到指定楼层
1
发表于 2020-9-18 16:49:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 alexncf125 于 2020-9-18 17:19 编辑

汉化Yami气泡对话框 Quack插件.rar (1.45 MB, 下载次数: 65)

查了一下,
Somehow I can't save the game when using this script. Tested on a fresh project, only Yami Chatter Box and this script installed.

EDIT: Turns out I found that @quack_msgs and @qmsg_windows can't be marshalled. I managed to fix this by turn both of them into an empty array before saving, and redefine them after saving or loading is successful.
使用此脚本时,我无法以某种方式保存游戏。在新项目上进行了测试,仅安装了Yami Chatter Box并安装了此脚本。

编辑:事实证明,我发现无法整理@quack_msgs和@qmsg_windows。我设法通过在保存之前将它们都转换为空数组来解决此问题,并在保存或加载成功后重新定义它们。

在保存之前将它们都转换为空数组
在保存或加载成功后重新定义它们
以上两步如何写??
RUBY 代码复制
  1. class Scene_Save < Scene_File
  2.   alias old_on_savefile_ok_old on_savefile_ok
  3.   def on_savefile_ok
  4.     @quack_msgs = []
  5.     @qmsg_windows = []
  6.     old_on_savefile_ok_old
  7.   end
  8. end
  9.  
  10. class Scene_Load < Scene_File
  11.   alias old_on_load_success_old on_load_success
  12.   def on_load_success
  13.     old_on_load_success_old
  14.     $game_message.quack_msg_make
  15.   end
  16. end
我这样写不行喔...是要用instance_variable_get吗??
不会用...求教...

Lv6.析梦学徒

老鹰

梦石
40
星屑
33407
在线时间
6552 小时
注册时间
2012-5-26
帖子
3178

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

2
发表于 2020-9-18 17:57:36 | 只看该作者
存储的时机错了
是在DataManager里面的save_game,在这个方法里面的首行添加那两个变量置空
你写的on_savefile_ok是已经存完后的处理

这什么奇怪插件,怎么还把窗口也写到Game类型的对象里的,完全打破RGSS的架构(x)

评分

参与人数 1+1 收起 理由
alexncf125 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

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

开拓者短篇九导演组冠军

3
发表于 2020-9-18 18:26:14 | 只看该作者
等这个作者自己更新吧,这都相当于整个看懂它的代码然后重写一遍了

点评

作者兩年没上线, 想必今后不再更新了  发表于 2020-9-18 19:11
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24287
在线时间
5046 小时
注册时间
2016-3-8
帖子
1618
4
 楼主| 发表于 2020-9-18 19:10:33 | 只看该作者
本帖最后由 alexncf125 于 2020-9-19 09:33 编辑
百里_飞柳 发表于 2020-9-18 17:57
存储的时机错了
是在DataManager里面的save_game,在这个方法里面的首行添加那两个变量置空
你写的on_savef ...


RUBY 代码复制
  1. module DataManager
  2.   class << self
  3.     alias quack_msg_save_game save_game
  4.     def save_game(index)
  5.       @temp_quack_msgs = []
  6.       @temp_qmsg_windows = []
  7.       $game_message.instance_variable_get(:@quack_msgs).each {|temp| @temp_quack_msgs.push(temp) }
  8.       $game_message.instance_variable_get(:@qmsg_windows).each {|temp| @temp_qmsg_windows.push(temp) }
  9.       $game_message.instance_variable_get(:@quack_msgs).clear
  10.       $game_message.instance_variable_get(:@qmsg_windows).clear
  11.       quack_msg_save_game(index)
  12.       @temp_quack_msgs.each {|temp| $game_message.instance_variable_get(:@quack_msgs).push(temp) }
  13.       @temp_qmsg_windows.each {|temp| $game_message.instance_variable_get(:@qmsg_windows).push(temp) }
  14.     end
  15.   end
  16. end
「在保存之前将它们都转换为空数组」和「在保存成功后还原它们成原先的数组」写好了
「在加载成功后重新定义它们」的重新定义是什么意思??
重新定义没问题吗?会把旧的变成新的吧?
我的意思大概是:一开始是a 不知会不会转成的=>b 重新定义=>新的a

点评

这就是他设计上的失误了,因为窗口是无法被序列化存储的,除非你自己再把其中的关键变量单独存一份  发表于 2020-9-19 01:22
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-26 13:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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