Undefined is not a Function VE_Scripts

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
So, I've been trying to make a Final Fantasy 1 styled Magic system, where you only have a limited number of spells per "day", and this https://victorenginescripts.wordpress.com/rpg-maker-mv/mp-levels/ has been the closest I could find for my goal. However, the growth functions were not working, so I decided that instead of it being base on level ups, why not find a special currency around the world that can solely be spent to buy items to increase those levels. The moment I used the item in game, it crashed and game me: Type Error: Undefined is not a function.
I get this error even if it and it's dependency mod is installed. Judging from my limited skill in JS, it looks like it's conflicting with a base script in rpg_scenes.

I don't know what else to really say. It did this on my main game, and also on my testing game.
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,138
Reaction score
12,412
First Language
English
Primarily Uses
RMMV
What "item" did you use in the game that caused it to crash? Show us how you have that set up.

Also, did you add this plugin and then continue a game that you'd previously saved? That is a common cause of the 'undefined' errors.
 

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
What "item" did you use in the game that caused it to crash? Show us how you have that set up.

Also, did you add this plugin and then continue a game that you'd previously saved? That is a common cause of the 'undefined' errors.
I just started making the game, so that is the answer to your second question. As to the first question, I just made a item and used the note tags provided by the plug in to make it where it would level up my MP. Item attached.
 

Attachments

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
603
Reaction score
1,406
First Language
English
Primarily Uses
RMMV
It's also likely you have your plugins installed in the wrong order, or that another plugin is somehow interfering. Can we see your plugin manager?

I've never seen anything try to call a function by Game_Actor.Game_BattlerBase before...that looks highly suspicious...but I can't see anything wrong with the plugin itself, which is why I suspect interference.
 

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
It's also likely you have your plugins installed in the wrong order, or that another plugin is somehow interfering. Can we see your plugin manager?

