Just as a suggestion, there's not much reason to do that. Recent/unread posts show up in the same lists on the site. So unless there's someone who's only working off of notifications from threads they've Followed, we're going to see your post regardless of which specific damage formula thread it's in 😉
Damage Formulas 101
RMMV TutorialsTheorically, making a check for more than one condition would work with && on it right?
For example:
Could this work if I need the skill to deal extra damage as long as MP and TP are above 35? Or should I need to do something else?
For example:
JavaScript:
a.mp && a.tp >= 35 ? 75 : 40;
Could this work if I need the skill to deal extra damage as long as MP and TP are above 35? Or should I need to do something else?
No, that's not correct JavaScript syntax. Each side of the boolean operator must be a complete comparison. See:
JavaScript Comparison Operators
Comparison operators are used to compare two values.
So you'd do
a.mp>=35 && a.tp>=35I'm not receiving any battle damage with this formula I'm not sure why.
Can this be done or do I need to make two different damage formulas with the same name?
Can this be done or do I need to make two different damage formulas with the same name?
JavaScript:
if (a.actorId() === 1) { (v[1] + a.atk * 4 - b.def * 2); } else { (a.atk * 4 - b.def * 2); }
@Fonixed, try == instead of ===. What's in variable 1?
I've given Variable 1 the value of 25, it's just a random value that I'm using to see if I can get it working.
Also == and === have the same effect in this case. I can deal damage but not receive any.
With RPG Maker they always will. Unless you manually set a variable to something weird, they will always be numbers and not need to be a strict comparison.
Because enemies don't have an actorId() field. When an enemy uses the skill, calling actorId() is undefined and zeros out the entire formula.
How much of these can be applied on VXA? I know MV uses javascript but idk how much I can reference, I could not find a comprehensive "Damage Formula 101" for VXA (Forma wrote one but it was not as in depth with each functionality)
Are these functions here like currentExp() the same in VXA? Would've be so nice if VXA let me uses as much as what is documented here.
Are these functions here like currentExp() the same in VXA? Would've be so nice if VXA let me uses as much as what is documented here.
No, VX uses Ruby for scripting while MV/Z are coded in JavaScript - two completely different languages.
You can look up the VXAce script call list for functions to use in that engine.
Script Call Collection for VXAce
Table of Contents Event Page 1 † Message † Party † Actor † † Game Progression † Flow Control † Event Page 2 † Movement † Timing † Picture and Weather † † Character † Screen Effect † Music and Sounds † Event Page 3 † Scene Control † Map † System Settings † † Battle † Movie † ...
forums.rpgmakerweb.com
Hey, I'd like to make a damage formula that allows me to hit an enemy and at the same time give back a fixed number (for example) 7 of mana and TP to my allies and myself. Is it possible to do this?
Yes, but it's generally not best practice to put that in the damage formula.
The first post of this thread lists the functions for gaining MP and TP. You can use the forEach() method to do it to everyone. For example:
Code:
a.friendsUnit().forEach(battler => battler.gainMp(7)); damage formula
However, if you give that skill to enemies or you ever use the auto battle trait, it can produce unexpected results. So it's better to use something like Yanfly's Skill Core to execute code like that only when a skill is actually used.
So i thought I could make a formula that drained 35% of a target's TP and restored it to the user but I feel like I'm missing something?
a.setTp(a.Tp * .65); user.setTp(user.Tp + (a.Tp * .65)
a.setTp(a.Tp * .65); user.setTp(user.Tp + (a.Tp * .65)
There are a few things wrong with this.
1 - There's no such property as "Tp". It's "a.tp" or "b.tp," etc.
2 - As described in the first post of this thread, the last thing in your formula must always be the value being used for damage. The setTp function does not return a value, so you're going to be getting
undefined from all of that.3 - There's no such thing as
user in the damage formula - I'm not sure where you're getting that from. You might be confused with the documentation for plugin notetags, but the damage formula only has a and b.4 - Your syntax is incorrect. The second statement (after the semicolon) has two open parentheses and one close.
If this skill is not supposed to do any HP or MP damage to the target at all, you probably don't want to use the damage formula for this. You must have a value if you do, which means if nothing else you'll see a 0 damage popup every time you use the skill. If that's the case, you'd be better off using something like Yanfly's Skill Core and putting the code into an After Eval notetag or something like that.
okay, thanks. I'll try to do something with the skill core. I did some other stuff but I'm not good as coding at all, so it's... a process. lol
I want to make an item that has double strength in battle. How would I go about checking to make sure I'm in the Battle Scene?
Code:
SceneManager._scene instanceof Scene_Battle ? original formula : stronger formula
Thanks, that did it! Had to swap the formula places, though.
@Disponi Oops, sorry, yeah, quickly typed that backward 😛
I'm not so good in formulas. Could you please explain me one thing. Is it possible to create formula that will change damage to heal or heal to damage depending on state or something like that? I'll be very grateful.
Right now I'm trying to create a classes that normally heal characters but damage undead enemies with the same skills. I already know about Silv Undead plugin but I'm also using FROG Health which demands special fomulas written in the plugin options. In other case it's bugging the game. Silv's Undead works only with straight formulas like a.atk and so on.
Found what I need in the another thread. Won't bother. Will just create damaging skills for my healers.
Right now I'm trying to create a classes that normally heal characters but damage undead enemies with the same skills. I already know about Silv Undead plugin but I'm also using FROG Health which demands special fomulas written in the plugin options. In other case it's bugging the game. Silv's Undead works only with straight formulas like a.atk and so on.
Found what I need in the another thread. Won't bother. Will just create damaging skills for my healers.
What was the solution?
Original thread: https://forums.rpgmakerweb.com/threads/damage-formulas-101.81905/