Damage formula not working for enemies

SiliconCat

Warper
Member
Joined
May 15, 2019
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
This is the basic damage formula for a single attack (slash), the player can use it but enemies seem to always deal no damage.

(((((((2 * a.level ) + 1) / 3) + 2) * (20) * ( a.atk / b.def )) / (2)) + 2)

I know something is wrong with the formula and not anything else because setting it to an integer works fine. I know rpg maker can be finicky with the formatting of formulas, but I think everything is correct here. Attached are more details of the move.
 

Attachments

Rabbitheart

Villager
Member
Joined
Feb 5, 2018
Messages
11
Reaction score
6
First Language
Finnish
Primarily Uses
RMMV
Could it be that a.level? Enemies don't have levels, unless you have some kind of plugin.
 

SiliconCat

Warper
Member
Joined
May 15, 2019
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
so i can't use level as a damage variable without plugins? that seems odd.
 

Soulrender

Veteran
Veteran
Joined
Jan 12, 2019
Messages
359
Reaction score
216
First Language
Poland
Primarily Uses
RMMV
edit!

Oh! I just Read that enemy deals no damage, then YES! (a.level) wont work if enemy has skill with that method in skill formula because by default MV has no param "level" for enemies. To fix it install Yanfly's Enemy Levels plugin.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,385
Reaction score
866
First Language
EN
Primarily Uses
RMMV
You could replace a.level for users that don't have one, but you'd need to know what value you want to replace it with, e.g.
Code:
2 + ( ((2 * (a.level || 1) + 1) / 3 + 2) * 20 * a.atk / b.def ) / 2
I think this'll use 1 instead of a.level in cases that the skill user has no level value. :)

Otherwise, as mentioned, there are plenty of plugins out there to give enemies levels, e.g. Himeworks Enemy Levels:
http://himeworks.com/2015/11/enemy-levels-mv/
 

TWings

The Dragon Whisperer
Veteran
Joined
Jul 26, 2017
Messages
375
Reaction score
637
First Language
French
Primarily Uses
RMMV
You could replace a.level for users that don't have one
Exactly that. Depending on what you're looking for, you might not need any plugin.
I'm using levels in my damage formulas, for enemies I'm using a Level variable that I initialize in troop events instead of a.level.
 

SiliconCat

Warper
Member
Joined
May 15, 2019
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
thanks guys! i didn't know there was a function to give a value to nulls.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How do I hypnotize myself?
I never realized how much fun destroying scenery by ramming it would be, or how much I keep think "I'm the Juggernaut!" when I do. :LZSexcite:
finally i have some free time
Well, the Danganronpa games are the biggest disappointment I've had playing mystery games. I've never had so much BS shoveled down my throat. They're an insult to intelligence.
OMG! There's a rat themed Steam profile wallpaper for 5k lunar tokens. I want it so badly!

Forum statistics

Threads
93,575
Messages
913,607
Members
123,107
Latest member
jpurdy3
Top