[VX ACE] TP RATE
Posts
Pages:
1
I think this might actually be the last problem remaining in the scripts I haven't personally touched, so I apologize for posting all these topics at once. I didn't like TP being always out of 100 so I downloaded and plugged in this script
But the Calculate TP percentage correctly part just doesn't work. Even though my Max_TP is fine and I can set the Init_TP fine as well, I have no idea what I should be putting to make TP_Rate scale correctly. It doesn't matter whether my Actor has 500 or 50 max TP, he always regens 10 per turn with a TRG of 10%.
#============================================================================== # Action Point System v1.0 (16/02/2013) #============================================================================== # AUTHOR: # esrann (sakari.rannikko@gmail.com) # # Feel free to adapt to your own needs. Give credit if you want. #-------------------------------------------------------------------------- # DESCRIPTION: # This snippet allows you to set up a formula for calculating actor's # maximum TP (default formula: Actor TP = Actor AGI divided by 2). # Also the TP is set to 100% at battle start (unless Preserve TP is enabled). #-------------------------------------------------------------------------- # USAGE: # Can be used to create for example an Action Point System: # - Set battle commands to reduce TP # - When out of TP in battle, use item/skill to restore points. # (for example, set 'Wait' skill to restore TP) #-------------------------------------------------------------------------- # INSTALLATION: # Install this script in the Materials section in your project's # script editor. #============================================================================== #============================================================================== # ++ Game_BattlerBase #============================================================================== class Game_BattlerBase #-------------------------------------------------------------------------- # alias : max_tp | Calculate maximum TP using a formula #-------------------------------------------------------------------------- alias esrann_max_tp max_tp def max_tp esrann_max_tp # alias self.mmp / 2 # edit this formula end #-------------------------------------------------------------------------- # alias: tp_rate | Calculate TP percentage correctly #-------------------------------------------------------------------------- alias esrann_tp_rate tp_rate def tp_rate esrann_tp_rate # alias @tp.to_f / max_tp end end # class Game_BattlerBase #============================================================================== # ++ Game_Battler #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # alias : init_tp | Set initial TP to maximum #-------------------------------------------------------------------------- alias esrann_init_tp init_tp def init_tp esrann_init_tp # alias self.tp = max_tp / 4 end end # class Game_Battler
But the Calculate TP percentage correctly part just doesn't work. Even though my Max_TP is fine and I can set the Init_TP fine as well, I have no idea what I should be putting to make TP_Rate scale correctly. It doesn't matter whether my Actor has 500 or 50 max TP, he always regens 10 per turn with a TRG of 10%.
I figure it's a good place to start off with how the default functionality works. In Game_BattlerBase there's this.
A bit further up, there's this code:
Call me crazy, but it occurs to me that maybe, just maybe, you might be able to change the "100" in the first function to "esrann_max_tp".
*Edit: Nevermind. This is more or less exactly what you did. I didn't catch the "alias"!
#-------------------------------------------------------------------------- # * Get Percentage of TP #-------------------------------------------------------------------------- def tp_rate @tp.to_f / 100 end
A bit further up, there's this code:
#-------------------------------------------------------------------------- # * Get Maximum Value of TP #-------------------------------------------------------------------------- def max_tp return 100 end
Call me crazy, but it occurs to me that maybe, just maybe, you might be able to change the "100" in the first function to "esrann_max_tp".
*Edit: Nevermind. This is more or less exactly what you did. I didn't catch the "alias"!
TP_Rate's use is for drawing the % of TP an actor has, not for how much they gain per turn. You want to look at regenerate_tp, line 769 of Game_Battler. By default it adds 100 * TP Regeneration Rate, so 10 TP when they have a TP Regen Rate of 10%. Change that 100 to max_tp should do the trick.
You are my hero and I love you.
EDIT: Okay that worked great for regenerating TP, but not TP Gain percents. What would I need to do to get this to work?
EDIT: Okay that worked great for regenerating TP, but not TP Gain percents. What would I need to do to get this to work?
#-------------------------------------------------------------------------- # * [TP Gain] Effect #-------------------------------------------------------------------------- def item_effect_gain_tp(user, item, effect) value = effect.value1.to_i @result.tp_damage -= value @result.success = true if value != 0 self.tp += value end
I'm at work so I can't confirm but I'd bet that effect.value is just the % to add * 100 so it'll work if TP is 100. I'd try changing the value = line to
value = ((effect.value1.to_f / 100) * max_tp).to_i
Unfortunately I can confirm that does not work, even if it would very much seem to. A 10% TP gain effect on an attack is still always a flat 10 TP no matter what.
That's strange, I just tested it on a test project and got it to work for me. Did you save the project after making the script changes?
Here's my test project. Start a test fight and use the TP Tonic. MaxTP is set to 500 and the tonic restores 5% of that so it increases TP by 25.
Here's my test project. Start a test fight and use the TP Tonic. MaxTP is set to 500 and the tonic restores 5% of that so it increases TP by 25.
I fiddled around with it a while and it seems that the only difference was where I'd put the line. Moving it to the very bottom like you did seems to have fixed it, which was strange because defining the regeneration rate with max_tp because the custom max_tp was defined actually worked fine. Mind boggling, but it works now, so thank you a ton!
Pages:
1















