RMMV Damage Formula - ideas and help

moldy

Veteran
Veteran
Joined
Nov 15, 2015
Messages
193
Reaction score
29
First Language
English
Primarily Uses
How would I check if a state has been removed within the scope of the current action?
 

ShadowfireOmega

Finally found out how to change this!
Veteran
Joined
Jan 1, 2016
Messages
39
Reaction score
3
First Language
English
Primarily Uses
N/A
I was trying out this formula, but keep getting 0's returned, any idea what I did wrong?

a.atk * ((level - 1) * .05) + ((Math.randomint(9) + 1) * (luk * .1)) - b.def * ((level - 1) * .05) + ((Math.randomint(9) + 1) * (luk * .1))The idea was that every level above 1 gets an additional 5% to their stats (level - 1 * .05) and they gain anywhere from 10-100% of their luck randomly (math.radomint(9) + 1) * (luk * .1))

I was testing with atk values well over double defense values and very minimal luck.

Edit: ... just noticed that if the level is 1, i multiplied attack/defense by 0 ... might be the problem, trying to figure it out now.

Edit: Nope, getting rid of the -1 did not help... , but noticed instead of adding 5%, I'm only USING 5%... trying it out now...

Edit: again, a big no,  new formula (below) still not working.

Code:
a.atk + (a.atk * ((level - 1) * .05)) + (Math.randomint(9) + 1) * (luk * .1) - b.def + (b.def * ((level - 1) * .05)) + (Math.randomint(9) + 1) * (luk * .1)
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
How would I check if a state has been removed within the scope of the current action?
You can check if the state is still on the user and add the '!' To invert the condition.

I was trying out this formula, but keep getting 0's returned, any idea what I did wrong?

a.atk * ((level - 1) * .05) + ((Math.randomint(9) + 1) * (luk * .1)) - b.def * ((level - 1) * .05) + ((Math.randomint(9) + 1) * (luk * .1))The idea was that every level above 1 gets an additional 5% to their stats (level - 1 * .05) and they gain anywhere from 10-100% of their luck randomly (math.radomint(9) + 1) * (luk * .1))I was testing with atk values well over double defense values and very minimal luck.

Edit: ... just noticed that if the level is 1, i multiplied attack/defense by 0 ... might be the problem, trying to figure it out now.

Edit: Nope, getting rid of the -1 did not help... , but noticed instead of adding 5%, I'm only USING 5%... trying it out now...

Edit: again, a big no, new formula (below) still not working.

a.atk + (a.atk * ((level - 1) * .05)) + (Math.randomint(9) + 1) * (luk * .1) - b.def + (b.def * ((level - 1) * .05)) + (Math.randomint(9) + 1) * (luk * .1)
Try changing 'level' to 'a.level' for user. Also, enemies by default dont have levels, so you will need a plug-in for that.
 

ShadowfireOmega

Finally found out how to change this!
Veteran
Joined
Jan 1, 2016
Messages
39
Reaction score
3
First Language
English
Primarily Uses
N/A
... I also found out that Math.randomint needs to be Math.randomInt, caps have always caused me problems xD. Thanks, I'll try this out!

Edit: and I don't need a plugin, when creating enemies I'll just add in the extra defense depending on what level I want them to be xD

(a.atk + (a.atk * ((a.level - 1) * .05)) + ((Math.randomInt(9) +1 ) * (a.luk * .1))) - (b.def + (b.def + ((Math.randomInt(9) + 1) * (b.luk * .1))))Gives me the following error


but only when the enemy attacks, not when the character does...

EDIT:I am an idiot... you said they don't have a level, so when it attacks it tries to use it's level, so I have to make a separate attack for opponents, except confusion will be out of the question, and I don't want that... I either need to ditch the idea of adding the 5% per level altogether or get a plugin after all xD so much for my clever idea
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
... I also found out that Math.randomint needs to be Math.randomInt, caps have always caused me problems xD. Thanks, I'll try this out!

Edit: and I don't need a plugin, when creating enemies I'll just add in the extra defense depending on what level I want them to be xD

(a.atk + (a.atk * ((a.level - 1) * .05)) + ((Math.randomInt(9) +1 ) * (a.luk * .1))) - (b.def + (b.def + ((Math.randomInt(9) + 1) * (b.luk * .1))))Gives me the following error
but only when the enemy attacks, not when the character does...

