Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
After creating a new skill to test out a TP draining skill, my playtesting comes to a crashing halt thanks to some stupid error. At first I thought it was caused by using SRD's HUD Maker to customize my Battle HUD, so I disabled both plugins & tried again with the default layout (default for YEP Battle Core). I'm still getting the error:

Stupid error!.png
Don't know why the Skill Core needs to draw Actor HP but its apparently causing enough of a conniption fit to crash the game. Only does this with my new Absorb skill. God I wish this engine would stop sucking!
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,148
First Language
English
Primarily Uses
RMMV
1. Do you have YEP Damage Core installed?
2. You say this happens after you execute a skill, show us that skill's damage formula
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,682
Reaction score
15,293
First Language
English
Primarily Uses
RMMV
Is this an error that happens when you use new plugins on an old project?

What version of MV are you using? You can find that in Help About or somewhere like that, in the menu.
What version are your core files? You can find out by opening the project folder, going into the js subfolder, and opening the rpg_core.js file - the core file version should be on the first few lines. If there's no version shown there, it means you have 1.0.0
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
1. Do you have YEP Damage Core installed?
2. You say this happens after you execute a skill, show us that skill's damage formula
Yeah, I have Damage Core. Here's the skill's setup:
TP Drain Skill.png

Is this an error that happens when you use new plugins on an old project?

What version of MV are you using? You can find that in Help About or somewhere like that, in the menu.
What version are your core files? You can find out by opening the project folder, going into the js subfolder, and opening the rpg_core.js file - the core file version should be on the first few lines. If there's no version shown there, it means you have 1.0.0
There's hardly any 'new' plugins as I've been using this setup for a while now. I'm using Version 1.6.1 & the rpg core js file is version 1.6.1 as well.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,888
Reaction score
8,591
First Language
German
Primarily Uses
RMMV
even if there is no new plugin, can you still give us a screenshot of your plugin manager with all plugins listed?
Sometimes errors like this are caused by incompatible plugins or plugins that are in the wrong order - and sometimes such errors don't get triggered until a playthrough gets to a certain data combination that disturbs the plugins.

EDIT:
And please try adding an ;0 to your damage formula. The engine expects a return number to be processed as the result of any damage formula, only using javascript code without returns can cause problems, so force a zero as the last number of the damage formula.
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
Here's the list:
Plugin List.png
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,148
First Language
English
Primarily Uses
RMMV
The MV code includes a safety check against "undefined" return values in the damage formula. I've described the technical details of the issue here, if you are curious.

To verify what I'm saying, use that exact same damage formula in a project without plugins and there will be no crash.

The reason I asked if you had YEP Damage Core installed is that plugin for some reason removes that safety check against undefined values, I would consider that a bug/oversight in the plugin.

Please follow the advice of Andar's edit, add a single statement "0;" to the end of the formula, and that will solve your issue.
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
Now I have not 1 but 2 errors! (It never ends!)
Stupid error!.png

Also, I deleted the damage formula afterward & it didn't crash with either of these 2 errors, so the damage formula is still flawed.
Code:
a.gainTp(50);b.gainTp(-50) 0;
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,002
First Language
English
Primarily Uses
RMVXA
Put the semi-colon before the zero, not after.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,888
Reaction score
8,591
First Language
German
Primarily Uses
RMMV
a.gainTp(50);b.gainTp(-50) 0;
that is the wrong code, @Aloe Guvner misspelled his advice.
Like I said above you should have added ;0 and not 0;

That is the cause for the first error - but it has nothing to do with the second one (as far as I know).
My guess is that the second one is something different that was masked by the original type error because the computer can only report errors to the point where they break the engine.
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
Yay! It finally works without crashing. Now if only I can regulate the TP drained to not take more than what the target has.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,888
Reaction score
8,591
First Language
German
Primarily Uses
RMMV
regulate the TP drained to not take more than what the target has.
Code:
r=b.tp;a.gainTP(r);b.gainTP(-r);0
will create a temporary variable r to store the current tp value of the target. you can then use it in any code inside the damage formula, even with an if to give two different formula depending on what value it has or whatever other code you want
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
Code:
r=b.tp;a.gainTP(r);b.gainTP(-r);0
will create a temporary variable r to store the current tp value of the target. you can then use it in any code inside the damage formula, even with an if to give two different formula depending on what value it has or whatever other code you want
So how would this work if I wanted to set it to take only x% but only up to whatever it has?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,888
Reaction score
8,591
First Language
German
Primarily Uses
RMMV
r=0.5*b.tp would be 50% of current TP for example
for comparison you'll need an if structure, but I don't have the correct syntax ready as I haven't done much with javascript.

something like
if r<50 then drain r else drain 50
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,682
Reaction score
15,293
First Language
English
Primarily Uses
RMMV
If you want to take up to 30% of TP, but less if they have less, it would be this:

Code:
r = Math.min(b.tp, 30); a.gainTP(r); b.gainTP(-r); 0
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
mY hAtE fOr ThIs EnGiNe Is ReAl!
Another stupid error!.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,682
Reaction score
15,293
First Language
English
Primarily Uses
RMMV
sorry.

a.gainTp and b.gainTp, not .gainTP
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
490
Reaction score
276
First Language
English
Primarily Uses
RMMZ
OK, it works finally! Sucks that the coding is case sensitive.
 

Latest Threads

Latest Profile Posts

Creating 3D CGs for Cutscenes. :kaosalute:

I keep wanting to post every song I make for the game and have to hold back on that because at this rate, I'll have spoiled all the really good stuff lol..
DerniBorges wrote on TSR's profile.
Is there any way this plugin works with the big character, and the QSprite plugin? Using RTP chars, everything works fine, but the big ones, with QSprite, it's like that in the image, it doesn't reflect right. And there is, in the settings, an option to fix it. Thanks.
bug2.png
Bengawan Solo with fantasy style arrangement. :D
So I just got my computer back (Was posting stuff on my phone) But now my dang monitor's broken! I'll need to get a new one, which means... JOBS! Yaaay... When I get a new monitor, I'll post picture of one of my RPGMMV projects.
Wish me luck... :kaodes:

Forum statistics

Threads
115,898
Messages
1,093,803
Members
151,142
Latest member
mrneptune72
Top