Quick question.
I know that to check a state is a.isStateAffected(x) ?
How do I check if the user does not have the state? I think i have to add a ! but I don't know where
Having trouble with a formula, i accidentally posted a thread for it because im dumb and didn't ready sticky's.
var n = Math.floor((Math.random() * 7) + 1); if (n == 7) {a.luk * 6}; else {a.atk * 3}
Im trying to make it so the attack rolls a random number between 1-7.
If the number rolled is a 7, it does a.luk * 6.
If it rolls anything other than a 7, it rolls a.atk * 3.
What is wrong with my formula? >.<
looking at it, my guess is the problem is to do with "; else {a.atk * 3}" being you have an else but no if, I'd try without the semicolon in the middle but it might just be easier to do this
var m = 1; var n = (Math.randomInt(6) + 1); if (n == 7) {m = a.luk * 6}; if (n != 7) {m = a.atk * 3}; m
I know that it looks weird but the damage formula only cares about the value at the end, so any errors will cause it to return zero, so if neither if statement is used then the damage is 1, else if you get 0 again you've got a logic error
Is there a way to add the weapon's attack to a formula? Like, weapon damage + regular formula?
I saw a few threads that helped VXA users, but I couldn't find any that were answered for MV. From VXA, a.weapons[0].atk would work (I'm pretty sure).
Thanks in advance.
So I have been toying around with a few ideas for my stat/damage systems, and I think I finally made one that I like, but I would like some outside opinions on it as well.
The stats are as such:
Vitality- 100% of this number is HP, also gives 10% of its value as damage reduction.
Might- This serves as the melee attack value, also gives anywhere from 1-25% of its value in damage reduction.
Agility- This serves as the ranged attack value, also reduces damage received by a percentage based on 1/6 of its value (eg. 30 agility gives 5% reduction of damage)
Intelligence- 100% of this number is MP, also gives 10% of its value as magic damage reduction.
Sorcery- This serves as the magical attack value, also gives anywhere from 1-25% of its value in magic damage reduction.
Wisdom- This serves as the magical healing value, also reduces damage received by a percentage based on 1/6 of its value (see agility).
The reasoning:
By taking out a hard defensive stat and spreading the defenses around all stats, I think it will allow players to pursue whatever path they want without having to ignore offensive stats to gain defense or defensive stats to gain power. Vitality and Intelligence raise at +10 points per level, giving an extra 1 damage reduction to their respective damage type, Might and Sorcery raise at +1 per level, not giving too much more defense but their attack types will be the most powerful. Agility and Wisdom also grow at +1 a level, giving a ~.16% reduction per level in overall damage taken. In addition, the players will be given 3 points per level to allocate to whatever stats they want, effectively adding another level to whatever stat they place it in, with a max of one point spent on one stat per level (akin to how Morrowind and Oblivion leveled their stats). Points would of course increase Vitality and Intelligence 10 points instead of just one.
Players start with scores of 100 in both Vitality and Intelligence, and with 30 points in each other stat. Equipment that directly increases stats will be rare, favoring Vitality and Intelligence over the others. The basic damage formula is as follows (may not be in perfect game terms):
a.Atk * ((100 - (b.agl / 6)) * .01) - (b.HP * .1) - ((Math.randomint (24) +1) - (b.Atk * .01)
And substituting a.agl for ranged attack and so on for other attack types.
Any suggestions, comments or ridicules anyone?
I'm trying to come up with a damage formula for a harm undead spell that only hurts enemies with the Undead element applied, and does 0 damage otherwise. I created an Undead element type, and applied the "Element Rate: Undead * 100%" to my monster. Is there a way to test if an actor has a trait applied? If so, it should be as simple as:
if ( b.isTypeAffected(Undead) != True ) {0;} else { 100 + a.atk - b.def *2; }
I'm not a coder so I doubt the syntax is correct on that, or if there even is a "b.isTypeAffected" command in RMMV, but that's what the forums are for! Thanks in advance!!
Got it working! For posterity, here be the code:
if ( !b.isStateAffected(29) ) 0; else (Math.floor(Math.random() * (800 - 200 + 1)) + 200) + a.mat - b.mdf * 2
Just for reference, 29 is my Undead state I created, and I wanted this spell to do a random amount of damage between 200 and 800, that's what all the Math is about.
I'm trying to create a feint-like attack that has a 50% chance to hit. If it succeeds, it deals only a small amount of damage. If the attack misses, it inflicts state 14 on the enemy (it inflicts a penalty to evasion and critical evasion).
Oh, and is there a way to force a target to go last? I was going to reduce the target's AGI to 1% with state 14 but I'm not certain if the turn order is determined before the attack.
How do I use more than 1 character stats in a formula.
I want to make an attack that takes into account all the party members ATK and MAT.
Also is there a way that after selecting the attack, the other party members become unable to attack,?, like combination attacks, but without plug-ins?
Is it possible to output the result of the damage formula to the console? I tried using:
console.log( a.atk * 4 - b.def * 2 )
as my damage formula and it throws errors whenever the skill is used. I trying figure out where I screwed a formula up in my game and would like to see if the damage formula is being evaluated correctly. MV really needs a full debug mode that outputs more information to the console.