Script call Help

Artomes

Veteran
Veteran
Joined
Jun 3, 2016
Messages
45
Reaction score
5
First Language
English
Primarily Uses
N/A
I created this small script to run at the start of each battle to randomize what row(yanfly row_formations) the battler will be in depending on the class but the isClass function is throwing me a null error. I'm not really sure what the issue is. I was wondering if someone could help me understand the isClass function and the $dataClasses var.

Thanks in advance!
for (var i = 1; i < $gameParty.battleMembers().length; i++) {

var actor = $gameActors.actor(this._params);

var n = this._params[3];

if(actor.isClass($dataClasses[11])) {

var rndRow = Math.randomInt(4)+3;

actor.setRow(rndRow); }

}
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ

@Atromes Instead of double posting your thread, you can ask from us to move it to its correct category. You can do this by using the report button on your own thread. Thank you.

 

Artomes

Veteran
Veteran
Joined
Jun 3, 2016
Messages
45
Reaction score
5
First Language
English
Primarily Uses
N/A
Oh ok, thank you.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
I am not sure, since I never scratched the js parts of MV, but according to my knowledge, a method that is named isClass() should return a boolean value True or False, if whatever you put in the parentheses IS or IS NOT a class respectively.

$dataClasses[] seems not a variable, but an one dimension array to me.
An array is a set of variables of the same kind, set one after another.
You can refer to them by a pointer.

It probably contains the names of the Classes on the database, like Swordsman, Magician etc.

Thus $dataClasses[11] means probably the 11th Class name on the database.

And
$temp = $dataClasses[1]; // will assign the first class name that is set on the database to the variable $temp.


Again I am not sure, I got no idea, but the naming is so user friendly I couldn't resist to make some guesses that must be taken with a grain of salt.

Just checked the plugin and it seems I am probably right. If so, hopefully I helped you figure out some things.
 
Last edited:

Clock Out

Veteran
Veteran
Joined
Jun 14, 2016
Messages
92
Reaction score
45
First Language
English
Primarily Uses
RMMV
The isClass method returns a Boolean value so it'll never be null unless it's been patched somehow to return null. I did a quick search though
YEP_RowFormation.js but I didn't find a reference to isClass. Does the actual error message say null or does it say undefined and you're calling that a null error? What is the exact error message?

Also, the $dataClasses array does contain the null value at element 0.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Also, the $dataClasses array does contain the null value at element 0.
Probably to set the array pointer go along with Class id of database and stuff?
 

Artomes

Veteran
Veteran
Joined
Jun 3, 2016
Messages
45
Reaction score
5
First Language
English
Primarily Uses
N/A
Thank you, guys... Greatly appreciate the feedback and help. This made me realize I still have a lot to learn in regards to the engine and syntax but have found some tutorials on the subject, thanks again.
 

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

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.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top