How would I check if a state has been removed within the scope of the current action?
RMMV Damage Formula - ideas and help
● ARCHIVED · READ-ONLY
-
-
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) -
You can check if the state is still on the user and add the '!' To invert the condition.How would I check if a state has been removed within the scope of the current action?
Try changing 'level' to 'a.level' for user. Also, enemies by default dont have levels, so you will need a plug-in for that.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) -
... 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. :)... 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 -
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 isOkay, 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?
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. -
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). -
This seems similar to something I am trying to accomplish using the formula but I don't quite understand it.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.
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: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.
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?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.
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.Could this formula work?
MaxHP = (buff_level * 0.25) + a.mat -
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'm not sure, but you can try using Yanfly's BuffStateCore and adjust the parameter there for the buff formula.
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. -
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? -
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. -
DELETED?
Got it working with Common Events in RMVX Ace. Just gonna stick with that for now. -
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. -
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 -
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. -
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? -
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