[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
5,813
Reaction score
6,783
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
5,813
Reaction score
6,783
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,106
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 Profile Posts

Well.. I was going to post my randomly generated road experiments... But the new "Attach Files" on profile posts seems to be quite buggy. Also there's no more option to insert Imgur images. Highly unfortunate. Guess I'll give them a bit to fix it and go back to messing with stuff.
my first day back to working on my project and i'm pooped!! hope to get back in the rhythm soon!
I just came up with a very original RPG Idea. This is so well written that it might be the first RPG I actually finish making. (I’ve stopped all my projects halfway through development. I don’t think this one will be the same.)
Became a news junkie... except for those times I got inspired and published a chapter of any of my crazy stories. XD

Forum statistics

Threads
107,589
Messages
1,030,782
Members
139,697
Latest member
Tablo_Noir
Top