RMMV Damage Formula - ideas and help

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Hello there. 


I'm trying to set up a Skill that runs two elements in it's calculation. (description of the skill is -> Hits enemy 4 times with Wind/Water element)


I tried this formula-> ((4*a.atk-2*b.def) * b.element_rate(12) + (4*a.atk-2*b.def) * b.element_rate(3))


But when i use this my actor only deals zero damage no matter how much ATK he has. 


(this attacks are also only available when under a certain state if that could cause problems)


I hope someone can help me <_>
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Hello there. 


I'm trying to set up a Skill that runs two elements in it's calculation. (description of the skill is -> Hits enemy 4 times with Wind/Water element)


I tried this formula-> ((4*a.atk-2*b.def) * b.element_rate(12) + (4*a.atk-2*b.def) * b.element_rate(3))


But when i use this my actor only deals zero damage no matter how much ATK he has. 


(this attacks are also only available when under a certain state if that could cause problems)


I hope someone can help me <_>


Hello.


Try this instead:


((4*a.atk-2*b.def) * b.elementRate(12) + (4*a.atk-2*b.def) * b.elementRate(3))
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Hello.


Try this instead:


((4*a.atk-2*b.def) * b.elementRate(12) + (4*a.atk-2*b.def) * b.elementRate(3))
This actually let's my actor do damage but when i alter the elemental efficiencys on my target it still does the same-ish damage (changed water from 150 to 20 and wind from 120 to 60) while at first it did around 2500-3000 dmg it now does the same amount.
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
This actually let's my actor do damage but when i alter the elemental efficiencys on my target it still does the same-ish damage (changed water from 150 to 20 and wind from 120 to 60) while at first it did around 2500-3000 dmg it now does the same amount.


What were your attacker's attack stat and defender's defense stats? And what was the defender's element rate?
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
What were your attacker's attack stat and defender's defense stats? And what was the defender's element rate?
Nevermind. I forgot to change the elemental types in the formula to the right elements. It's working !! Thanks for the help!
 
Last edited by a moderator:

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Atk of attacker was 284 (+20% from a state) and enemy def is 10. Defenders Element rate are Fire 120 earth 200 /water 20 and wind is 80. and both skills do around 2400-3000 damage even though his water/wind rate are much lower than his earth/fire rates.


(4*a.atk-2*b.def) = 1,116


b.elementRate(120% Fire) = 1,339


b.elementRate(200% Earth) = 2,232


b.elementRate(20% Water) = 223


b.elementRate(80% Wind) = 892


With variance of 20,


Fire/Earth should do 2,856 ~ 4,285


Water/Wind should do 892 ~ 1,338


If you get a value lower than 2,856, you might have conflicting plugins, or wrong element id in the formula. Have you tried on a fresh project?
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Nevermind. I forgot to change the elemental types in the formula to the right elements. It's working !! Thanks for the help!

(4*a.atk-2*b.def) = 1,116


b.elementRate(120% Fire) = 1,339


b.elementRate(200% Earth) = 2,232


b.elementRate(20% Water) = 223


b.elementRate(80% Wind) = 892


With variance of 20,


Fire/Earth should do 2,856 ~ 4,285


Water/Wind should do 892 ~ 1,338


If you get a value lower than 2,856, you might have conflicting plugins, or wrong element id in the formula. Have you tried on a fresh project?


Lol, okay then. Glad to hear it is working now. xD
 
Last edited by a moderator:

hadecynn

Dreams Circle
Veteran
Joined
Dec 4, 2015
Messages
330
Reaction score
1,049
First Language
English
Primarily Uses
RMMV
Hi there,


I'm trying a make a number of skills that does damage and heals at the same time. The different skills in the series will have different combinations from one of each category:


Offensive


1. Single-enemy


2. Random-enemy


3. All-enemy


Defensive


1. Self-heal


2. Single-ally heal


3. All-allies heal


Does anyone know how I can go about doing this? Thanks!
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Hello there again. I've got another little question.


I want to make a skill that checks the Targets states. With every positive state applied the damage of the skill will be halfed. But also with every positive the User has


the damage will be multiplier by 1.3 again. Is that possible? So basically My User uses the Skill (base damage 99999) and it checks the Target with say 6 states. The damage


will then drop down to 1563. Then it checks the users states (let's say 3) and the damage is then going up to 3433. 
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Hello there again. I've got another little question.


I want to make a skill that checks the Targets states. With every positive state applied the damage of the skill will be halfed. But also with every positive the User has


the damage will be multiplier by 1.3 again. Is that possible? So basically My User uses the Skill (base damage 99999) and it checks the Target with say 6 states. The damage


will then drop down to 1563. Then it checks the users states (let's say 3) and the damage is then going up to 3433. 


How do you define your positive states? And about how many of them are there?
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
How do you define your positive states? And about how many of them are there?


Define? And actually I noticed that iI've got a mistake. I'll try to explain it a little different. The base idea is the same. There are certian Mitigation layers and each layer will reduce the damage by half. These mititagion layers are defined by states (for example Protes /shell/Wall) which stick to the user and there are mitigation layers on the enemy (full break breakdowns and dual breaks) which together are 6 layers of mitigation. The enemy will check if these layers are intact and the damage of the skill is halfed by 2 per layer. But the enemy can also enable states himself that will multiply the damage by 1.3 again (he can do that 8 times with 8 states)
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Define? And actually I noticed that iI've got a mistake. I'll try to explain it a little different. The base idea is the same. There are certian Mitigation layers and each layer will reduce the damage by half. These mititagion layers are defined by states (for example Protes /shell/Wall) which stick to the user and there are mitigation layers on the enemy (full break breakdowns and dual breaks) which together are 6 layers of mitigation. The enemy will check if these layers are intact and the damage of the skill is halfed by 2 per layer. But the enemy can also enable states himself that will multiply the damage by 1.3 again (he can do that 8 times with 8 states)


Sorry, but I am still a bit confused, but I referred to your earlier statement. So what I came up with (with Yanfly's example as reference) does this:

  • Base damage is 99999
  • Check if target has mitigation states. Reduce damage (multiply by 0.5) for each state present.
  • Check if user has offensive states. Increase damage (multiply by 1.3) for each state present.

Give this a try:


var rate = 1; for (var i = 0; i < b.states().length; ++i) { var state = b.states(); if (!state) continue; if ([11, 12, 13, 14, 15, 16].contains(state.id)) rate *= 0.50; } for (i = 0; i < a.states().length; ++i) { state = a.states(); if (!state) continue; if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30; } value = 99999 * rate;


Here's a cleaner version if you are using Yanfly's Damage Core:


var rate = 1;
for (var i = 0; i < b.states().length; ++i) {
var state = b.states();
if (!state) continue;
if ([11, 12, 13, 14, 15, 16].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
state = a.states();
if (!state) continue;
if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30;
}
value = 99999 * rate;




So what you can do here are

  • Change [11, 12, 13, 14, 15, 16] to the mitigation state ids
  • Change [17, 18, 19, 20, 21, 22, 23, 24] to the offensive state ids
  • You can also change the rates and base damage value

Hope this answers your question!


- Riff
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Sorry, but I am still a bit confused, but I referred to your earlier statement. So what I came up with (with Yanfly's example as reference) does this:

  • Base damage is 99999
  • Check if target has mitigation states. Reduce damage (multiply by 0.5) for each state present.
  • Check if user has offensive states. Increase damage (multiply by 1.3) for each state present.

Give this a try:



var rate = 1; for (var i = 0; i < b.states().length; ++i) { var state = b.states(); if (!state) continue; if ([11, 12, 13, 14, 15, 16].contains(state.id)) rate *= 0.50; } for (i = 0; i < a.states().length; ++i) { state = a.states(); if (!state) continue; if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30; } value = 99999 * rate;


Here's a cleaner version if you are using Yanfly's Damage Core:



var rate = 1;
for (var i = 0; i < b.states().length; ++i) {
var state = b.states();
if (!state) continue;
if ([11, 12, 13, 14, 15, 16].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
state = a.states();
if (!state) continue;
if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30;
}
value = 99999 * rate;




So what you can do here are

  • Change [11, 12, 13, 14, 15, 16] to the mitigation state ids
  • Change [17, 18, 19, 20, 21, 22, 23, 24] to the offensive state ids
  • You can also change the rates and base damage value

Hope this answers your question!


- Riff



Wow this looks overwhelming Thanks for that. I think this almoast works. I think I'll have to change 3 States though. Full Break/Breakdown/Dual Break has to be applied on the attacker. So i guess I'll have to make a third calculation that looks like this=
 


for (var i = 0; i < a.states().length; ++i) {


var state = a.states();





if (!state) continue;





if ([14, 15, 16].contains(state.id)) rate *= 0.50;





 





so that the 3 states (offensive layers from the party) apply to the enemy right? 



Basically If party is under state 11 12 and 13 it will be halfed and if attacker is under state 14 15 and 16 it will be halfed again. 


While state 17 to 25 on the attacker raises the damage by 1.3





 





 
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Hi there,


I'm trying a make a number of skills that does damage and heals at the same time. The different skills in the series will have different combinations from one of each category:


Offensive


1. Single-enemy


2. Random-enemy


3. All-enemy


Defensive


1. Self-heal


2. Single-ally heal


3. All-allies heal


Does anyone know how I can go about doing this? Thanks!


If the defensive-side happens to be Single-ally heal, which ally is selected. Is it random?

Wow this looks overwhelming Thanks for that. I think this almoast works. I think I'll have to change 3 States though. Full Break/Breakdown/Dual Break has to be applied on the attacker. So i guess I'll have to make a third calculation that looks like this=
 


for (var i = 0; i < a.states().length; ++i) {


var state = a.states();


if (!state) continue;


if ([14, 15, 16].contains(state.id)) rate *= 0.50;


 


so that the 3 states (offensive layers from the party) apply to the enemy right? 

Basically If party is under state 11 12 and 13 it will be halfed and if attacker is under state 14 15 and 16 it will be halfed again. 
While state 17 to 25 on the attacker raises the damage by 1.3


 


 


Yes, but don't forget the close curly bracket too. So your final version should look like this:

Code:
var rate = 1;
for (var i = 0; i < b.states().length; ++i) {
  var state = b.states()[i];
  if (!state) continue;
  if ([11, 12, 13].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
  state = a.states()[i];
  if (!state) continue;
  if ([14, 15, 16].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
  state = a.states()[i];
  if (!state) continue;
  if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30;
}
value = 99999 * rate;
 
Last edited by a moderator:

hadecynn

Dreams Circle
Veteran
Joined
Dec 4, 2015
Messages
330
Reaction score
1,049
First Language
English
Primarily Uses
RMMV
If the defensive-side happens to be Single-ally heal, which ally is selected. Is it random?


Good question. Ideally it would be selectable, though I can already see that this will probably need a plugin. The next best option would be if it targets the ally with the lowest % (or value) HP. If that also doesn't work, then I guess I'll just scrap the single-ally heal and just make it all-allies heal, since there's very low utility in having a random single-target heal from the player's perspective.


Thanks for helping! =)
 
Last edited by a moderator:

Rhudra

Veteran
Veteran
Joined
Feb 2, 2013
Messages
30
Reaction score
3
First Language
French
Primarily Uses
Hello


I'd like a skill to deal more damage when the others party members are lacking health.


For exemple. If they all have 0 hp it does 100% of the attack normal damage, if they have 100% hp it deals 0% of the attack normal damage, and if one have 25%hp and the other 75%hp it would deal 50% of the attack normal damage. (the attack normal damage being 300 * a.atk / b.def.


Any idea how I could make an average of the party's hp and an average of the party mhp?


It'd be great
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Yes, but don't forget the close curly bracket too. So your final version should look like this:



var rate = 1;
for (var i = 0; i < b.states().length; ++i) {
var state = b.states();
if (!state) continue;
if ([11, 12, 13].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
state = a.states();
if (!state) continue;
if ([14, 15, 16].contains(state.id)) rate *= 0.50;
}
for (i = 0; i < a.states().length; ++i) {
state = a.states();
if (!state) continue;
if ([17, 18, 19, 20, 21, 22, 23, 24].contains(state.id)) rate *= 1.30;
}
value = 99999 * rate;


Okay it works for the party mitigation layers. But somehow the enemy buffs aren't calculated. I had 3 layers up. (12500 dmg) and he had 2 layers up (1.3 x2) so the damage should be around 21000 but it only did the 12500. (with all 6 layers he does only 1563 dmg as intended)
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Sorry it took so long. Was out and about yesterday and free just now to figure these out. :)


Anyway,

Good question. Ideally it would be selectable, though I can already see that this will probably need a plugin. The next best option would be if it targets the ally with the lowest % (or value) HP. If that also doesn't work, then I guess I'll just scrap the single-ally heal and just make it all-allies heal, since there's very low utility in having a random single-target heal from the player's perspective.


Thanks for helping! =)


I haven't tried these, but they should work based on my understanding (basic level). I used one of Alistair's Eval Collection to write these out.


Self-healing is pretty straight forward.


<Post-Damage Eval>
var healvalue = Math.floor(value * 0.5);
user.gainHp(healvalue);
user.startDamagePopup();
</Post-Damage Eval>


As for all-allies heal, I just made small modification to the original codes, mainly for ease of changing the healing formula.


<Post-Damage Eval>
var healvalue = Math.floor(value * 0.5);
for (var i = 0; i < $gameParty._battleMembers.length; i++) {
var actor = $gameParty._battleMembers;
if (actor === 0) { continue };
if ($gameActors.actor(actor).hp <= 0) { continue };
$gameActors.actor(actor).gainHp(healvalue);
if ($gameActors.actor(actor) !== user) {
$gameActors.actor(actor).startDamagePopup();
}
}
</Post-Damage Eval>


The lowest-hp-ally heal is a bit tricky for me. I'm very new to programming, but I think this code should work (assuming actor index starts at 1 instead of 0)


<Post-Damage Eval>
var healvalue = Math.floor(value * 0.5);
var lowactor = 1;
var lowhpdiff = $gameActors.actor(1).hp / $gameActors.actor(1).mhp;
for (var i = 0; i < $gameParty._battleMembers.length; i++) {
var actor = $gameParty._battleMembers;
if (actor === 0) { continue };
if ($gameActors.actor(actor).hp <= 0) { continue };
var thishpdiff = $gameActors.actor(actor).hp / $gameActors.actor(actor).mhp;
if (thishpdiff < lowhpdiff) {
lowhpdiff = thishpdiff;
lowactor = actor;
}
}
$gameActors.actor(actor).gainHp(healvalue);
if ($gameActors.actor(lowactor) !== user) {
$gameActors.actor(lowactor).startDamagePopup();
}
</Post-Damage Eval>


For all of these, just change the healvalue formula to the one you want. By default, I set these to half of the damage dealt.

Okay it works for the party mitigation layers. But somehow the enemy buffs aren't calculated. I had 3 layers up. (12500 dmg) and he had 2 layers up (1.3 x2) so the damage should be around 21000 but it only did the 12500. (with all 6 layers he does only 1563 dmg as intended)


Sorry, I'm confused again. There are 3 stages, right?

  • Stage 1: Party Mitigation Layer (State 11, 12, 13) - Each multiplies damage by 0.5
  • Stage 2: Enemy Mitigation Layer (State 14, 15, 16) - Each multiplies damage by 0.5
  • Stage 3: Enemy 'Weakening' Layer (State 17, 18, 19, 20, 21, 22, 23, 24) - Each multiplies damage by 1.3

So are you saying you had state 11, 12, 13 up and damage is correct, but when you add 2 of stage 3 states, the damage wasn't correct?


Also, when you said all 6 layers, which are you refering to?
 

xXIzzyXx

Veteran
Veteran
Joined
Jan 27, 2016
Messages
15
Reaction score
4
First Language
German
Primarily Uses
Sorry, I'm confused again. There are 3 stages, right?

  • Stage 1: Party Mitigation Layer (State 11, 12, 13) - Each multiplies damage by 0.5
  • Stage 2: Enemy Mitigation Layer (State 14, 15, 16) - Each multiplies damage by 0.5
  • Stage 3: Enemy 'Weakening' Layer (State 17, 18, 19, 20, 21, 22, 23, 24) - Each multiplies damage by 1.3

So are you saying you had state 11, 12, 13 up and damage is correct, but when you add 2 of stage 3 states, the damage wasn't correct?


Also, when you said all 6 layers, which are you refering to?
The stages are correct. I had 3 layers (11,12,13) and He had 2 layers (17,18) but it didn't calculate his 2 layers. So he did the damage as if he hasn't buffed himself even though he did buff himself 
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,358
Members
137,803
Latest member
andrewcole
Top