RMMV Damage Formula - ideas and help

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
hey! found a site with what I think is EVERY known thing we can use to make formulas... question is am I allowed to link another rpg maker site? 


Feel free. As long as it helps everyone else and harms no one. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Alright cool! here's the link everyone... https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/


This has examples and I'm pretty sure it list most, if not all, the things we can plugin into a formula. 


Yes, thank you! There are actually more to these, depending on the plugin you use. Some programmer actually tell you, and you can check with them. Yanfly, for example, usually list down towards the end of the plugin help file. One example is row size from Row Formation plug in.


Thanks again for sharing! I hope others find it useful too. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif


- Riff
 
Joined
Oct 29, 2014
Messages
156
Reaction score
4
First Language
English
Can I make a skill that only harms the user if it fails, like Invigorate from Bravely Default?
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
Hello again to all of you :D


I need a little help here


b.isStateAffected(18) ? ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.gainMp(-1 * b.mmp) : ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3


First and foremost the skill does more damage the less Mp the enemy has, that is easy and already taken care of, however I need  a little help, if the enemy is affected in this case by state 18 the enemy should also lose all of their Mp, it isn't working however and it returns a aneourmous 0, does anyone know why?


thank you all for your help.in advance
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Hello again to all of you :D


I need a little help here



b.isStateAffected(18) ? ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.gainMp(-1 * b.mmp) : ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3


First and foremost the skill does more damage the less Mp the enemy has, that is easy and already taken care of, however I need  a little help, if the enemy is affected in this case by state 18 the enemy should also lose all of their Mp, it isn't working however and it returns a aneourmous 0, does anyone know why?


thank you all for your help.in advance


Hello! You can try this:


c = ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.isStateAffected(18) ? b.gainMp(-1 * b.mmp); c : c


- Riff
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
190
Reaction score
50
First Language
Spanish
Primarily Uses
Hello! You can try this:


c = ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.isStateAffected(18) ? b.gainMp(-1 * b.mmp); c : c


- Riff


I don't get it sometimes works, sometimes it does reduces the foe Mp to 0, sometimes it doesn't, also it still doesn't do any damage... it returns only 0
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
I don't get it sometimes works, sometimes it does reduces the foe Mp to 0, sometimes it doesn't, also it still doesn't do any damage... it returns only 0


That is definitely odd. I dont see the problem with the formula. I hope someone will come by and take a look. >.<
 

Fermmoylle

Invalid command or file name.
Veteran
Joined
Mar 10, 2016
Messages
40
Reaction score
10
First Language
Portuguese
Primarily Uses
I have a problem and the answer is one of three:


- I don't know how to calculate a log correctly; or


- RMMV doesn't know how to do it; or


- I'm inputing the formula wrong (this is probably the case).


This is the damage formula for a regular attack (20% variance):


Math.log(a.atk * 2, b.def + 1) * 10


So, I run the test battle...


Hero Attack is 11 (this includes equipment), Defense is 13 (including equipment); Enemy Attack is 13; Defense is 9.


If I'm not mistaken, the Hero should cause around 13.4 points of damage (10.7 to 16.1)... and the engine shows 28 or 29...


Where's the error here? And how to correct this?
 

Slimelord

Lendir Raja
Member
Joined
Mar 18, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
How would I input these in RMMV?


An attack that drains the user's Max HP with each use.
$game_actors[a.id].add_param(0,-25);(a.level+a.mp)/5*(a.mat/3)


An ability that makes a call to a common event to pull various bits of information based on the target.


v[1]=b.name;v[2]=b.hp;v[3]=b.mhp;v[4]=b.mp;v[5]=b.mmp;v[6]=b.enemy_id;0


And an ability that stores the Id of the user to use in conjunction with a common event to perform various effects depending on who used the ability.


v[7]=a.id;1+((v[9]-v[10]/2)(50+a.mat*3-b.mdf*2))
 

Slimelord

Lendir Raja
Member
Joined
Mar 18, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
I have a problem and the answer is one of three:


- I don't know how to calculate a log correctly; or


- RMMV doesn't know how to do it; or


- I'm inputing the formula wrong (this is probably the case).


This is the damage formula for a regular attack (20% variance):



Math.log(a.atk * 2, b.def + 1) * 10


So, I run the test battle...


Hero Attack is 11 (this includes equipment), Defense is 13 (including equipment); Enemy Attack is 13; Defense is 9.


If I'm not mistaken, the Hero should cause around 13.4 points of damage (10.7 to 16.1)... and the engine shows 28 or 29...


Where's the error here? And how to correct this?
Try this and see if it changes anything for you.

Code:
Math.log10(a.atk * 2, b.def + 1) * 10
 

Fermmoylle

