RMMV Damage Formula - ideas and help

brendonx

Veteran
Veteran
Joined
Oct 30, 2015
Messages
85
Reaction score
5
First Language
English
Hey guys and gals,

My formula "v[3] * a.atk + a.atk * 4 - b.def * 2" is working perfectly with the exception being that it won't do damage on the first turn.

I can't figure out why. Can anyone help?

For the record, it's a charge up style attack that increases in strength each time a player uses a certain skill in the battle. Using the skill with this formula unleashes the damage and as a effect, triggers another common event that clears the charged up variable.

Thanks.
 

gotnovicks

Veteran
Veteran
Joined
Feb 15, 2015
Messages
76
Reaction score
9
First Language
Portuguese
Primarily Uses
N/A
how do I check if the attack was critcal? i want to make a skill that heals then user only if it lands a critcal attack.also, can some one tell ehat's wronge in this formulae?

70 + (70 * Math.min(Math.floor(a.level / 8), 4)) + Math.floor(a.mgk * 0.35)basically, it rises the fixed damage (70) by 70 every 8 levels, in a cap of 70 * 4 plus 35% of users magicka (custom stat I made - and the problem is not in it, 'cause I use it in a simple formulae and it works).
 
Last edited by a moderator:

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
126
Reaction score
103
First Language
English
how do I check if the attack was critcal? i want to make a skill that heals then user only if it lands a critcal attack.also, can some one tell ehat's wronge in this formulae?

70 + (70 * Math.min(Math.floor(a.level / 8), 4)) + Math.floor(a.mgk * 0.35)basically, it rises the fixed damage (70) by 70 every 8 levels, in a cap of 70 * 4 plus 35% of users magicka (custom stat I made - and the problem is not in it, 'cause I use it in a simple formulae and it works).
To answer your critical effect question:


With that in mind, you could do something like: 

if (b.result().critical) {a.addState(x); y} else {y}
So basically a formula of:

if (b.result().critical) {a.gainHp(x); y} else {y}

Should work. It means if the target  is hit by a critical attack (result().critical) then user (a) gains x amount of hp, then apply damage of y; otherwise just apply damage of y. y should be your damage formula.

 
 
Last edited by a moderator:

GammaVD

Veteran
Veteran
Joined
Oct 29, 2015
Messages
70
Reaction score
3
First Language
English
I'm trying to do an attack that hits 5 times, each successful hit increase the damage by a multiple of 20 so I have the variable x as

x = 20 + 20 * num_Hits

Where 'num_Hits' would be each successful hit, if the move misses once it should reset back to 'num_Hits = 0', however I'm not sure (a.) how to catch if a hit is successful (b.) how to store it considering the damage formula resets all local variables each time it is called and (c.) how to reset it back to zero after the action completes
 
Last edited by a moderator:

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
262
Reaction score
155
First Language
English
Primarily Uses
RMMV
Just in case anyone is wondering how to use a specific actor's attributes in a damage formula:

Code:
$gameActors.actor(3).agi
 

Myst Desdemona

The Snark Knight
Veteran
Joined
Nov 18, 2015
Messages
72
Reaction score
15
First Language
English/Swedish
I was wondering if anyone can help me with this formula

y = b._actorId === 2 ? 200 && b.gainMp(20) : 100; yI'm using it for an item. If it's actor two, I want it to heal 200 and give mana as well. Although as it stands now, it only gives the mana and zero hp.

If I remove the b.gainMp(20) it works well so I'm guessing I shouldn't write &&.

Thanks in advance.
 

Kai Monkey

Veteran
Veteran
Joined
Apr 3, 2012
Messages
166
Reaction score
119
First Language
RGSS3
Primarily Uses
I was wondering if anyone can help me with this formula

y = b._actorId === 2 ? 200 && b.gainMp(20) : 100; yI'm using it for an item. If it's actor two, I want it to heal 200 and give mana as well. Although as it stands now, it only gives the mana and zero hp.

If I remove the b.gainMp(20) it works well so I'm guessing I shouldn't write &&.

Thanks in advance.
I can't test it in game, but I am 99% sure you just need

b._actorId === 2 ? (b.gainMp(20),200) : 100I tested that in my JS console, and it runs the commands if the condition returns true, and then returns the correct "damage"
 
Last edited by a moderator:

Myst Desdemona

The Snark Knight
Veteran
Joined
Nov 18, 2015
Messages
72
Reaction score
15
First Language
English/Swedish
@Kai monkey. It worked like a charm. Thank you :)
 

BloodletterQ

Chaotic Neutral Assassin
Veteran
Joined
Aug 15, 2012
Messages
1,535
Reaction score
1,178
First Language
English
Primarily Uses
N/A
I wonder if it's possible to do a Final Fantasy I-III/Bravely Default style of attacking where you can attack multiple times depending on a stat and the number of attacks is reduced going by an enemy's stat. I changed M.DEF to Dexterity so for every 5 points of dexterity over the foe's agility, another hit is added.
 

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
So has anyone gotten nested if statements to work correctly?

i want to put this into the proper syntax for it to work as a damage forumula

<damage formula>if (b.hp>b.mhp*0.5){value= b.add_state(83)}else if (b.hp<=b.mhp*0.5&&b.hp>=b.mhp*0.25){ value = a.atk*3.5 }else{value=a.atk*7 } </damage formula>its a spell that buffs you if you have over half hp otherwise heals you if you have between 25% and 50% hp and heals you for even more should you be at less than 25% hp

nvm i got it

Code:
<damage formula>if (target.hp>target.mhp*0.5){b.addState(83); 0}else if (target.hp<=target.mhp*0.5&&target.hp>=target.mhp*0.25){ value = user.atk*3.5;}else{value = user.atk*7;}</damage formula>
 
Last edited by a moderator:

Column

Veteran
Veteran
Joined
Dec 11, 2015
Messages
80
Reaction score
20
First Language
Engrish
Let me get some critique on this idea please, because it's the one I'm planning on using for my game. I'm using a shadow hearts-esque system for my attacks (sand the judgement ring, sorry ring spirit) where each characters "default" attack hit multiple times, ranging from 2 to 4 times. Anyways, here's the formula of which is speak.

A.atk * .50 - b.def * .25 (4 hits) for melee characters

A.atk * .66 - b.def * .33 (3 hits) for balanced characters

A.atk * - b.def * .5 (2 hits) for less physical characters

But then have the actual attack hit 4, 3 or 2 times, so it'd basically be a.atk * 2 - b.def but broken up into multiple pieces. So a character with 50 strength attack an enemy with 30 defense would do 40ish damage, divide into four hits. Yea? How terrible of an idea is this?
 

Nuhada

Villager
Member
Joined
Oct 26, 2015
Messages
27
Reaction score
14
First Language
French
Let me get some critique on this idea please, because it's the one I'm planning on using for my game. I'm using a shadow hearts-esque system for my attacks (sand the judgement ring, sorry ring spirit) where each characters "default" attack hit multiple times, ranging from 2 to 4 times. Anyways, here's the formula of which is speak.

A.atk * .50 - b.def * .25 (4 hits) for melee characters

A.atk * .66 - b.def * .33 (3 hits) for balanced characters

A.atk * - b.def * .5 (2 hits) for less physical characters

But then have the actual attack hit 4, 3 or 2 times, so it'd basically be a.atk * 2 - b.def but broken up into multiple pieces. So a character with 50 strength attack an enemy with 30 defense would do 40ish damage, divide into four hits. Yea? How terrible of an idea is this?
In theory it's a good idea but you can't change the number of hits via the damage foruma box. Because the damage formula box is the damages that each of the hits make.

Maybe you can trick this with a forced action in the damage formula box, but i don't know how it works for that.
 

Column

Veteran
Veteran
Joined
Dec 11, 2015
Messages
80
Reaction score
20
First Language
Engrish
Hm. True. Dang. I believe Yanfly had a script for vx ace that allowed you to edit all the battle screen commands, meaning you could change or even remove "attack".. I used that to make all my characers default "attacks" actually different skills, implementing the above formula. I guess I wasn't thinking that I don't have the capacity to do that yet. Dang. Guess I'll just poke around until something like that comes out for MV. Poo.

I love these kinds of threads. One of my favorite things to do when I start playing a new rpg is to look up how all the formulas work. It started back when I played ff12 I think. Ever since then, I love going through the numbers, learning exactly how things work.
 

Nuhada

Villager
Member
Joined
Oct 26, 2015
Messages
27
Reaction score
14
First Language
French
Hm. True. Dang. I believe Yanfly had a script for vx ace that allowed you to edit all the battle screen commands, meaning you could change or even remove "attack".. I used that to make all my characers default "attacks" actually different skills, implementing the above formula. I guess I wasn't thinking that I don't have the capacity to do that yet. Dang. Guess I'll just poke around until something like that comes out for MV. Poo.

I love these kinds of threads. One of my favorite things to do when I start playing a new rpg is to look up how all the formulas work. It started back when I played ff12 I think. Ever since then, I love going through the numbers, learning exactly how things work.
There is already some plugins for that, you should check it out :)