EDIT:I am an idiot... you said they don't have a level, so when it attacks it tries to use it's level, so I have to make a separate attack for opponents, except confusion will be out of the question, and I don't want that... I either need to ditch the idea of adding the 5% per level altogether or get a plugin after all xD so much for my clever idea
Yeah. It would be easier that way. :)
 

Crazy Rob

Villager
Member
Joined
Mar 3, 2015
Messages
23
Reaction score
1
First Language
English
Primarily Uses
Okay, on the note of game actors, here's a formula I used in rmvxa for a basic attack-

(a.atk*(((v[48+4*a.id]+v[50+4*a.id])*2)+2))-b.def

it took two variables, determined by the actor's id, and used those to multiply the actor's attack. So, with actor id being one, the variables used would be 52 and 54. That way I could use one attack skill and call on multiple "Physical damage growth" and "Physical damage bonus" variables.

Anyone have an idea on how to do this in MV?
I finally found the answer thanks to another user, Trihan. For anyone interested in doing the same kind of shenanigans, the new formula I used is

a.isActor ? id = a._actorId : id = a._enemyId;a.atk*(((v[1+4*id] > 0 ? v[1+4*id] : 0 + v[3+4*id] > 0 ? v[3+4*id] : 0)*1)+1)-b.def

That's for a basic attack, with variables 5-20 being used for each of the 4 actor's physical power, magical power, p.bonus, and m.bonus.

So assuming you start off with actor 1 that had 1 P.Power and 1 M.Power, The attack would deal 2xa.atk-b.def, but for actor 2 with 2 P.Bonus as well, it'd deal 4*a.atk-b.def.

Ciao.
 
Last edited by a moderator:

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,435
Reaction score
596
Primarily Uses
Hello, I have a simple question.   I have a skill that does no damage; it merely has a chance of inflicting a state.  This is based on a conditional i put into the damage formula:

(Math.randomInt(a.mat) > Math.randomInt(b.mdf) ? b.addState(3) : a.addState(2)); 0

Everything works fine, the only problem is that when the skill is used, all of the zeroes pop up on all of the targets since it's doing 0 damage.  I don't want these zeroes to show up; it makes it look like the spell was supposed / could have done damage but didn't.   Is there a way to not have the damage number show for just this specific skill, or is there a way to use the damage formula for conditional effects without having to select a type of dmg like "HP Damage" (the box is greyed out otherwise).  
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
1: Buffs / Debuffs: a.addBuff(x, y) / b.addDebuff(x, y)

with x: 0 = mhp,

1 = mmp,

2 = atk,

3 = def,

4 = mat,

5 = mdf,

6 = agi,

7 = luck,

and y = numbers of turn.
This seems similar to something I am trying to accomplish using the formula but I don't quite understand it.

Could someone give me an example of how to write this formula including the actual parameter increase?

Also: would it be possible to include the a.mat into the buff?  Let's say... a.add 2 = atk, 0 + a.mat(0,3)

It would really help me out if I could figure out how to include the user's magic attack into my buff formulas instead of having to do it in a common event.
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
This seems similar to something I am trying to accomplish using the formula but I don't quite understand it.

Could someone give me an example of how to write this formula including the actual parameter increase?

Also: would it be possible to include the a.mat into the buff? Let's say... a.add 2 = atk, 0 + a.mat(0,3)

It would really help me out if I could figure out how to include the user's magic attack into my buff formulas instead of having to do it in a common event.
Buffs increase are based on a formula, and can stack. Example:

MaxHP = (buff_level * 0.25) + 1

Buffs can be positive or negative (debuffs). Hence, whenever you use addBuff(x,y), you're increasing the buff_level once.

If you're looking for more dynamic stats changes (which stacks with the Buffs/Debuffs), just use States.

I hope that answers your question.
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
Buffs increase are based on a formula, and can stack. Example:

MaxHP = (buff_level * 0.25) + 1

Buffs can be positive or negative (debuffs). Hence, whenever you use addBuff(x,y), you're increasing the buff_level once.

If you're looking for more dynamic stats changes (which stacks with the Buffs/Debuffs), just use States.

I hope that answers your question.
Could this formula work?

MaxHP = (buff_level * 0.25) + a.mat
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Could this formula work?

MaxHP = (buff_level * 0.25) + a.mat
I'm not sure, but you can try using Yanfly's BuffStateCore and adjust the parameter there for the buff formula.
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
I'm not sure, but you can try using Yanfly's BuffStateCore and adjust the parameter there for the buff formula.
I've tried everything I can think of and it doesn't seem to allow me to alter the basic buff formula.  It seems to give me the same buff no matter what I type into the formula after I set a buff effect.  And when i don't set a buff affect nothing happens at all.

