try actor.states().length or actor.allIcons().length
RMMV Damage Formula - ideas and help
RPG Maker MV SupportThank you! 🙂 I'll try that.
My question about turn number also hasn't been answered yet,
My question about turn number also hasn't been answered yet,
Thing is, I can apply the states without damage, but if I do something in the engine seems to bug up and the enemy simply starts skipping its turns instead of having the states affect it. Even with a simple copy-paste of the poison state it'll act like a permanent freeze unless the state applying formula also deals some damage. I've tried this with all scripts turned off, some on and some off and so on. Same result. As long as there's an actual damage part it works fine. Without it it doesn't. The one thing I haven't tried is writing up a formula that returns 0 instead of just writing 0.
And yes, State 32 resists state 33 which in turn resists state 32 and so on. Though it's not really relevant to the problem I ran into that's how I made them not stack rather than adding the state removals directly into the formula box.
Thanks, that works the way I need it to. 😀
Hi, guys. So I'm really new to MV (last version of RPG Maker I used was 2000 when it was new). I'm trying to gain a grasp of the syntax for this equation stuff so I'm trying to start off light/easy.
I want to have an attack that deals damage to both the enemy and myself. I tried the following:
a.atk * 4 - b.def * 2; a.gainHp(-7)
...I think this deals a ton of damage to my hero though because nothing is done to the opponent and the hero just collapses. What I would like to do is use the default equation against the enemy, then do a small amount of damage to the hero. I tried a bunch of other stuff and this is the closest I've gotten to doing that. How would I go about doing this?
(Thanks in advance for any help btw.)
I want to have an attack that deals damage to both the enemy and myself. I tried the following:
a.atk * 4 - b.def * 2; a.gainHp(-7)
...I think this deals a ton of damage to my hero though because nothing is done to the opponent and the hero just collapses. What I would like to do is use the default equation against the enemy, then do a small amount of damage to the hero. I tried a bunch of other stuff and this is the closest I've gotten to doing that. How would I go about doing this?
(Thanks in advance for any help btw.)
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.
2: I think you can make
if((Math.random()>x)) { formula };Wich take a random int between 0 and 1 (in fact, 0.999 but not exactly 1) and apply condition if the random number is more than x.
And yeah, you can mix both, so that ther is a radom chance to buff a stat when attack x)
(Math.random()>0.5)?(a.addBuff(3,4));damages
I'm not sure but i think it don't work because you need to put the damage made to the enemy at the end of the formula, so :
Code:
a.gainHp(-7); a.atk * 4 - b.def * 2
I'm sorry, but is there any particular reason why the "quick damage" button from VX isn't in MV? It seems that a lot of people want it and one solution for all of this confusion I've seen was literally "use it in Ace, then paste in the formula that it gives you", so they cannot be that different from each other. So why isn't the same feature in MV? I find it's exclusion very curious and it overall adds an unnecessary step to do the exact same thing that was a simple button click in VX Ace. Is it planned to be added later or something?
(Replying from phone and without being able to test.)
Hi Trembling Light,
To verify, this ability is targeting the enemy and the damage type is set to HP Damage?
The game seems to want things like isStateAffected or gainHp before the damage calculation.
One thing I would like to try is the following:
c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(-c / 10)); c
What this should do is calculated roughly how much damage you will do in advance, then deal damage to the caster. In this case, 10% of whatever damage you dealt. After the self damage, the formula *should* do c damage.
Thank you!!!! You're the best, seriously. I'm going to spend all evening playing around with the equations now...
Woah! That is a very good solution!! I'm really more of an artist so I'm much newer to all of this code... But, I'm absolutely loving that this is all exposed on attacks. I can't wait to learn as much about it as I can... Sorry for the double post btw lol.
Interesting. I'm not sure if it'll work with the way that I was planning on using it, but I'll see if it will work out. Just in case, I'll just ask if there's a way to get the number of states off of an enemy, since I'm trying to make a skill that works like the Traumatize attack (from Final Fantasy Tactics A2).
I tried everything that I could think off, could it be that
b.idis no longer a thing now? I want to check if the skill hits a certain actor for example. Also, would I use && instead of and?
b.idis no longer a thing now? I want to check if the skill hits a certain actor for example. Also, would I use && instead of and?
Just quoting myself to share that I tried out the solution and after realizing that I was being a dum-dum about the syntax found that it works perfectly. Kudos to Amuseum.
try b._id
Hrmm... I've been trying a basic formula here...
a.addState(15) : a.atk * 4 - b.def * 2
but it doesn't function. It makes the skill do 0 damage and doesn't apply the state. The syntax was taken directly from here, but it still doesn't work.
a.addState(15) : a.atk * 4 - b.def * 2
but it doesn't function. It makes the skill do 0 damage and doesn't apply the state. The syntax was taken directly from here, but it still doesn't work.
Quick question to try another way of doing the skill I'm making for a future project: when using b.isStateAffected() how many state ids can I put in there? Basically I'm asking if b.isStateAffected(4, 5, 6) is a valid example.
var y = b._id === 1 ? 200 : 100; y
I tried it that way, changed nothing. It always returns 100, no matter if the target is actor 2 or not. D:
I think the syntax taken may have been part of a larger formula. Change the : to a ; and that should do the trick.
a.addState(15); a.atk * 4 - b.def * 2
Hi Liak,
To get the turn number, try: $gameTroop.turnCount()
I tried it in an HP Damage attack with the formula:
$gameTroop.turnCount() * 100The damage it dealt was 100, 200, 300, 400, etc. I've only tried this in the Test Battle, so I do not know if this will reset at the end of battle in a real game... yet.
So, let's say we're using skills that use one stat while the normal attack of another weapon uses another stat. (IE bows and dexterity) Is there a way to make the skill use dexterity instead of strength?
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/