[SOLVED]Trouble With First Script (undefined)

Status
Not open for further replies.

lordvalinar

Lord of the Damned
Veteran
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...

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:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top