[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,446
Reaction score
6,259
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,446
Reaction score
6,259
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,450
Reaction score
8,226
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.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Finally did a test of sorts for the opening of my game... ... including this shot here.
My current status!?
It might be... QUAKE!!! :o
At least that was true several hours ago. :p
Quexp wrote on Shaz's profile.
I absolutely love your profile/pic! :kaoluv:
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
I made a battle results screen for my minigame.. any feedback? :)

Forum statistics

Threads
100,686
Messages
978,416
Members
132,310
Latest member
hnhat
Top