http://himeworks.com/2015/12/actor-battle-commands/

http://himeworks.com/2015/12/battle-command-use-skill/
 

Column

Veteran
Veteran
Joined
Dec 11, 2015
Messages
80
Reaction score
20
First Language
Engrish
I think those are exactly what I'm looking for! Thanks Nuhada! (And thank you Hime Works as well!)
 

Codeless

Villager
Member
Joined
Oct 26, 2015
Messages
6
Reaction score
0
First Language
Español
Primarily Uses
RMMV
Hello there! I have a problem :/
This...


When i change the "1000%" for any number under 100% make the Maker Crash :/
Anybody knows how to fix it?

PD: Sorry for my bad english >_>
PD2: Sorry if is not here where i should put this :c
 
Last edited by a moderator:

a6p

Veteran
Veteran
Joined
Nov 1, 2015
Messages
30
Reaction score
8
First Language
English
How would I use the formula to make a skill that increases in power for each successful strike? I tried a formula like this:

a.isStateAffected(15) ? x = a.atk * 7 - b.def * 2: a.isStateAffected(14) ? x = a.addState(15), a.atk * 5 - b.def * 1.75: a.isStateAffected(13) ? x = a.addState(14), a.atk * 3 - b.def * 1.5: x = a.atk * 2 - b.def * 1.25 ; x * (1 + (a.level - b.level)/25)

