Status
Not open for further replies.

Korimax

Architect of Procrastination
Veteran
Joined
Apr 3, 2013
Messages
941
Reaction score
41
First Language
English
Primarily Uses
N/A
Okay basically I am asking how exactly I set up a battle formula when I want a skill to deal 50% of the target's current HP, I know how to do total HP by using a Negative Heal, but I don't know how to use Current HP.

Also if it is at all possible, I was wondering if it were possible for skills to have a sort of conditional damage, like if the target's HP falls below a specific % then it deals a specific amount of damage rather than 50% (That or just additional damage alongside the 50% when it gets that low).

EDIT: ALSO, I apologize if somehow I am posting this in the wrong place. (I do believe I am right, but I could somehow be mistaken.)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,741
Reaction score
8,519
First Language
German
Primarily Uses
RMMV
the damage formula can process any ruby operation, that includes checking conditions and more.

But for your half.damage, the formula is very simple - you just have to remember that a is the placeholder for the user and b the placeholder for the target. So your formula is simply:

Code:
b.hp/2
Place that in the skills damage formula and it will always deal half of the current HP of the target as damage (rounded down in case of uneven numbers)
 

Korimax

Architect of Procrastination
Veteran
Joined
Apr 3, 2013
Messages
941
Reaction score
41
First Language
English
Primarily Uses
N/A
*Sigh* I should have realized it was divided by 2, I was being a bit ignorant. (I was trying to write it out as b.hp-50%)  :guffaw:

Anyway, thank you for answering my question, any chance you might be able to answer the 2nd part. (I kinda just need to know if I need scripts or something of that nature for that really.)
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
668
Reaction score
382
First Language
English
Primarily Uses
RMMV
For the conditional, you can do an if statement in the damage formula, too. So, let's say if the target is under 30% health, then you want the ability to deal 100 damage, and otherwise, it does 50% of their current HP. For the damage formula box, do:

if (b.hp*1.0)/(b.mhp*1.0)<0.3;x=100;else;x=b.hp/2;end;xThe reason you're multiplying b.hp and b.mhp by 1.0 is because, by default, the engine will ignore any decimals and just return the integer, but if you tell it to multiply by 1.0 first, then it will read decimals properly (so without the 1.0, b.hp/b.mhp will always return 0). So it will divide the target's HP by the target's max HP, and give you a decimal (your percentage of health remaining). If it's less than 0.3 (or less than 30%, for this example), then it sets a variable x equal to 100. Otherwise, x will equal half the target's current HP (b.hp/2). It will then do X damage.
 
Last edited by a moderator:
  • Like
Reactions: BCj

Korimax

Architect of Procrastination
Veteran
Joined
Apr 3, 2013
Messages
941
Reaction score
41
First Language
English
Primarily Uses
N/A
THANK You so much. (That was actually quite easy to understand.)

Anyway I dunno if these threads get closed but my question has been answered.  :p
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,229
First Language
English
Primarily Uses
RMMV
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.

Latest Threads

Latest Posts

Latest Profile Posts

Day 2 of my redesign journey, as a follow up from the previous post :kaothx:
pXiRJSm.jpg

This is Cedric's son, Apollo!
New pet peeve: Telling tech support personnel what something is doing, only for them to tell me (in excessively condescending tones) what it should be doing. Yes, I know what it should be doing, and if it was doing that, I wouldn’t be talking to you and your attitude problem about it right now, would I? >.<
uglywolf wrote on Khulse's profile.
Hello.
The rules I makes pun about on your last thread is about "Verify Files" before anything else, if the stuff comes from STEAM. Which means, if it could be fixed with just that, there is no need to redownload the whole stuff.
But glad the reinstall worked, hope you enjoy it and your days too.
uh oh, I just tapped into a fresh, deep vein of nightmare fuel right here guys:

Forum statistics

Threads
115,430
Messages
1,089,798
Members
150,186
Latest member
DarkPurplePrince
Top