Well that's a way to get around th problem I suppose, but why the problem appears in the first place, I wonder if it's only with State 1 mmm I'll have to test it, anyway thnak you for the advice, BTW i have already test it it works of course things like elemental propieties and the % variance on the skill affect it so well, that's it I'll have to modify some formulasInstead of adding state 1, just make the damage be equal to b.hp so it removes all their HP, which in turn will add the state. See if you still get the errors then.
Did you try it and did it solve the problem? If so, the error probably happened in the first place because you were going about killing the enemy in the wrong way. If the engine is set up to do A, B then C, and you go straight to C, you could be missing out on some important steps, and things couldn't be expected to work correctly.Well that's a way to get around th problem I suppose, but why the problem appears in the first place, I wonder if it's only with State 1 mmm I'll have to test it, anyway thnak you for the advice, BTW i have already test it it works of course things like elemental propieties and the % variance on the skill affect it so well, that's it I'll have to modify some formulas
Thank you very much for the advice
For a base stat without equipment:Hey, guys. I made a thread on this to no avail - is there not a way to find the base stats of the actor? I'm attempting to use the base ATK of a character, as in, their base ATK with nothing equipped, and the ATK bonus of the weapon they're using itself (which I suppose I could use by subtracting the base from the total) inside a damage formula, which looks like so:
(ATK - b.def) * (1 + STR * (a.level+STR)/256)
ATK = equipped weapon's attack bonus
STR = user's base attack
I saw in the thread somewhere that it's no longer possible to do, although Ace had a method for it..is there no MV equivalent?
Instead of adding state 1, just make the damage be equal to b.hp so it removes all their HP, which in turn will add the state. See if you still get the errors then.
While this works, it doesn't distinquish enemies like boss monsters who you may want to have immunity to this effect. I also experience a problem when using addState(1) in my formula, but instead of my game crashing, it just does 0 damage, and continues to do 0 damage every turn like it's a status effect.Did you try it and did it solve the problem? If so, the error probably happened in the first place because you were going about killing the enemy in the wrong way. If the engine is set up to do A, B then C, and you go straight to C, you could be missing out on some important steps, and things couldn't be expected to work correctly.
If you've tried the above and the problem still happens, we'll have to keep looking. And in that case, I'd ask what plugins you're using and if the problem still happens when you disable them all (or try to do the same thing in a brand new project with no plugins).
Mmm how will I explain mmm it drains Hp but it doesn't seem to drain Mp@emelian65
Try this
d = 20 ; b.gainMp(-d) ; d(where 20 is your damage formula)
Try this:Mmm how will I explain mmm it drains Hp but it doesn't seem to drain Mp
So I decided to add one more step into the formula
d = 50 + a.mat * 2 - b.mdf * 2 ; b.gainMp(-d) ; a.gainMp(d) ; d Now it drains both HP and MP as long as the damage type is set to Drain HP, saddly MP doesn't seem to be affected by variance which makes it alway damage and recover a flat number of MP, what should I add to the d formula so it gains a variance let's say of 30%?
it works more or less the Mp damage now varies, however it seem to be able to varie as low as 1 however it doesn't seem to pass the maximun value of the damage formula however. The Hp doesn't as I change the formula to this to make it a little more real to the numbers of my game.Try this:
d = Math.randomInt((50 + a.mat * 2 - b.mdf * 2)*0.7, (50 + a.mat * 2 - b.mdf * 2)*1.3); a.gainMp(Math.min(b.mp, d)); b.gainMp(-d); dIf you want your HP and MP damage to be exactly the same, set your variance to 0%. Otherwise you can leave it to the default 20% if you like.
I added the Math.min() command because it returns the smallest value. So if you deal more MP damage than the enemy has, you will only gain the remaining amount. To do this I also had to place the a.gainMP before the b.gainMP, because it would otherwise return a value after the mp was damaged.
I also added the Math.randomInt() command which returns a random integer between the two values. Careful about using this command because if you divide or multiply the command it may return a decimal, which for some reason shows up as a decimal in the actual game (with a space instead of a decimal point), as shown here:
The formula I provided should return correct integers, though.
Sorry, I didn't realize that randomInt(x) didn't have a min and max value. It'll always be between 0 and the first number you put in. Since Math.randomInt(x) is pretty unreliable to use anyways, you're better off using Math.round(x).it works more or less the Mp damage now varies, however it seem to be able to varie as low as 1 however it doesn't seem to pass the maximun value of the damage formula however. The Hp doesn't as I change the formula to this to make it a little more real to the numbers of my game.
d = Math.randomInt(75 + a.mat * 4 - b.mdf * 2 * 0.8 , 75 + a.mat * 4 - b.mdf * 2 * 1.2) ; a.gainMp(Math.min(b.mp, d)); b.gainMp(-d); 75 + a.mat * 4 - b.mdf * 2
If your state is 15, as an example, you would do this:Hey folks! I’m in the process of trying to create a skill which inflicts a state on all enemies only if the user is already afflicted with that same state. Any clue how to implement this using a damage formula? I figure it should be simple to work out, but I’m having trouble. x_x
Thank you so much for your timely response! This works great.If your state is 15, as an example, you would do this:
a.isStateAffected(15) ? b.addState(15) : null; 0replacing the 0 with the damage formula.This also assumes if you want to inflict the state on ALL enemies, that the skill's target is All Enemies.
Not the one, but thank you on your answer. Is it possible to do the inverse? Get the "a.WeaponAttack" without the a."base"attack? This is because in my damage formula a.atk defines hit chance and "a.WeaponAttack" gets the damage.For a base stat without equipment:
paramBase(#)Where # =
0 Max HP
1 Max MP
2 Attack
3 Defense
4 Magic Attack
5 Magic Defense
6 Agility
7 Luck
So the formula you're looking for is:
((a.atk - a.paramBase(2)) - b.def) * (1 + a.paramBase(2) * (a.level + a.paramBase(2))/256)Remember that formulas are case sensitive!
While this works, it doesn't distinquish enemies like boss monsters who you may want to have immunity to this effect. I also experience a problem when using addState(1) in my formula, but instead of my game crashing, it just does 0 damage, and continues to do 0 damage every turn like it's a status effect.
On a second question, is it possible to call Miss/Evade on the damage formula? Like ? a.matk : Miss/Evade, so to avoid too many 0s during battle?Try this:
(Math.randomInt(20) + a.atk) > (Math.randomInt(20) + b.def) ? a.matk : 0
I think the issue is that you're using lots of ; instead of {} in your if/then/else test. Also, 0 is what's returned if you have an error in your formula.
The above removes the need for the temporary variables and makes it shorter.
Note that Math.randomInt gives a number between 0 and 19, not between 1 and 20, but for these purposes it doesn't really matter, as it's doing it for both sides.