I used a damage formula in ace and trying to copy it to my mv project it does not work just giving me a error
"Failer to execute 'createLineGradient' on 'CanvasRenderingContext2D': float parameter 3 is non-infinitive"
Here is my damage formula so any help is appriciated.
a.atk * 3 + a.mat * 0.2 + ((a.atk * 1 + a.level)/32) * ((a.atk * 1 * a.level*1)/32) - b.def * 1
Edit
Ohh now i see where the problem is, on my vxa i got a different attack for enemies and as enemies do not have level it gives me the error as i am yet to give the enemy its own attack.
RMMV Damage Formula - ideas and help
● ARCHIVED · READ-ONLY
-
-
I'm having some trouble with the battle forumla, and it just occurerd to me that maybe what I want to do it can't be done.
Is it possible to store the ID of the caster into a variable?
I tried something like:
v[1]=a.id; a.atk * 4 - b.def * 2
If the ID is correct then it should trigger a common event, but nothing happens, so am I missing something or just it can't be done? -
If the ID is correct then it should trigger a common event, but nothing happens, so am I missing something or just it can't be done?
how do you trigger the common event?
That is most likely the problem, because if you have a common event parallel process, then it will never work - because all parallel processes are automatically stopped on battlescreen.
You'll need a troop event to check something on battlescreen -
how do you trigger the common event?
That is most likely the problem, because if you have a common event parallel process, then it will never work - because all parallel processes are automatically stopped on battlescreen.
You'll need a troop event to check something on battlescreen
In the skill "Attack" I can call a common event that's not a parallel process.
The event is something like:
- IF Variable Actor ID=1
-- If Actor 1 has Dagger equipped
--- Add 1 to Variable Dagger Mastery
-- If Variable Dagger Mastery is = 3
--- Add Skill "Double Dagger".
I already checked the common event without the Actor ID Variable, and it works, but it triggers every time someone uses the attack (so even if another Actor attacks) that's why I need to find a way to set the event to trigger only when the ID of the attacker (a in the battle formula) is equal to the Actor ID.
So the main issue is about: "Can I store the caster ID in a Variable using the battle formula"? -
I have an idea for a few skills that I are meant to "hit" multiple times, depending on the attacker's Agility versus the target's. As an example, one skill is called "Six Slaps," with the following formula:
( a.atk * 6 - b.def * 4 )
What I want it to do is as follows: For every 3 (past the first three) Agility the user has more than the target, the final damage done is multiplied. E.g., if the use has 76 Agility and the target has 70 (6 more greater than the target's), then the damage will be doubled (2x damage). Having 79 Agility against the same target (9 greater) would result in triple damage, 82 in quadruple, 85 in quintuple, and finally 88 (18 greater) would result in sextupled damage. However, if the user only has 1-3 more Agility than their target, if both battlers have equal Agility, or if the target's Agility is higher, then the damage would be multiplied by 1 / wouldn't be changed and work as the above formula.
The other skills I have in mind have different "hit caps" from Six Slaps, so I figure just one formula could easily have numbers swapped to suit the other skills. How can I achieve my goal(s) in a damage formula? -
I have an idea for a few skills that I are meant to "hit" multiple times, depending on the attacker's Agility versus the target's. As an example, one skill is called "Six Slaps," with the following formula:
( a.atk * 6 - b.def * 4 )
What I want it to do is as follows: For every 3 (past the first three) Agility the user has more than the target, the final damage done is multiplied. E.g., if the use has 76 Agility and the target has 70 (6 more greater than the target's), then the damage will be doubled (2x damage). Having 79 Agility against the same target (9 greater) would result in triple damage, 82 in quadruple, 85 in quintuple, and finally 88 (18 greater) would result in sextupled damage. However, if the user only has 1-3 more Agility than their target, if both battlers have equal Agility, or if the target's Agility is higher, then the damage would be multiplied by 1 / wouldn't be changed and work as the above formula.
The other skills I have in mind have different "hit caps" from Six Slaps, so I figure just one formula could easily have numbers swapped to suit the other skills. How can I achieve my goal(s) in a damage formula?
Okay, so multiplier cap for this skill is 6x. Every 3 AGI user has higher than target, multiplier will increase by 1x, as follows:
5 AGI or less: 1x
6 AGI - 8 AGI: 2x
9 AGI - 11 AGI: 3x
12 AGI - 14 AGI: 4x
15 AGI - 17 AGI: 5x
18 AGI or more: 6x
Maybe try this?:
var multi = Math.floor((a.agi - b.agi) / 3);
multi = multi.clamp(1, 6);
(a.atk * 6 - b.def * 4) * multi;
If you wanna put it in one line of formula, it'll be this one:
var multi = Math.floor((a.agi - b.agi) / 3); multi = multi.clamp(1, 6); (a.atk * 6 - b.def * 4) * multi;
- Riff -
How would I add a state to the entire party while damaging the enemy?
EG: Phoenix skill (similar to FF7). Deals damage to the enemy, adds autolife state to allies. -
How would I add a state to the entire party while damaging the enemy?
EG: Phoenix skill (similar to FF7). Deals damage to the enemy, adds autolife state to allies.
Quick question, are you using Yanfly's Battle Core & Action Sequences? If you are, the quickest and most efficient way to do this is to put this into your skill notebox:
<follow action>
add state x: friends, hide
</follow action>
Where x is your autolife state.
- Riff -
Quick question, are you using Yanfly's Battle Core & Action Sequences? If you are, the quickest and most efficient way to do this is to put this into your skill notebox:
<follow action>
add state x: friends, hide
</follow action>
Where x is your autolife state.
- Riff
Yes I am and that worked perfectly! Thank you very much. Thought I was going to have to use something in the formula. -
ok, first of all i read through like 10 pages ... then got lazy x, x
i wanted to make a potion that heals both HP and MP, i dont know what the damage formula would look like ....
i tried something like 80;a.gainmp(15) but it keeps doing zero damage.
also i want a potion that does random heal, i kept getting same results, the formula is x=math.randomint(20)+20;80+x;x
im not sure where i went wrong =\ , any help is appreciated xD -
@Balako: You don't need a damage formula if the HP and MP gain is fixed. Just add gain MP as a feature (box under the damage formula), select gain MP, and enter the fixed amount. Also works for % of max MP. Similar for HP if HP gain is fixed.
-
-
ok, first of all i read through like 10 pages ... then got lazy x, x
i wanted to make a potion that heals both HP and MP, i dont know what the damage formula would look like ....
i tried something like 80;a.gainmp(15) but it keeps doing zero damage.
also i want a potion that does random heal, i kept getting same results, the formula is x=math.randomint(20)+20;80+x;x
im not sure where i went wrong =\ , any help is appreciated xD
If you're using the damage formula, whether it's for skills or items, just make sure you have a value to return in your 'last line'. So to fix your potions, you can try these:
a.gainMp(15); 80
Dont forget to set this to HP healing.
As for the random one, you're close:
var x = Math.randomInt(20) + 20; x + 80; x
Or just simplify as
Math.randomInt(20) + 100
With variance of 0, this will heal between 100 and 119.
- Riff -
-
Hi everyone! I'm trying to work out how my formula should work. What I have now is:
0.9*Math.floor(Math.sqrt(a.atk*a.atk*a.atk*(Math.pow(0.5, b.def*0.02)))
The problem is, in its' current form, it deals constant 0 damage when it shouldn't (20 ATK vs 10 DEF means it should deal ~75 DMG). It worked in VXA in the following form:
0.9*(Math.sqrt(a.atk*a.atk*a.atk*(0.5**(b.def*0.02))).to_i)
What am I doing wrong? Should there be more spaces? -
Hi everyone! I'm trying to work out how my formula should work. What I have now is:
0.9*Math.floor(Math.sqrt(a.atk*a.atk*a.atk*(Math.pow(0.5, b.def*0.02)))
The problem is, in its' current form, it deals constant 0 damage when it shouldn't (20 ATK vs 10 DEF means it should deal ~75 DMG). It worked in VXA in the following form:
0.9*(Math.sqrt(a.atk*a.atk*a.atk*(0.5**(b.def*0.02))).to_i)
What am I doing wrong? Should there be more spaces?
Moar parenthesis! If that's an exact cut and paste, then you're missing a ) from the end. -
Hello eveyone I'm trying to use a very simple formula I think; so please if anyone can help me...
Math.round($gameVariables[2] * 0.75) + a.atk * 4 - b.def * 2
This so far is the basic layout, however as Variable 2 is going to be increased constantly in the game I want put a lmit to the bonus damage like.
if Variable 2 > 700 then the bonus should stay at 700 even if the varibale is something like 1250
I hope I made myself clear and that someon can help me. -
Hello eveyone I'm trying to use a very simple formula I think; so please if anyone can help me...
Math.round($gameVariables[2] * 0.75) + a.atk * 4 - b.def * 2
This so far is the basic layout, however as Variable 2 is going to be increased constantly in the game I want put a lmit to the bonus damage like.
if Variable 2 > 700 then the bonus should stay at 700 even if the varibale is something like 1250
I hope I made myself clear and that someon can help me.
You should replace "$gameVariables[2]" with "Math.min(700, $gameVariables[2])" -
Moar parenthesis! If that's an exact cut and paste, then you're missing a ) from the end.
Thanks, that did it, now it works. I thought it would throw a syntax error or something (AFAIK it used to in VXA) -
Hello eveyone I'm trying to use a very simple formula I think; so please if anyone can help me...
Math.round($gameVariables[2] * 0.75) + a.atk * 4 - b.def * 2
This so far is the basic layout, however as Variable 2 is going to be increased constantly in the game I want put a lmit to the bonus damage like.
if Variable 2 > 700 then the bonus should stay at 700 even if the varibale is something like 1250
I hope I made myself clear and that someon can help me.
As Naridar put it, you need Math.Min() but you can do it like this
Math.Min(700, Math.round($gameVariables[2] * 0.75)) + a.atk * 4 - b.def * 2