I looked into Yanfly's BattleStateCore but I had a hard time understanding what it did.

I've been thinking about it and I may have another idea that might assist me before I try delving into that plugin.  Might it be possible to set a variable inside the formula?  For example: something like $gameVariables(1) = a.mat?

That would allow me easy access to the user's magic attack when applying a State at least.  So I could use that process to apply the correct amount in a common event.  Removing the state might prove a little more tricky though.
 
Last edited by a moderator:

krizmn

Occultist
Veteran
Joined
Jun 9, 2015
Messages
117
Reaction score
9
First Language
english
Primarily Uses
a.gainHp(-99);250

Ok take this formula.  When used by a player, the player can die if their hp are too low.  When a monster uses it, the monster does not die.  Is this a bug?  Or do I need to do some sort of check?
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
How do I check if a specific user is a specific actor. I  want to make some skills that change depending on which actor there is, so as stated before how do I check if the person using this skill is a specific actor. Also how do I run a common event in the damage formula?

Thank you for your time.
 
Last edited by a moderator:

otonohitoka

Writer and Composer
Member
Joined
Dec 8, 2015
Messages
25
Reaction score
2
First Language
English
Primarily Uses
DELETED?

Got it working with Common Events in RMVX Ace. Just gonna stick with that for now. 
 
Last edited by a moderator:

Jennestia

Veteran
Veteran
Joined
Nov 7, 2013
Messages
30
Reaction score
7
First Language
Japanese
Primarily Uses
I have a quick question, my RMVX Ace project was converted so I kept a lot of custom formulas, for example:


a.weapons.include?($data_weapons[219]) ? 932 : 780


This skill gets boosted when the gunner is using the Corra MK II Custom (basically their ultimate weapon) otherwise it does usual damage for the skill, in MV terms, would it still work or is the string completely different? I tried looking through the topic but I'm not sure if I overlooked it.
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
I have a quick question, my RMVX Ace project was converted so I kept a lot of custom formulas, for example:


a.weapons.include?($data_weapons[219]) ? 932 : 780


This skill gets boosted when the gunner is using the Corra MK II Custom (basically their ultimate weapon) otherwise it does usual damage for the skill, in MV terms, would it still work or is the string completely different? I tried looking through the topic but I'm not sure if I overlooked it.


No expert here, but using one of Yanfly's Tips & Tricks video as reference, i'm guessing the formula should be:


var w = $dataWeapons[219]; (user.hasWeapon(w)) ? 932 : 780;



- Try your original formula and see if it works.


- If it doesnt, try this one.


- If it still doesnt work, try using (user.hasWeapons(w)) instead.


Hope that helps! :)


- Riff
 
Last edited by a moderator:

Jennestia

Veteran
Veteran
Joined
Nov 7, 2013
Messages
30
Reaction score
7
First Language
Japanese
Primarily Uses
No expeet here, but using one of Yanfly's Tips & Tricks video as reference, i'm guessing the formula should be:



var w = $dataWeapons[219]; (user.hasWeapon(w)) ? 932 : 780;



- Try your original formula and see if it works.


- If it doesnt, try this one.


- If it still doesnt work, try using (user.hasWeapons(w)) instead.


Hope that help! :)


- Riff


Yes, original one returned 0 damage but this appears to work, just have to touch up the rest of my formula. :) Thank you very much.
 

Redeye

Chronicles Creator
Veteran
Joined
Jun 21, 2013
Messages
441
Reaction score
262
First Language
English
Primarily Uses
I'm trying to create a skill in MV where the skill deals 9,999,999 damage if and only if the target is weak to Element #13. Otherwise, the skill deals moderate (or 0) damage.


Right now I'm trying to use this formula, but whenever I use it, no matter who I use it on, it always deals 0 damage. Even on those weak to Element #13.


if b.element_rate(13) > 1.000; 9999999; else; 0; end


Help?
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
I'm trying to create a skill in MV where the skill deals 9,999,999 damage if and only if the target is weak to Element #13. Otherwise, the skill deals moderate (or 0) damage.


Right now I'm trying to use this formula, but whenever I use it, no matter who I use it on, it always deals 0 damage. Even on those weak to Element #13.


if b.element_rate(13) > 1.000; 9999999; else; 0; end


Help?


Try this instead:


(b.elementRate(13) > 1.0) ? 9999999 : 0;




- Riff
 

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