If it always do 0, its probable that the formula has an error because the damage formula evaluation code is set to do 0 damage if an error occurs
I hadn't actually figured that out. I changed the else to do 2 dmg, yet the spell still did 0, so it's just an error through and through. Unfortunately I haven't been able to fix it, but I found a neat trick using Yanfly's plug-in for damage over time, and put the damage formula into the state instead of the skill, and that seems to work. Thankfully it was a state set to only last for one round, so it works.
Thank you again for the help 🙂
What about an attack that gets stronger if any other party member is below 50% Hp or dead?
Or an attack that crits if a variable is a certain number?
Okay, so you can use a variable to alter a damage formula, but can you use a formula to change a variable? Also, do a skill's effects occur before or after a formula is executed (so you can use the newly changed variable in say a common event)?
Just found this, thank you so much for sharing, this makes my life as person with Syntax Problems so much easier.
++good
Having some issues getting the if/then in the damage formula to apply state. I want basically the same thing as an earlier post. If (1d20 + a.atk) >= (10 + b.def), apply state to defender.
I tried, and failed, using the following. And a couple variations where I removed some of the () and spaced out the +1.
if (a.atk + (Math.randomint(20)+1)) >= (b.def + 10) {b.addstate(3)} ; else{0} ;
Where state 3 is a stun. Tried it with (3) and (0003) as listed in the database.
That didnt work, just kept rolling 0 damage and not applying the state (had a.atk stat set to 20 and b.def set to 1, so should always apply). Tried both with and without using the semicolons. Any help appreciated.
Edit - is it possible to use note tag instead of damage formula box to accomplish the desired effect?
Hello!
I can do just about anything with MV, but this combat coding has me feeling like my 6 year old trying to understand how algebra works....
I am trying to turn (for fun) a old Grail Quest: Choose Your Own Adventure RPG book into a free to play MV game. I would like the combat in the game to mimic how it worked in the RPG book.
So like this:
1) Roll 2D6 (so generate a random number between 2 to 12)
2) To HIT you opponent you need to roll higher than the weapon ATK value. (So if the ATK is 6, to hit you need to get a number higher than 6.)
3) The DAMAGE done is equal to the DMG value of the weapon plus every point above the ATK value of what your just rolled. (So if the ATK value of the weapon used was a 6, and you rolled an 8, and the weapon has a DMG value of the weapon is 2, then you did 4 points of DMG.)
4) Then deduct the DEFENSE value of any armor worn (if any at all) from the damage, to get the final damage done. (So if 4 DMG was done from the weapon, but the opponent has a DEFENSE value of 1, then only 3 points of total DMG is done!)
So basically:
IF ROLLED RESULT < ATTACK VALUE then MISSED
IF ROLLED RESULT > ATTACK VALVE then ((ROLLED RESULT - ATTACK VALUE) + WEAPON DAMAGE) - DEFENSE VALUE = FINAL DAMAGE DONE
EXAMPLE:
Rolled a 8 ((8 rolled - 6 ATK) + 2 DMG) - 1 DEF = 3 total damage to opponent
I was thinking of just eventing the combat if I couldn't figure out how to make it work through the normal combat system.
I'm having issues with my formula. No matter what I do they always yield me 0 damage.
Example of formula used
((8/16) * (level+a.mat)) * 6
I've used variations of this with and without the brackets as well and still a 0
Sorry I left that out. It's a's level
Yeah, just tried it lol didn't realize I was leaving the "a." Part out haha now it works. Thanks so much
Hi I'm after 2 things one has already been asked but didn't get a reply
Is it possible to change a variable with a damage formula so I can make a skill that gets stronger the more it's used?
Also is it possible to make a formula that does damage to an enemy and inflicts a state on the party aswell? I tried
A. Addstate(poison) ; && a. Atk * 4 - b. Def * 2
Any help would be much appreciated