- Joined
- Mar 31, 2013
- Messages
- 259
- Reaction score
- 117
- First Language
- English
- Primarily Uses
- RMMZ
Okay so... it was most definitely user error lol turns out I was referring to the wrong plugin name. I had renamed it and forgot to fix the name in the ['myplugin'] part lol
now it's returning the length and everything is a-okay!
======= SOLVED ========
So I thought to make my game a plugin that essentially has 3 parameters (+1 optional):
CommonEvent ID (this is the event to run when an item is equipped or unequipped)
SlotID (this is the Equipment Type ID as listed in the database (ie. default is 4 for Body)
Actors (this is an array for all actor IDs that would be affected)
^ example if you only want actors 1 and 3 activating the common event when changing armors, the array should be: 1,3
The Problem:
Running the code with the console for some reason lists my array length as 1.... this is the relevan lines:
var params = PluginManager.parameters['myplugin'];
var pActors = String(params['Actors']).split(',');
Where I'm trying to compare (new function I created within the plugin of course):
EDIT: Rest assured there is the [ i ]s after pActors below, they just seem to convert it to italics...
The console returns the ID as: undefined
---------
So there are a few things I would like advice on regarding this.... what is the difference between "==" and "===" in if-statements? I have never encountered 3 conditionals before (mostly worked on Neverwinter Scripts which are basic C - C++ language based scripts). And the other thing is trying to figure how to actually define them and get them working properly lol
The plugin worked in its most basic form (no parameters/customization, just straight up on changeEquip = run common event, but I want to make the plugin customizeable for others to download as well
now it's returning the length and everything is a-okay!
======= SOLVED ========
So I thought to make my game a plugin that essentially has 3 parameters (+1 optional):
CommonEvent ID (this is the event to run when an item is equipped or unequipped)
SlotID (this is the Equipment Type ID as listed in the database (ie. default is 4 for Body)
Actors (this is an array for all actor IDs that would be affected)
^ example if you only want actors 1 and 3 activating the common event when changing armors, the array should be: 1,3
The Problem:
Running the code with the console for some reason lists my array length as 1.... this is the relevan lines:
var params = PluginManager.parameters['myplugin'];
var pActors = String(params['Actors']).split(',');
Where I'm trying to compare (new function I created within the plugin of course):
EDIT: Rest assured there is the [ i ]s after pActors below, they just seem to convert it to italics...
Game_Actor.prototype.isActorInMyArray = function(actorId) {
console.log('isActorInMyArray called! Length: ' + String(pActors.length));
for (var i = 0; i < pActors.length; i++) {
console.log('ID: ' + String(pActors));
if (Number(pActors) == actorId) {
return true;
}
}
return false;
}
The console returns the ID as: undefined
---------
So there are a few things I would like advice on regarding this.... what is the difference between "==" and "===" in if-statements? I have never encountered 3 conditionals before (mostly worked on Neverwinter Scripts which are basic C - C++ language based scripts). And the other thing is trying to figure how to actually define them and get them working properly lol
The plugin worked in its most basic form (no parameters/customization, just straight up on changeEquip = run common event, but I want to make the plugin customizeable for others to download as well
Last edited:

