Okay, complex problem! Maybe. Syntax error in skill formula.

● ARCHIVED · READ-ONLY
Started by kogunenjou 4 posts View original ↗
  1. Hi, RPG Maker community. Again. For the second time in less than a week. n_n' /

    The move's description is as follows:

    The user inflicts damage on himself in order to deal
    massive Dark damage to the enemy.


    The move's formula is as follows:

    c=(a.atk*6 + a.mat*6) - b.def * 3; a.hp-=(a.hp*0.25).to_i;c.

    I hope it's not something embarrassingly simple like my last thread topic.
  2. That formula is needlessly complex, you can write it easier in the following way:

    Code:
    a.hp -= a.hp*0.25; a.atk * 6 + a.mat * 6 - b.def * 3
    Without seeing the error message I don't know what the original error was, but it might be missing spaces (some spaces are needed for the interpreter to know what goes where).
  3. Is that dot at the end of the line part of your formula?
     

    Sometimes it helps just to erase the formula and rewrite it.
  4. Andar said:
    That formula is needlessly complex, you can write it easier in the following way:

    a.hp -= a.hp*0.25; a.atk * 6 + a.mat * 6 - b.def * 3Without seeing the error message I don't know what the original error was, but it might be missing spaces (some spaces are needed for the interpreter to know what goes where).
    Thank you, that fixed it. I'm not very familiar with the syntax that the formula box uses.

    Another Fen said:
    Is that dot at the end of the line part of your formula?

    Sometimes it helps just to erase the formula and rewrite it.
    It is, yes. I use variations of this formula for other skills, but this was the only one giving me a syntax error.