- Joined
- Aug 5, 2015
- Messages
- 858
- Reaction score
- 364
- First Language
- Spanish
Hello, I started to note, a common list of things than people are having when they import your plugin inside their game,
many of you may already have actually had to battle with this probles without knowing why it doesn't work.
Here I'll compile an entire list of those so common bugs, and how to avoid them, or to check:
When testing the game, remember to press F8 to open the console, that is actually the only and best way you have to debug it properly on your MV editor.
Parameters doesn't work, my plugin breaks with no reason or says things like undefined "MyPluginName"
This problem happens when the user renames your script as another name, so they plugin manager can't load the parameters properly.
function isEmpty (obj) { for (var k in obj) if (obj.hasOwnProperty(k)) return false; return true;}
My plugin requires another, how do I manage that?
The Imported variable was added only for that idea:
if (!Imported["MyDependency"]) { throw new Error("The plugin 'MyPluginNames' requires 'MyDependency' plugin to work!");}That's why it's usefull.
If you are using MVCommons, you can also check using:
PluginManager.imported(string key)Even when both do the same, this one may be more easy to understand sometimes.
Note:
As I found more common bugs, I'll post here how to give a better information to users about them, so we can (hopefully) reduce the amount of bug reports that way.
many of you may already have actually had to battle with this probles without knowing why it doesn't work.
Here I'll compile an entire list of those so common bugs, and how to avoid them, or to check:
When testing the game, remember to press F8 to open the console, that is actually the only and best way you have to debug it properly on your MV editor.
Parameters doesn't work, my plugin breaks with no reason or says things like undefined "MyPluginName"
This problem happens when the user renames your script as another name, so they plugin manager can't load the parameters properly.
- As a recommendation, name your plugins like a javascript identifier: /[A-Za-z_][A-Za-z0-9_]*\.js/Why?
- Add a little snippet if your plugin uses parameters:
function isEmpty (obj) { for (var k in obj) if (obj.hasOwnProperty(k)) return false; return true;}
- Why?
My plugin requires another, how do I manage that?
The Imported variable was added only for that idea:
if (!Imported["MyDependency"]) { throw new Error("The plugin 'MyPluginNames' requires 'MyDependency' plugin to work!");}That's why it's usefull.
If you are using MVCommons, you can also check using:
PluginManager.imported(string key)Even when both do the same, this one may be more easy to understand sometimes.
Note:
As I found more common bugs, I'll post here how to give a better information to users about them, so we can (hopefully) reduce the amount of bug reports that way.
Last edited by a moderator:
