How to make the most of custom formulae. Part #1

I've been away from my computer for several hours, so can only reply now.

If I am using $game_player.region_id  would it be something like

$game_player.region_62 ?  b.add_state(49); end; damage_formula_here : damage_formula_here

or 

 $game_player.region_62 ?  b.add_state(49); damage_formula_here : damage_formula_here
None... The script call is

$game_map.region_id(x,y) you supply x,y of the player and id is well dont change it, its part of the method name... It checks what region the x,y belongs to... You dont supply the region to it

As I've written beforez you use it by

$game_map.region_id($game_player.x,$game_player.y) == 62
Sadly, though, that script call is too long for the damage formula box.  By the time I've put in the b.add_state, plus the first damage formula, I'm at the end, with no space to do the formula for when the player is not on that region.

I assume that it will need a custom formula snippet which I can then call up from the formula box, but I don't know how to construct it.  Given the info in my last post, plus this script call, what would that snippet be?

Thanks.
b.add_state(49) if $game_player.region_id == 62;damage_formula_here
@Xypher

That works perfectly.

Thank you very much.
I want to make a skill where if the player nets a KO, he gets a bonus, of sorts (a buff, healing, etc.).  I know you can check state, erase state, and such, but is this possible with formulas alone?
You could check if the damage will be enough to kill the target, but the damage you can check is only the one before other things such as critixal is added so its not good... If you want a good metjod, you'd need custom scripts... For starters, once the damage is computed, data about the user is already gone so ypu'd need to edit the scripts to keep it...
I think that should be possible with a common event. Basically what you want it to do is keep score of enemy hp's per enemy and who's turn it is.

I don't have access to my rpg maker atm. But I think I could manage to create this. I'll have a look later.
I'm working on a skill that encourages "streaking." To this end, the weapon applies a state every turn that increases a variable. That variable is part of damage calculation. However, this

a.add_state(67);(((a.atk*$game_variables[60])/(b.def*1.4))*((100-rand(16))/100.0)*(a.atk*1.5);doesn't work, but only when I add the $game_variables[60]. Have I set this up incorrectly?

Edit: Sorry, didn't clarify. I get an unexpected end error. Expecting ).
Code:
a.add_state(67);(((a.atk*$game_variables[60])/(b.def*1.4))*((100-rand(16))/100.0)*(a.atk*1.5);
Edit: Sorry, didn't clarify. I get an unexpected end error. Expecting ).
That is because you have forgotten to close every bracket - count the (, one of them is missing the ).
That is because you have forgotten to close every bracket - count the (, one of them is missing the ).
Gah! I was so careful about that, too. Ugh. Thank you very much.
I need this tutorial for MV!
Thanks for this, it is very helpful.  Here is a formula I wrote up (simplified i guess) for an attack that does more damage the lower the user's health is.  I'm testing it in game but just wanted more opinions as to whether this looks right or not.

(a.mhp - a.hp) * 3 - b.def * 2
@gekigenar

Search is your friend.  The main one is here http://forums.rpgmakerweb.com/index.php?/topic/47099-rmmv-damage-formula-ideas-and-help

Put the term  

damage formula  

into the search box on the MV forum and you will get a load of issues specific threads as well.

@saulthemercenary

Without testing it looks like it should work okay.  There are other options which would scale it smoothly e.g. 1% increase in damage for each 1% reduction in HP.  That would look like this.

[SIZE=10.5pt]a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/a.mhp)[/SIZE]

[SIZE=10.5pt][/SIZE]

[SIZE=10.5pt]If you wanted a different percentage change, just alter the ending.  So for a 1% increase in damage for each 2% reduction in HP it would be[/SIZE]

a.atk *4 - b.def * 2 + ((a.atk*4 - b.def * 2) * (a.mhp - a.hp)/(a.mhp/0.5))

[SIZE=10.5pt][/SIZE]
Is there a way to make a move only work if the target is at low health?  (Say 10% or less health)
Is there a way to make a move only work if the target is at low health?  (Say 10% or less health)
Yes, kind of. Say it's a damage move, like a finisher, right?

Execute - Attempt to finish off a heavily wounded enemy.

if (b.MHP/10)>b.HP; damage formula; else; the no bueno formula; end;

Someone feel free to correct me if I'm wrong about that formatting.

You can even use this to make a move that deals a base amount of damage, but bonus damage to a weak target 🙂
How can I make a skill that if the user's HP is at 50% will raise the damage that user does?

I did it this way but it didn't work:

a.hp <= (a.hp / 50) ? a.atk * 15 : a.atk * 6
a.hp will never be <= a.hp / 50


You need to look at hp_rate, which shows the current hp as a percentage of maximum hp, and I THINK is in the range of 0 to 1. So hp <= 50% would be hp_rate <= 0.5
a.hp will never be <= a.hp / 50

You need to look at hp_rate, which shows the current hp as a percentage of maximum hp, and I THINK is in the range of 0 to 1. So hp <= 50% would be hp_rate <= 0.5
Now it makes more sense. I didn't knew the "hp_rate" thing. Maybe now will work. But I saw a comment somewhere on this topic with this thing: "(a.mhp - a.hp) * 3" It's interesting. As the lower the user's HP, the more damage it will do. So doing it this way: a.atk * 4 - b.def * 2 + (a.mhp - a.hp) * 3 will be an attack with basic damage that does more if HP of user is lower! Well, I'll consider using your formula too! Thanks for the help!
What about a skill that becomes stronger as the battle goes on? Like, does 20 damage on turn one, 50 damage on turn 5, 100 damage on turn 10, etc.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-the-most-of-custom-formulae-part-1.1143/