Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Damage reduction, How do I do that?!
Fonstw
post Dec 29 2012, 12:04 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 36
Type: Writer
RM Skill: Intermediate




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

This post has been edited by Fonstw: Jan 5 2013, 01:17 PM


__________________________
Haven't you ever noticed that "four" is the only number with the same amount of letters as it's definition in the entire English language?
Go to the top of the page
 
+Quote Post
   
Rukiri
post Dec 29 2012, 09:42 PM
Post #2


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,725
Type: Scripter
RM Skill: Advanced




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.



__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Fonstw
post Jan 3 2013, 03:06 AM
Post #3


Level 3
Group Icon

Group: Member
Posts: 36
Type: Writer
RM Skill: Intermediate




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)


__________________________
Haven't you ever noticed that "four" is the only number with the same amount of letters as it's definition in the entire English language?
Go to the top of the page
 
+Quote Post
   
Fonstw
post Jan 5 2013, 01:03 PM
Post #4


Level 3
Group Icon

Group: Member
Posts: 36
Type: Writer
RM Skill: Intermediate




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


__________________________
Haven't you ever noticed that "four" is the only number with the same amount of letters as it's definition in the entire English language?
Go to the top of the page
 
+Quote Post
   
Naridar
post Feb 3 2013, 03:14 AM
Post #5


Level 14
Group Icon

Group: Revolutionary
Posts: 250
Type: Developer
RM Skill: Skilled




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.


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 05:04 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker