[Solved]How to adjust damage value

Status
Not open for further replies.

harjeb

Warper
Member
Joined
May 2, 2019
Messages
3
Reaction score
1
First Language
chinese
Primarily Uses
RMMV
I want to use below codes to adjust damage value, but it not work, so how to make this work? :kaocry:

Code:
<Custom Respond Effect>
if (target.isAlive() && value>(target.mhp%0.1)) {
value = target.mhp%0.1;
}
</Custom Respond Effect>
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
[move]Learning Javascript[/move]
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
so how to make this work
first, notetags by themselves have absolutely no function.
to do anything there has to be a plugin that reads the notetags and to react to them.

so you'll have to give us a link to the plugins you're using to read those notetags, because otherwise we can only guess what that does.

second, if you want to learn javascript to use in the damage formula and in eval-type notetags, then you need to tell us not only a code snippet but also what that code snippet is supposed to do.
In the case of your code, the modulo-part of that code is rather strange - unless there is something else handling the "value", that would always result in value = 0 for anything in regular game mechanics.
 

harjeb

Warper
Member
Joined
May 2, 2019
Messages
3
Reaction score
1
First Language
chinese
Primarily Uses
RMMV
first, notetags by themselves have absolutely no function.
to do anything there has to be a plugin that reads the notetags and to react to them.

so you'll have to give us a link to the plugins you're using to read those notetags, because otherwise we can only guess what that does.

second, if you want to learn javascript to use in the damage formula and in eval-type notetags, then you need to tell us not only a code snippet but also what that code snippet is supposed to do.
In the case of your code, the modulo-part of that code is rather strange - unless there is something else handling the "value", that would always result in value = 0 for anything in regular game mechanics.
Thanks for reply, I use BUFFS&States Core in Yanfly Engine Plugins, http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
and I want to use below function to create a passive status that max damage dealt to the battler will reduce to battler's 0.1 * maxhp.
Code:
<Custom Respond Effect>
code
code
</Custom Respond Effect>
This effect will run when the battler is selected as a target. This will occur only if the action connects and will occur after damage execution. This effect will run after damage calculation occurs. The ‘value’ variable is equal to the damage dealt to the battler. This is the first effect to run after damage execution has taken place.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
First:

If you want to get 10% or any percent of a value, you need to use the multiplication operator not the % because that is the modulo operator..

So your check and your value should be

targetHP*0.10

not targetHP%0.10

Second:

Respond effect happens after the damage is dealt (as written in the note after the tag you posted),

"This will occur only if the action connects and will occur after damage execution"

so if your goal is to minimize/modify the damage, you should use a different notetag. I think "react" is the right notetag for this
 
Last edited:

harjeb

Warper
Member
Joined
May 2, 2019
Messages
3
Reaction score
1
First Language
chinese
Primarily Uses
RMMV
First:

If you want to get 10% or any percent of a value, you need to use the multiplication operator not the % because that is the modulo operator..

So your check and your value should be

targetHP*0.10

not targetHP%0.10

Second:

Respond effect happens after the damage is dealt (as written in the note after the tag you posted),

"This will occur only if the action connects and will occur after damage execution"

so if your goal is to minimize/modify the damage, you should use a different notetag. I think "react" is the right notetag for this
Thank you very much :rhappy: 'react' notetag is exactly what i want.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

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.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top