Jump to content


Photo

Damage Formulas 101 (MV Edition)


  • Please log in to reply
29 replies to this topic

#21 manoma

manoma

    Member

  • Ace Member
  • 10 posts

Posted 09 January 2016 - 01:59 PM

 

Well, yes, because it's 

b.actorId()

not,

b.actorId

hmm, ok thanks, i tried this before but i got a error saying it's not a function(that is why i took off the ()), but this time it worked. Seens my game is a little bugged and i got myself confused because of that, sorry. Sometimes i'm getting the error saying the value is null because for some reason the custom execution command is executed when it isn't suposed to. Will need to check my plugins and I'll try to do some conditionals to fix that.

 

as for the damage, yanfly damage control helped me with that, i used value = v[10]; in the global dmg calculation. I just need to see how i'll set it to 0 when it's a miss

 

also, i saw that in another place (and in one of this topic posts), but you can use math. functions in the DMG formula. Could be a nice thing to add to your post (like using it to generate a random number and using "if" later to determine the DMG of the skill)

 

EDIT: Helck FTW o/

EDIT 2: seens that the <Custon Execution> was used before the damage calculation, that is why i was getting the error, but now i managed to do it using a common event. Thanks again.

EDIT 3: seens that it is causing  the actors to do 0 DMG for some reason, only monsters are doing DMG like the formula (even without plugins)

v[10] = b.actorId(); a.atk;

EDIT 4: i solved it using yanfly DMG core, now i can store the last attacked actor ID and DMG dealt. :)


Edited by manoma, 10 January 2016 - 01:56 AM.


#22 Keirebu

Keirebu

    Sentient(?) Dog

  • Ace Member
  • 114 posts
  • LocationUnited Kingdom
  • RM Skill - Writer

Posted 22 January 2016 - 11:03 AM

This is such a well-written tutorial! I genuinely enjoyed reading it, really easy to understand and to the point :D


18.jpg

6.jpg7.jpg

 

 


#23 kagekiri

kagekiri

    Newbie

  • Ace Member
  • 4 posts

Posted 25 January 2016 - 09:14 AM

Hi Glasses, first of all the information here is brilliant and thanks for putting it all together for us!

Now... I'm not the sharpest tool in the box nad I've been trying to make a spell that does damage and applies a state, but only when there's another state already on the target, if not I want it to just do damage.

For imagination sake. The fire spell Burns the target, and hte Ignite spell immolates the target, but only if the target is Burned to begin with.

What I've got so far is

if (b.isStateAffected(11)) b.addState(12); 100; else 100;

 but I can't seem to get it to work how I want it to =/ It just says target takes no damage on a blank dummy monster.

Any help would be greatly appreciated


Edited by kagekiri, 25 January 2016 - 09:47 AM.


#24 Glasses

Glasses

    Mr. Trivel

  • + Premium Members
  • 1,063 posts
  • LocationThe Forest
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 25 January 2016 - 09:50 AM

@kagekiri,

This should work:

if (b.isStateAffected(11)) b.addState(12); 100

Since you want to deal damage regardless of state being on the enemy, else is not required.


sig_diablo3seasonibase.jpgsig_diablo3seasoniiconsyt.jpgsig_diablo3seasoniiconstwitter.jpgsig_diablo3seasoniiconspat.jpg

 e93f2dce6e.png 7e9f1bdb08.png


#25 kagekiri

kagekiri

    Newbie

  • Ace Member
  • 4 posts

Posted 25 January 2016 - 05:02 PM

=O so simple and it works!

Amazing thank you! You're in my credits now ^_~



#26 Lord Vectra

Lord Vectra

    King of Darkness!!!

  • Ace Member
  • 1,029 posts
  • LocationDarker side of Vectra's Darkness
  • RM Skill - Eventer

Posted 06 April 2016 - 08:38 AM

Thank you so much. I've been waiting for something like this when I found out that MV was different from VX Ace.


I am Vectra the King of Darkness!!!!

e660029441.png

66edddcdff.png

D4srgS4.png


#27 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 325 posts
  • LocationLakewood, Washington
  • RM Skill - Jack of All Trades

