[RMMV]HELP WITH DAMAGE FORMULAS.

Posts

Pages: 1
Okay, so here's what I'm trying to do.

I'm making a set of variables for each of the four actors in my MV game to allow their skills to scale upwards in terms of damage, preventing old skills from becoming obsolete.

The idea I used for this in rmvxa is below, effectively getting the actor's id and using that in a simple equation to get the variable in question.

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

However, in rmmv, actor id doesn't work. Putting that above equation in the attack skill's damage box results in 0 damage, with both variables being set to 1 and the user's attack being around 30ish, defender's defense 15.

Is there still a way to get the actor's id in a damage calculation? I know the syntax for damage formulas has changed, so any advice on how to do this would be appreciated.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
You need to reference either actorId or enemyId depending on what type of actor is...well, acting. Also, variables in Javascript don't have Ruby's advantage of gracefully ignoring themselves when they're null; in this case, if the variable doesn't have a value, it's actually set to "undefined" which will break the whole formula anyway. You need to do something like this:

a.isActor ? id = a._actorId : id = a._enemyId;a.atk*(((v[48+4*id] > 0 ? v[48+4*id] : 0 + v[50+4*id] > 0 ? v[50+4*id] : 0)*2)+2)-b.def
...it works.

It works!

(Cue long, mentally unstable, hyena laugh)

Thanks a million! I was going crazy trying to figure out where I went wrong!
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Yeah, Javascript has a few little quirks that take some getting used to if you're coming from Ruby. On the plus side, the damage formula box can take a crapton more characters now.
Pages: 1