[VX Ace] Changing TP charge by damage formula

Status
Not open for further replies.

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello. I'd like to change TP charge formula when target receives damage. The idea is basically the same, but adding LUK to the formula. For example, if the user has 20 of LUK, the TP gained would be a 20% of the original formula. Does someone know how to change this? Thank you
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,052
Reaction score
7,143
First Language
Indonesian
Primarily Uses
RMVXA
There should be a plenty of TP Manager script around the internet. Have you tried to search them?
I don't know if any of them allows you to create a custom formula, but if no one suits your need, it should be easy for anyone to make
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
There should be a plenty of TP Manager script around the internet. Have you tried to search them?
I don't know if any of them allows you to create a custom formula, but if no one suits your need, it should be easy for anyone to make

I used Dekita's Statistic Formulas script (because I'm using his stats menu script as well) and there is a problem: It doesn't let me to multiplicate base (TCR) by the formula I want to (in this case LUK / 100.0), it adds it so if, for example, my character has 20 of LUK the TCR is 120% instead of 20% (assuming of course base TCR is the default of 100%)
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,052
Reaction score
7,143
First Language
Indonesian
Primarily Uses
RMVXA
That dekita's scripts looks complex, i have no idea what's going on there.
But anyway, you can try to edit yourself, here (taken from default script)
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
    self.tp += 50 * damage_rate * tcr # <-- edit here
  end
end
Explanation :
  • 50 is the base TP
  • damage rate is how much you take the damage based on your max HP. The value ranged from 0.0 to 1.0. If an enemy deals 50% of your max HP, then it's 0.5. By that means, you will generate 25 TP from taking 50% from your max HP
  • TCR is the TP Charge Rate. The default value is 1.0 unless you changed it from the database
Now you want to add luck (or maybe want to completely remove TCR, is up to you). The formula would be
Code:
 self.tp += 50 * damage_rate * tcr * (luk/100.0)
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Thank you, it works, it can be closed now
 

Ms Littlefish

Dangerously Caffeinated
Global Mod
Joined
Jan 15, 2014
Messages
6,417
Reaction score
8,107
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

No internet for 2 weeks. Thank goodness for phones. :kaoluv:
Megumi_Aramaki wrote on Takeshi014's profile.
Here you go! Enjoy mapping!
Megumi_Aramaki wrote on Takeshi014's profile.
Valley can be done by outside mountain town tilesets I will send you right away!
Hi everyone! I've relased a demo about my new game in "Games in Development". Someone interested? :3
Going live at 2pm EST

Forum statistics

Threads
109,043
Messages
1,041,572
Members
141,530
Latest member
jno8034
Top