Posted 04 September 2016 - 09:23 AM

Thanks for this info, it really is useful. 

 

Now for my request  ;)

 

How would one use JUST the weapon Attack parameter in a formula. I hunted and found 'weapons.at(0).params.at(0)' by my attempt to alter the numbers, add a.weapons.at(0).params.at(0) to it and such yielded nada.... help me out, again?

Example: Guns do flat damage, so attacking with a pistol atk=25, I want it to deal 25 (plus variation) damage, not the total of the actors attack value.

Ideally, I would compare this value to the defenders armor defense, so it is only blocked by armor, not all the defense thats been built up....cuz bullets

 

EDIT: Got, used the paramBase to get the base attack, then just subtracted that from the Full Attack, giving me my result....

not pretty but it will work


Edited by SirCumferance, 11 September 2016 - 10:12 AM.


#28 Wickednick

Wickednick

    Newbie

  • Ace Member
  • 2 posts

Posted 10 November 2016 - 09:15 AM

Awesome guide it has helped me with a lot of things, but i wondering how to have multiple formulas and get them to work?

Like lets say I have a skill thats gets more powerful depending upon a variable. So as the variable increases the skills damage, hit rate, and critical become more powerful, as well as any other effects that I might want to add like a staff the increases my mana and boosts my fire resistance to fire depending on my level of a certain variable.

I've been trying various combinations of formulas and while I can get them all to work individually, they wont work when I put them all in the formula box.


Edited by Wickednick, 10 November 2016 - 09:18 AM.


#29 projectbeta

projectbeta

    Newbie

  • Ace Member
  • 3 posts

Posted 10 November 2016 - 11:32 PM

not sure if this is the right place for this question but I hope you can help. I was wanting to modify the damage formula to check armor type ie, cloth 1, leather 2, chain 3, or plate 4 and have a different cap on the armor the user or target could use. I tried to write a plugin for this but was having a hard time finding the part for the damage formula.  I was wondering if I could use like Yanfly's battle engine to use <setup action> code</setup action> to load this defensive code before damage is calculated, or is there a better way about going about this? Once I can figure out this step I can then reverse it and do the user.mdf as well. 

 

if ((hasArmor(etypeID) === 1) && (user.def >= 100))
Math.round((user.def - 100) * .25 + 100);
if ((hasArmor(etypeID) === 2) && (user.def >= 125))
Math.round((user.def - 125) * .5 + 125);
if ((hasArmor(etypeID) ==== 3) && (user.def >= 150))
Math.round((user.def - 150) * .75 + 150);
if ((hasArmor(etypeID) === 4) && (user.def >= 200))
Math.round((user.def - 200) * 1.1 + 200); 


#30 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 325 posts
  • LocationLakewood, Washington
  • RM Skill - Jack of All Trades

Posted 11 November 2016 - 10:25 AM

 

not sure if this is the right place for this question but I hope you can help. I was wanting to modify the damage formula to check armor type ie, cloth 1, leather 2, chain 3, or plate 4 and have a different cap on the armor the user or target could use. I tried to write a plugin for this but was having a hard time finding the part for the damage formula.  I was wondering if I could use like Yanfly's battle engine to use <setup action> code</setup action> to load this defensive code before damage is calculated, or is there a better way about going about this? Once I can figure out this step I can then reverse it and do the user.mdf as well. 

 

if ((hasArmor(etypeID) === 1) && (user.def >= 100))
Math.round((user.def - 100) * .25 + 100);
if ((hasArmor(etypeID) === 2) && (user.def >= 125))
Math.round((user.def - 125) * .5 + 125);
if ((hasArmor(etypeID) ==== 3) && (user.def >= 150))
Math.round((user.def - 150) * .75 + 150);
if ((hasArmor(etypeID) === 4) && (user.def >= 200))
Math.round((user.def - 200) * 1.1 + 200); 

 

I think you may have answered your own question, you could use the ID as a multiplier? I cannot code or anything, so forgive my amateurness. If you are wearing Armor ID 2, multiply it the Defense value by (Armor.ID*.25) or some such, so you only need to really do it the once....

Looking at it, it made more sense in my head, lol






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users