Custom Formula Errors- This should be easy for experienced coders

Hello!!

So,I've been trying to create a custom formula for the basic Attack skill.

I've managed to make the extra parameter I needed for the formula (Weapon Atk) using a script I found on this site.

The formula I want to create is this: (x.stat.str is the custom parameter)

Base= a.xstat.str - b.def

Bonus= a.atk + rand(100) ([(a.level +k a.atk) / 8] + 1)

Damage= Base * Bonus

I have tried various methods to achieve this and still nothing.

I have tried the method mentioned on this thread:

http://forums.rpgmakerweb.com/index.php?/topic/17056-improved-damage-formula-scripting/

No luck...

It's either 0 damage all the time or an error window opens and says unexpected ''('' or '')" and things like that...

I've even tried doing it on one line like this:

"(a.xstat.str - b.def) * (a.atk + rand(100) ([(a.level + a.atk) / 8] + 1))"

Still nothing...!

Could please help me? My knowledge of Maths is extremely limited....)-: (I'm more of a writer/director type of guy)

I'm sure there is a silly error I'm doing here...!!

If you need exact error messages tell me.
a.atk + rand(100) ([(a.level + a.xstat.str) / 8] + 1)

Multiplication needs to be written out explicitly. 2(3+5) is not a valid statement in ruby.
Could you please rewrite it for me?

Or is it impossible?
Ok so,I wrote it like this:

(a.xstat.str - b.def) * (a.atk + rand(100) * ([(a.level + a.atk) / 8] + 1))

No errors but everyone hits 0 again! 🙁

EDIT:

Ok I put a "(" and ")" in place of "[ and "]"

and now  I can deal damage but it's still not how wanted...

this formula is used in Final Fantasy IX.

Here is a comparison using this calculator: 

http://z.purei.org/ffixcalc.php?lv=5&mag=&focus=&blm=Black+Magic&mdef=&emhp=&targets=1&reflect=0&shell=No+Shell&weak=Not+Weak&eatk=No+Elem-Atk+Raise&slv=5&smag=&pspr=&pmhp=&smn=Summon&jewels=&prayer=No+Maiden+Prayer&smdef=&semhp=&anim=Full+Animation&conc=No+Concentrate&sweak=Not+Weak&seatk=No+Elem-Atk+Raise&wlv=5&watk=12&str=25&spr=&spd=&chp=&mhp=&mmp=50&wpn=basic&swd=No+Sword+Skill&estr=10&emag=&pdef=10&pmdef=&row=Front+Row&flying=Target+not+Flying&power=No+Power+Throw&high=No+High+Jump&killer=No+Killer&mpatk=No+MP+Attack&peatk=no&pweak=Not+Weak&protect=No+Protect&pshell=No+Shell&ipsen=Not+Ipsen%27s+Castle&method=get

In my game:

Hero LV5, x.stat.str=12 a.atk = 25     Enemy def= 10   DAMAGE=290-720 (!)

In FFIX

(Same stats)                                     Enemy def= 10  DAMAGE=50-56 (according to calculator)

So why such a difference? It's the same equation....

I found the equation here:

http://www.gamefaqs.com/ps/197338-final-fantasy-ix/faqs/44329

and also here:

http://finalfantasy.wikia.com/wiki/Attack_(Command)

EDIT:

OK It seems I was wrong!!!!

I fixed it now! thanks for the help!

This thread can be closed!
Which formula are you referring to? There are many, none of which look like what you're writing. If your formula is not the same as what you're referring to then I wouldn't know what you're referring to.
It's ok I found it! i had made a mistake (i misread the formula)

everything works fine now,i even made the formula enemy attacks use!

I just have to recalibrate my heroes' stats now.

Thanks for your replies!

Original thread: https://forums.rpgmakerweb.com/threads/custom-formula-errors-this-should-be-easy-for-experienced-coders.22979/