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

  • console.PNG
    console.PNG
    53.2 KB · Views: 15
  • undefined.PNG
    undefined.PNG
    287.8 KB · Views: 13

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,164
Reaction score
14,654
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

  • item.PNG
    item.PNG
    65.6 KB · Views: 11

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
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
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
Do you have VE_Basic module above VE_MP levels in your plugin list?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,164
Reaction score
14,654
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,356
Reaction score
1,383
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,356
Reaction score
1,383
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
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
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
32,520
Reaction score
8,147
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
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
@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

  • aisnotdefined.PNG
    aisnotdefined.PNG
    46.7 KB · Views: 0
  • textfile.png
    textfile.png
    12.1 KB · Views: 0

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,164
Reaction score
14,654
First Language
English
Primarily Uses
RMMV
did you start a new game?
 

Latest Threads

Latest Posts

Latest Profile Posts

Ami
This is the End of the Endurance,everyone are celebrating the end of their Endurance

I just wondering what Menu for Tomorrow
Two years into developing my game and I just scrolled through the BaseResource Pack that comes with MV for the first time xD I never knew how much awesome stuff was in there. Also so many names I know from the forum, like Shaz & Archeia ... and that's not the only resource pack I found in the depth of my hard drive :0 Right now I'm both confused and hyped about all the stuff I own.
Decided to start watching Naruto; and not only is it a genuinely good series, but it's also very inspiring.
I just wish Funimation got its act together and fix the missing dubbed episodes.
Decided to work on my game a little bit, made this Motel looking building. I am still on temporary hiatus though as getting Therapy is more difficult than I thought.
Every game that has an option to choose to turn on the subtitle at the first time setup deserves an award.

Forum statistics

Threads
111,286
Messages
1,059,957
Members
144,600
Latest member
Yiggityyoo
Top