[RMVX ACE] DAMAGE FORMULA WITH VARIABLES HELP
Posts
Pages:
1
Hello! I am really bad with formulas and am having a little trouble.
Originally, I had an enemy skill that does physical damage to the target, and then stores the damage data as a variable and heals the enemy party that amount. I used:
with variable 48 being the variable that determines how much the enemy party is healed in the follow-up skill. That worked just fine!
However, there is a status effect that makes you absorb physical damage. If the skill hits a character with that status effect, the hero will be healed, as they should, but then the follow-up enemy skill will still heal the enemy party. I wanted to reduce the enemy healing to 0 if the target has the physical-absorb state on.
So I tried:
Which just gives errors ^^;; I'm not all that surprised; all of my formula knowledge is just from aping other formulas. I have no idea how to correctly make one from scratch.
I know this is kinda complicated, (please ask if I haven't explained it well) but if anyone could help, I'd be extremely grateful! Thanks very much!
Originally, I had an enemy skill that does physical damage to the target, and then stores the damage data as a variable and heals the enemy party that amount. I used:
v[48] = 7 * a.atk ** 2 / (a.atk + b.def)
with variable 48 being the variable that determines how much the enemy party is healed in the follow-up skill. That worked just fine!
However, there is a status effect that makes you absorb physical damage. If the skill hits a character with that status effect, the hero will be healed, as they should, but then the follow-up enemy skill will still heal the enemy party. I wanted to reduce the enemy healing to 0 if the target has the physical-absorb state on.
So I tried:
if b.state == 11; 7 * a.atk ** 2 / (a.atk + b.def) v[48] = 0; else; v[48] = 7 * a.atk ** 2 / (a.atk + b.def); end;
Which just gives errors ^^;; I'm not all that surprised; all of my formula knowledge is just from aping other formulas. I have no idea how to correctly make one from scratch.
I know this is kinda complicated, (please ask if I haven't explained it well) but if anyone could help, I'd be extremely grateful! Thanks very much!
In this case, it helps me to take an expression like that apart into a more readable format. Which means...
...this would end up looking something like...
...that? So, I'm kinda thinking that the effect you want is actually...
...this, maybe? I'm assuming that the "b.state == 11" condition is the thing that's checking to see if the "physical absorb" state is applied.
Note: The formula for this would end up looking like...
...this, I think? Sorry, I'm not 100% at the moment.
if b.state == 11; 7 * a.atk ** 2 / (a.atk + b.def) v[48] = 0; else; v[48] = 7 * a.atk ** 2 / (a.atk + b.def); end;
...this would end up looking something like...
if b.state == 11 7 * a.atk ** 2 / (a.atk + b.def) v[48] = 0 else v[48] = 7 * a.atk ** 2 / (a.atk + b.def) end
...that? So, I'm kinda thinking that the effect you want is actually...
if b.state == 11 v[48] = 0 else v[48] = 7 * a.atk ** 2 / (a.atk + b.def) end
...this, maybe? I'm assuming that the "b.state == 11" condition is the thing that's checking to see if the "physical absorb" state is applied.
Note: The formula for this would end up looking like...
if b.state == 11; v[48] = 0; else; v[48] = 7 * a.atk ** 2 / (a.atk + b.def); end
...this, I think? Sorry, I'm not 100% at the moment.
But I still want the skill to deal the 7 * a.atk ** 2 / (a.atk + b.def) damage, regardless of what the variable ends up being. Will it still do that?
@marrend> It's b.state?(11)
@unity> You could put the 7 * a.atk ** 2 / (a.atk + b.def) part outside the if-else bloc to make sure.
like so:
or a shorter one:
@unity> You could put the 7 * a.atk ** 2 / (a.atk + b.def) part outside the if-else bloc to make sure.
like so:
if b.state?(11) v[48] = 0 else v[48] = 7 * a.atk ** 2 / (a.atk + b.def) end 7 * a.atk ** 2 / (a.atk + b.def)
or a shorter one:
v[48] = b.state?(11) ? 0 : 7 * a.atk ** 2 / (a.atk + b.def); 7 * a.atk ** 2 / (a.atk + b.def)
Pages:
1
