Invalid command or file name.
Veteran
Joined
Mar 10, 2016
Messages
40
Reaction score
10
First Language
Portuguese
Primarily Uses
Try this and see if it changes anything for you.



Math.log10(a.atk * 2, b.def + 1) * 10
I've found another way, using natural log and a few other aditions. Thanks for your help anyway. :)
 

MagicMagor

Veteran
Veteran
Joined
Apr 7, 2012
Messages
201
Reaction score
38
First Language
German
Ok i've been experimenting a bit with the damage formula and i have no idea why it isn't working.


What i want to get for my game is be able to define some additional parameters for my actors and enemies, to be used in damage calculation etc..


So i've read in the help file, that specific notetags are automaticly read into a meta-field. To test this out i've given the first actor the following notetag:


<foo:bar>


According to the help file


actor.meta.foo === 'bar'


should be true.


And so i adaptet the damage formula for the attack skill:


var c =0; if(a.meta.foo === 'bar') {c=200;} a.atk * 4 - b.def * 2 + c;


The idea is, actor1 should hit harder, everybody else should hit like normal. But in fact everybody does 0 damage or misses. So i guess there is some kind of error in the formula, but i don't see it.
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Ok i've been experimenting a bit with the damage formula and i have no idea why it isn't working.


What i want to get for my game is be able to define some additional parameters for my actors and enemies, to be used in damage calculation etc..


So i've read in the help file, that specific notetags are automaticly read into a meta-field. To test this out i've given the first actor the following notetag:



<foo:bar>


According to the help file



actor.meta.foo === 'bar'


should be true.


And so i adaptet the damage formula for the attack skill:



var c =0; if(a.meta.foo === 'bar') {c=200;} a.atk * 4 - b.def * 2 + c;


The idea is, actor1 should hit harder, everybody else should hit like normal. But in fact everybody does 0 damage or misses. So i guess there is some kind of error in the formula, but i don't see it.


That's interesting. Have you tried putting a space aftee the if? Like:

Code:
var c = 0; if (a.meta.foo === 'bar') {c = 200;} a.atk * 4 - b.def * 2 + c;
 

Jeysonmcfly

Just a random Joe Schmoe
Veteran
Joined
Jan 17, 2014
Messages
54
Reaction score
15
First Language
English
Primarily Uses
Yes, hello. I have a question about how MV calculates critical hits. Is there a way to determine when a critical hit is struck? (for my own nefarious purposes).
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Yes, hello. I have a question about how MV calculates critical hits. Is there a way to determine when a critical hit is struck? (for my own nefarious purposes).


By default, it's simple - Attacker's Critical Rate - Defender's Critical Evasion.


There are few other plugins out there that adjust this.
 

Jeysonmcfly

Just a random Joe Schmoe
Veteran
Joined
Jan 17, 2014
Messages
54
Reaction score
15
First Language
English
Primarily Uses
By default, it's simple - Attacker's Critical Rate - Defender's Critical Evasion.


There are few other plugins out there that adjust this.
Right, I get that, but is there a way to determine exactly when the critical hit happens? like.. result.critical() or something like that....? People in Yanfly's plugin thread don't know the answer I guess, and no one's answered for at least 24 hours in the Action Battler Plugin thread about this... is it not possible?
 

MagicMagor

Veteran
Veteran
Joined
Apr 7, 2012
Messages
201
Reaction score
38
First Language
German
That's interesting. Have you tried putting a space aftee the if? Like:


Just tried that, without success. With console.log i managed to see that everything before the if gets executed correctly, but neither the if-case nor the stuff afterwards are executed.


Edit: Ok after a bit of tinkering i found the reason. JS throws a TypeError because meta is undefined, even in case of the first actor. So it seems i either wrote that notetag wrong or there is something else to be done before that data is written into the meta-field.
 
Last edited by a moderator:

Jeysonmcfly

Just a random Joe Schmoe
Veteran
Joined
Jan 17, 2014
Messages
54
Reaction score
15
First Language
English
Primarily Uses
Guess I will take this problem I'm having to the plugin suggestion thread, since it doesn't seem that anyone knows how to determine when a critical attack will be precisely dealt.
 
Last edited by a moderator:

carpg123

Veteran
Veteran
Joined
Mar 17, 2016
Messages
32
Reaction score
0
First Language
English
Primarily Uses
Hello, I just started learning battle formulas and I have a question about self buffing after an attack. I am using this https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/ to figure out the commands.


I have a skill that hits the enemy and then applies an attack buff to the user for 3 turns, would something like this work using parameter IDs:


a.addBuff(2, 3); 100 + a.atk - b.def


or would this work, since I don't want to buff the user before the damage:


100 + a.atk - b.def; a.addBuff(2, 3)


Thank you.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,358
Members
137,803
Latest member
andrewcole
Top