Game Development Reference
In-Depth Information
play-testing an altered tp cap will promptly reveal that the bar still fills up as if the party member had a cap of
100 tp. to correct this graphical hiccup, you'll want to take a look at tp_rate (line 529 of Game_Battler ) and change the
denominator in the expression to the same value as your maximum tp cap.
Note
Also, if you increase the TP cap and then try to use the TP Gain effect, you'll find that you still get the same
amount of TP, despite the fact that the amount should change, based on the new cap. How can we rectify this? Go to
the Script Editor and run a search for “effects.” The fifth entry should read as follows:
Game_Battler(10): # * Constants (Effects)
Clicking it will take you to a list of effects, as used in the Database and defined by RMVXA. The TP Gain effect is
governed by EFFECT_GAIN_TP . Let's keep going down this rabbit hole. Run another search using EFFECT_GAIN_TP as
the term to find. This time, the second result is the one we want. It takes us to line 550 of Game_Battler , where we see
that EFFECT_GAIN_TP calls a method named item_effect_gain_tp . Guess what we're searching for next?
this process of tracking down code may seem silly and/or inefficient, but it's an awesome way to figure out
how rMVxa handles the many things that make it tick.
Note
A search for item_effect_gain_tp returns only two results. The first one is the very code we're looking at right
now. As it so happens, the other is the method code for item_effect_gain_tp .
#--------------------------------------------------------------------------
# * [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
The first line defines the recovery value gained through the TP Gain effect. Value will always be a number
between 1 and 100. You'll want to apply a multiplier to the variable assignment, so that it correlates correctly with
your newly changed cap. Following are three examples. Keep in mind that we are working with values expressed in
percentages.
(effect.value1.to_i)*0.5
(effect.value1.to_i)*2
(effect.value1.to_i)*10
The first expression is appropriate for a TP cap of 50. The second expression is appropriate for a cap of 200; the
last is used for a cap of 1000.
 
 
Search WWH ::




Custom Search