but this doesn't work.
 
Last edited by a moderator:

Smelipanda

Veteran
Veteran
Joined
Oct 25, 2015
Messages
40
Reaction score
37
First Language
English
How would I use the formula to make a skill that increases in power for each successful strike? I tried a formula like this:

a.isStateAffected(15) ? x = a.atk * 7 - b.def * 2: a.isStateAffected(14) ? x = a.addState(15), a.atk * 5 - b.def * 1.75: a.isStateAffected(13) ? x = a.addState(14), a.atk * 3 - b.def * 1.5: x = a.atk * 2 - b.def * 1.25 ; x * (1 + (a.level - b.level)/25)

but this doesn't work.
It sounds like this would be better to use a variable for this skill and less adding states over and over again, which is what i believe you are doing. Someone else will have to way in as I dont know if there is a way to determine in the damage formula to see if an attack was a successful hit or not.
 

a6p

Veteran
Veteran
Joined
Nov 1, 2015
Messages
30
Reaction score
8
First Language
English
It sounds like this would be better to use a variable for this skill and less adding states over and over again, which is what i believe you are doing. Someone else will have to way in as I dont know if there is a way to determine in the damage formula to see if an attack was a successful hit or not.
Good idea, should've thought of that. At least I came up with a new type of skill because of it.

Does anyone know if there's some sort of master list of battle formula commands?
 

brendonx

Veteran
Veteran
Joined
Oct 30, 2015
Messages
85
Reaction score
5
First Language
English
Good idea, should've thought of that. At least I came up with a new type of skill because of it.

Does anyone know if there's some sort of master list of battle formula commands?
I'd also love to know if there is a big list of formula commands!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top