I've never seen anything try to call a function by Game_Actor.Game_BattlerBase before...that looks highly suspicious...but I can't see anything wrong with the plugin itself, which is why I suspect interference.
I made a new project file to test them, the only plug ins I have are VE_Basic module (Required) and VE_MP Levels. The screenshots I posted are from that new game project
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
603
Reaction score
1,406
First Language
English
Primarily Uses
RMMV
Do you have VE_Basic module above VE_MP levels in your plugin list?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,138
Reaction score
12,412
First Language
English
Primarily Uses
RMMV
What version of MV are you running, and what is the version of your core.js file (in the js folders, check core.js and there should be a version number on the first couple of lines - if it's not there, it means you have 1.0.0)

Also, what is on line 459 of your VE_MPLevels.js file? The one you linked to doesn't seem it would throw that error on that line, so I'm wondering if you've made any mods or inserted/removed any lines.
 

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
What version of MV are you running, and what is the version of your core.js file (in the js folders, check core.js and there should be a version number on the first couple of lines - if it's not there, it means you have 1.0.0)

Also, what is on line 459 of your VE_MPLevels.js file? The one you linked to doesn't seem it would throw that error on that line, so I'm wondering if you've made any mods or inserted/removed any lines.
Version 1.5.1.
Line 459 is as follows.
mpLevel[level].now = now.clamp(0, max);
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,082
Reaction score
1,040
First Language
Spanish
Primarily Uses
RMVXA
Game_Actor implies Game_BattlerBase.
Game_BattlerBase is not a function of Game_Actor..... so Game_BattlerBase respect of Game_Actor, is undefined.
that's the error.

I believe the error comes from another script, probably a required script by VE, that rewires the original functions to VE functions.

I can't find that particular call in ve_mplevels.js
 

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
I assume that means that the plug in is broken, is there a way I can fix it, the developer appears to have vanished off the face of the earth.

EDIT: If no, I will accept my fate and just use a more DND styled spell system from Yanfly.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,082
Reaction score
1,040
First Language
Spanish
Primarily Uses
RMVXA
correction:
Code:
mpLevel[level].now = now.clamp(0, max);
.clamp(0, max) seems to be what's undefined, not the other thing I mentioned.
which, is still weird, and shouldn't be written that way, but doesn't seem to be the problem the error refers to.
if that is not a javascript instruction, then it must be a function defined in another script.
that's why it's "undefined".
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
603
Reaction score
1,406
First Language
English
Primarily Uses
RMMV
I'm getting errors that it cannot read property "now" of undefined; mpLevels[level] is undefined; since that's the case, attempting to run a clamp operation would indeed result in an undefined is not a function error.

I believe this is due to Game_BattlerBase._mpLevelValues not being initialized properly; however, I'm too tired at the moment to try to figure out the solution. If no one else can solve this by tomorrow, I'll have another look at it.

Edit: meant to say mpLevels[level] is an empty object, making mpLevels[level].now undefined
 
Last edited:

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
Gonna guess from the silence that there is nothing I can do.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,012
Reaction score
7,023
First Language
German
Primarily Uses
RMMV
Gonna guess from the silence that there is nothing I can do.
no, it means that the experts have their own live as well and can't always answer within minutes.
Our rules say "no bumping unless 72 hours have passed" exactly for this reason.

Don't give up, check the state of this topic again tomorrow and the day after.
Sometimes it takes weeks to pinpoint an error.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
603
Reaction score
1,406
First Language
English
Primarily Uses
RMMV
@Andar, thank you. Yes, my husband got his first day off in 8 days, so I chose to spend my time yesterday enjoying his presence at home and with my family, rather than tracking down bugs in plugins for free.

@shadowscale1229 I've narrowed down the problem; the plugin is not correctly evaluating the mp level gain notetag. It's adding a string to the mp value rather than just the result as a number. Since clamp is a function of a number, not a string, it generates the "undefined is not a function" error.

This plugin has quite a few...er..."quirks"... You MUST set up each actor's max MP level. You MUST set up each actor's MP level growth for each level. If you fail to do this, you will either end up with errors or a seemingly inexplicable 0 max MP for a given level.

Under the heading "Victor Engine" toward the very end, just before the heading "Game_Action", you will need to change the following lines:

The last line for VictorEngine.MPLevels.processValues4 becomes:
Code:
data.MPLevels[level].growth = eval(String(match[3]).trim());
The last line for VictorEngine.MPLevels.processValues5 becomes:
Code:
data.MPLevels[level].gain = eval(String(match[2]).trim());
Please let me know if there are any questions as to implementing the fix, or if for some reason it doesn't work. Please make sure you pay attention to the note I listed in bold above before reporting further issues. :)
 

shadowscale1229

Villager
Member
Joined
Nov 5, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMMV
The last line for VictorEngine.MPLevels.processValues4 becomes:
Code:
data.MPLevels[level].growth = eval(String(match[3]).trim());
The last line for VictorEngine.MPLevels.processValues5 becomes:
Code:
data.MPLevels[level].gain = eval(String(match[2]).trim());
First off, I'd like to apologize for being impatient, thank you for taking time to help me.
Now, I went into VE_MPLevels and changed those lines, but now when I try to test my game, it starts up with "a is not defined". The only other thing I did was change the version number in the description to 1.00.01, to signify to myself that this was the fixed one. I've attached the console and the lines I changed.
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,138
Reaction score
12,412
First Language
English
Primarily Uses
RMMV
did you start a new game?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I friend of mine insisted on practicing dubbing things with him... and its quite funny, yet, it really takes a huge amount of practice!
Gotta save this for my next thread later...
Finsh all of the walking dead game in a week, such an amazing emotional trip
I really need to stop sidetracking sometimes
Take THREE seconds to watch my freakin plugin video clip and just be proud of me, forum/Dad!

Forum statistics

Threads
97,867
Messages
947,494
Members
129,102
Latest member
johnnylam123
Top