The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: modern algebra on September 18, 2010, 10:33:46 PM

Title: Script Troubleshooting for the Non-Scripter
Post by: modern algebra on September 18, 2010, 10:33:46 PM
Script Troubleshooting Tutorial for the Non-Scripter


Apologia

Most errors that people see from released scripts are not major and can easily be fixed, even by the non-scripter. The purpose of this tutorial is to teach some very basic strategies on diagnosing and fixing common errors without any particularized scripting knowledge. It does not aim to teach you how to script, but simply goes through a few of the most common errors you are likely to encounter when using custom scripts and what can be done about them by yourself, before asking the scripter. In the main part of this tutorial, I will go through some common error messages, what they might mean, and how to fix them. I will not be explaining why these errors occur or why these tips fix them since that requires some knowledge of scripting, and this tutorial is aimed at the non-scripter. If you would like to know, feel free to ask me in this topic and I will explain to the best of my knowledge.


Caution

Most of the tips in this tutorial do not require you to do any substantial editing to your script, since if that is required, your best strategy is to go to a scripter. However, if you do try to edit a script, do not do so in your main project. It is a lot safer to make a test project and do any editing there, as even small errors on your part may become quite a headache and it's better to be safe. Again, there is nothing in this tutorial that would require you to do any major editing, this caution is mostly just in case you get creative. Don't get creative.


General

Remember: the first thing to do when encountering any error is to go to the topic where the author published the script and see if anyone else has had the same problem and if the error has been addressed. The easiest fix is the one you don't have to do. Secondly, if this tutorial does help you to fix the error, then you should still alert the author of the script to the error. It is a simple courtesy and one which you should always undertake, as scripters want their scripts to be bug-free.

Also, some common errors, such as the bug where you can't set a variable to the stats of an actor, are bugs in the default scripts and not the result of any custom script. A good set of fixes for these can be found in Yanfly's Core Fixes and Upgrades (http://rmrk.net/index.php/topic,42396.0.html). Check those out and see if the bug you are getting is resolved by one of those scripts.


Common Errors



Script Incompatibilities

The most common reason for a script not to work properly is a conflict with another script. If none of the above tips resolve your error, then you should look into the possibility that it is a script incompatibility. The first thing to do is confirm whether it is a script incompatibility. To do this, make a new project and recreate the error-throwing situation. Then move the problem script into that project. If the error does not occur, then it is a script incompatibility. If it is, then you have to identify which other script is causing the problem. Move each of your other scripts into the clean project one by one until the error occurs. The last script you added is the conflicting script. Now that you know which scripts are problematic, try switching their order in the Script Editor. In other words, if Script X is above Script Y, move Script Y above Script X. Try running the project again and see if the error occurs. If it does then there's not much more you can do by yourself. However, your work in identifying the errors is not all for naught. Alert the authors of both scripts to the incompatibility and ask them for help. The fact that you have already identified the incompatible script and have a clean project with only the error situation in it means that they will probably be much more motivated to help you as half their job is done.



Closing Note

There are probably a bunch of other common and simple little errors I didn't think of when writing this tutorial. If you can think of any, then just bring them to my attention and if there is likely to be a simple fix then I will add it to this tutorial. Also, remember that even if your bug is fixed by following the tips in this tutorial, you should always report errors to the author of the script as a courtesy. Moreover, if your bug is not fixed by the tips in the tutorial, you should always ask the author of the script first and, if he/she refuses, then post a topic asking for help from other scripters.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: cozziekuns on September 18, 2010, 11:26:15 PM
Great tutorial Modern! Not only does this let people fix errors on they're own, but it also gives them a bit of scripting knowledge.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: modern algebra on September 19, 2010, 02:51:00 AM
I'm glad you like it. I don't know how much scripting knowledge it gives anyone though :P
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: cozziekuns on September 19, 2010, 04:09:21 AM
Btw, script errors when using call scripts that are too long for the call script box are common errors with a relatively easy fix. Sounds like something you could add in?
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: modern algebra on September 19, 2010, 12:51:02 PM
yeah, that's a good idea.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: Gracie on October 13, 2010, 03:15:28 PM
Does this count as Necro-posting?

Very usefull, I'll have to look at it when I actually have the patience to.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: IXFURU on July 17, 2011, 02:48:07 PM
What if you get a SystemStackError in a default script?  Is it still okay to alias it as described here, MA?  This is definitely a necropost.  Sorry.  But just ran into a problem where this information could be useful today.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: modern algebra on August 10, 2011, 02:04:20 AM
Sorry for not responding to this earlier.

If you're getting a SystemStackError in a default script, the source of the error is likely in a custom script and it is either a very serious logical error or an incompatibility with another script. Isolate the problem script(s) following the normal guidelines for incompatibilities (add them all in one at a time) and alert the scripter(s) to the error. Failing that, recreate the error in a new project, upload and share it in a script help forum.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: mememe on February 24, 2012, 07:38:09 AM
Hey, can you tell me if i get error somewhat like this:

Script (script_name) line x: NoMethodError occurred
undefined method 'update' for nil:NilClass
_______________________________________________

Please tell me how to fix it.
Thanks....
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: D&P3 on February 24, 2012, 07:46:59 AM
A lot of times when somebody gets that error, it is because they are using an old save that was made before they implemented the script into their game.

Try starting a new game and if it still gives you that error, then you might actually need help :)
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: LoganF on February 24, 2012, 07:53:51 AM
It can be a hard problem to solve without seeing the script. It's easy for a scripter to identify the potential problem than it is for them to describe how to fix it in a general way. If loading a new game doesn't work, check if it is a script incompatibility.

If it isn't that, it would probably easier to just attach/upload the script (or even the project) and see if a scripter will take a look at it. I'm usually more than happy to do a little bit of debugging for a project.
Title: Re: Script Troubleshooting for the Non-Scripter
Post by: Zeriab on March 05, 2012, 11:13:40 AM
It can be a hard problem to solve without seeing the script. It's easy for a scripter to identify the potential problem than it is for them to describe how to fix it in a general way. If loading a new game doesn't work, check if it is a script incompatibility.

I can be very hard indeed. In fact it can be unsolvable hard. That's why you don't see a script which finds the error and tells you how to fix it. It is unfortunately provable impossible to create such a script.

What we can do when we just hear about an error is to think of similar problems and how they were fix. Maybe the fix is similar, maybe not.
This list is an excellent compilation by modern algebra of common problems and their typical causes.

*hugs*