Help - Search - Members - Calendar
Full Version: Damage reduction
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Ace Discussion
Fonstw
So yeah, when one of the actors deals 50 damage, and the monster has 10 HP (in total or just left) the actor still deals 50 damage.
How do I make that the amount of damage (and healing!) modifies itselves to the amount of HP's the target has if this is less that the amount of healing or damage?

(50 damage to 10 HP means 10 damage instead of 50, same for healing)

Thanks for reading, and please respond if you know.

P.S.: I'm asking for VX and (less neccesary) VX Ace
EDIT: Sorry, that's reversed: I'm asking for Ace and (less neccesary) VX, sorry sad.gif
Rukiri
The simplest method is to just use math, basically if the actor does 50 but the enemy has 10 this is what I would do.
I'm not going to write a script but you should get the idea.

if hero_dam > enemy.hp
dam_txt = enemy.hp
enemy,hp -= hero_dam
else
dam_txt = hero_dam
enemy.hp -= hero_dam
end

Basically this will just just check if the damage that your hero does is greater than or less than and show the correct output on screen and minus the correct amount.

Fonstw
QUOTE (Rukiri @ Dec 29 2012, 10:42 PM) *
if hero_dam > enemy.hp
dam_txt = enemy.hp
enemy,hp -= hero_dam
else
dam_txt = hero_dam
enemy.hp -= hero_dam
end

So, I put that under Materials in a new script, I guess?

Thanks, I'm going to try it out as soon as I'm home (at grandma's right now)
Fonstw
QUOTE (Rukiri @ Dec 29 2012, 10:42 PM) *
The simplest...correct amount.

Yup, I have a problem of course...
"Unexpected tOP_ASGN, expecting '='
enemy,hp -= hero_dam"

Assuming that "enemy,hp" should be "enemy.hp" i changed it, now it doesn't recognize "hero_dam" for main:Object...
So... HALP
Naridar
That's way too complicated. Just use the following in the damage formula box of the skill:

[<DMG>; b.hp].min

Replace <DMG> with the damage formula you use.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.