[Ace] Common error debugging tips
There were numerous cases when people keep asking for support for a common error that occurred in their project. However, they are not completely wrong. While the error notices are the same, the reason is usually different. Thus they still deserve their own question answered by their own case. At the same time, usually, how to diagnose the error is still the same. So here is the thread for it.----------------------------------------------
Damage formula deals zero damage
Causes:
By default, all the code error within the custom database formula is rescued by returning zero damage.
Why this happens:
I believe that the engine is being sold as "easy enough to use", thus preventing the error popup (which can lead to an assumption if the engine is buggy). This is, in my opinion, bad design for the developer. The developer needs to know what was the error instead of being confused by zero damage.
How to mitigate:
To make the error visible, you need to hijack the eval function from the default code library by inserting this snippet.
Code:
class RPG::UsableItem::Damage
def eval(a, b, v)
begin
result = .max * sign
rescue StandardError => err
raise "Formula: #{@formula}\n\n#{err.to_s}"
end
return result
end
end
----------------------------------------------
Script 'Cache' line 106: RGSSError occurred. failed to create bitmap
Causes:
This error indicates that the game is failed to load an image (obviously, duh).
Why this happens:
There're many reasons for it. It could be because the image exceeded a certain threshold (i.e, too big), or the image is just corrupted. However, the engine did not mention which file that has the problem.
How to mitigate:
To investigate which file that has the problem, you could insert the snippet below. This, however, will NOT solve your problem. The failed image to load will simply be replaced by an empty bitmap, but while you're at it, it also pops up a message saying which file that has the problem
Code:
class << Cache
def self.normal_bitmap(path)
begin
@cache = Bitmap.new(path) unless include?(path)
rescue
msgbox "Failed to create bitmap: #{path}"
@cache = Bitmap.new(1,1)
end
@cache
end
end
The game refuses to save (additionally, it also deleted the save file)
Causes: At some point, the save contains information that could not be saved. It is not corrupted, it just can not be saved.
Why this happens:
This mainly because of a poorly written external script. The script culprit put a specific element (usually a bitmap object, or sprite) to the save content object (in Game_Actor, or Game_System, etc), make it unable to dump into a save file. Again, the default engine didn't put a good indication of what was causing the issue. The engine just put a buzzer sound (and delete the save file) instead of error notice because somehow they don't like an error notice shows up in-game. So that people usually had no idea what was going on.
The reason why the save file is deleted is mainly that during the process of saving, it is corrupting the save file. Instead of the file being there and unable to load, it might as well as delete the file. Again, essentially hiding the error.
How to mitigate:
To check which game object that has the issue, you can try to put this snippet. Then try to save the game.
Code:
class Object
alias :classname :class
end
class << DataManager
def save_game(index)
begin
save_game_without_rescue(index)
rescue
delete_save_file(index)
retry_saving
false
end
end
def retry_saving
make_save_contents.each_value do |content|
begin
Marshal.dump(content)
rescue
msgbox "Failed to dump #{content.classname}"
end
end
end
end
Unfortunately, this snippet alone will not save your project. It only pointed out on which game object that causes the issue. Once the object is identified, it's easier to break down which script is the culprit.
The next step is, if you know what you're doing, you can probably walk on your own. But if you don't know anything about scripting, you should ask people who have the knowledge on scripting.
Game_Interpreter Line 1411 Error
Refers to this thread: https://forums.rpgmakerweb.com/inde...interpreter-line-1411-error-backtracer.112849
本贴来自国际rpgmaker官方论坛作者:TheoAllen处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/ace-common-error-debugging-tips.105690/
页:
[1]