public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

Call script TP lock to certain max amount.

BMM_Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: Call script TP lock to certain max amount.
  • Original author: Fridjah
  • Original date: October 10, 2015
  • Source thread: https://forums.rpgmakerweb.com/threads/call-script-tp-lock-to-certain-max-amount.45715/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support

Summary

Hello everyone! Does it exist a call script to lock TP to max15 as long as the condition is not met? More clearly: I already use this call in a commun event to prevent a party member to get 100TP when it unlocks it's 1st skill.

Archived First Post

Hello everyone!

Does it exist a call script to lock TP to max15 as long as the condition is not met?

More clearly:

I already use this call in a commun event to prevent a party member to get 100TP when it unlocks it's 1st skill.

$game_actors[12].tp=0.

Condition: actors_12 learnd the skill "Blow":

- Turn off switch "TP 12 CHECK"

if not:

- $game_actors[12].tp=0

End of condition.

This works perfectely.

Now, I wish for another party member to lock it's TPmax to 15 as long its skill "Frozen Bite" is not learned.

This member already has a skill, but only 5 TP to use it and not offensive. So, I dont want that member to be

able to reach 100TP and spam its new skill, cause it will be too easy.

Condition: actors_11 learnd the skill "Frost Bite":

- $game_actors[11].tpmax=100           #caped at 15 TP and finaly able to reach 100 TP#

- Turn off switch "TP 11 CHECK"

if not:

- if $game_actors[11].tp>15  -->  $game_actors[11].tp=15   

#Check after fight if need to adjust the TP if over 15 ( I wonder if it possible to call it in a condition page IN-BATTLE#

End of condition.

I know this call script do not work like that. It's just to show my guesses.

Thanks in advence.

EDIT: I tried this Tsukihime's script, but I'm getting error:

=begin============================================================================== ** TP Levels Author: Hime Version: 1.1 Date: May 19, 2012------------------------------------------------------------------------------ ** Change log 1.1 May 20 -Added TP Levels 1.0 May 19 -Initial release------------------------------------------------------------------------------ Change how much max TP you can have based on level Change how much damage you take based on how much TP you consume Your TP Level determines the skill cost and skill damage. You can increase or decrease your TP level by pressing the A and S keys. For skills that should use more than 100 TP, tag the skill with <tp: n> For some integer n <tp-gain: n> If you want a skill to gain more than 100 TP at a time The following script calls will change the max TP tpmax_set(amount, actor_id) tpmax_up(amount, actor_id) tpmax_down(amount, actor_id)===============================================================================end$imported = {} if $imported.nil?$imported["Tsuki_TPLevels"] = true#==============================================================================# ** Configuration. #==============================================================================module Tsuki module TP_Levels # Default Max TP Default_Max_TP = 100 Max_TP_Level = 5 Min_TP_Level = 1 Power_Up_Key = :X Power_Down_Key = :Y # Max amount of TP you can have per level TP_Table = {1 => Default_Max_TP, 2 => 200, 30 => 500, 40 => 1000 } # % extra TP to spend per TP power-level TP_Cost = "(level - 1) * 2" TP_Damage = "(level - 1) * 2" TP_Regex = /<tp:?\s*(\d+)\s*>/ TP_Gain_Regex = /<tp-gain:?\s*(\d+)\s*>/ endend#==============================================================================# ** Rest of the Script#==============================================================================module RPG class Skill < UsableItem include Tsuki::TP_Levels attr_reader :tp_power def load_notetags_tp_levels @tp_power = self.tp_cost > 0 ? true : false matches = TP_Regex.match(self.note) if matches @tp_cost = [matches[1].to_i, 0].max end matches = TP_Gain_Regex.match(self.note) if matches @tp_gain = [matches[1].to_i, 0].max end end endendmodule DataManager class << self alias :tp_levels_load_database :load_database alias :tp_levels_init :init end def self.init tp_levels_init load_notetags_tp_levels end def self.load_database tp_levels_load_database if $BTEST load_notetags_tp_levels end end def self.load_notetags_tp_levels groups = [$data_skills] for group in groups for obj in group next if obj.nil? obj.load_notetags_tp_levels end end endendclass Game_BattlerBase include Tsuki::TP_Levels attr_reader :tp_level alias :th_tp_levels_init_bbase :initialize def initialize th_tp_levels_init_bbase clear_tp_level end alias :th_tp_levels_skill_tp_cost :skill_tp_cost def skill_tp_cost(skill) if skill.tp_power (tp_multiplier(TP_Cost, @tp_level) * th_tp_levels_skill_tp_cost(skill)).ceil else th_tp_levels_skill_tp_cost(skill) end end def tp_multiplier(formula, level) [eval(TP_Cost), 1].max rescue 1 end def tp_level_up @tp_level = [@tp_level + 1, Max_TP_Level].min end def tp_level_down @tp_level = [@tp_level - 1, Min_TP_Level].max end def clear_tp_level @tp_level = 1 endendclass Game_Battler < Game_BattlerBase def apply_tp_modifier(user, item, damage) if item.is_a?(RPG::Skill) && item.tp_power damage * tp_multiplier(TP_Damage, user.tp_level) else damage end end # rewrite... def make_damage_value(user, item) value = item.damage.eval(user, self, $game_variables) value *= item_element_rate(user, item) value *= pdr if item.physical? value *= mdr if item.magical? value *= rec if item.damage.recover? value = apply_critical(value) if @result.critical value = apply_variance(value, item.damage.variance) value = apply_guard(value) value = apply_tp_modifier(user, item, value) @result.make_damage(value.to_i, item) end alias :th_tp_level_on_battle_end n_battle_end def on_battle_end th_tp_level_on_battle_end clear_tp_level endendclass Game_Actor alias :th_tp_levels_setup_actor :setup def setup(actor_id) th_tp_levels_setup_actor(actor_id) get_max_tp end alias :th_tp_levels_level_up :level_up def level_up th_tp_levels_level_up get_max_tp end alias :th_tp_levels_level_down :level_down def level_down th_tp_levels_level_down get_max_tp end def get_max_tp new_tp = Default_Max_TP TP_Table.each do |level, max_tp| new_tp = max_tp if @level >= level end @max_tp = new_tp end def tp_rate @tp.to_f / max_tp end def max_tp return @max_tp end def increase_max_tp(amount) @max_tp += amount end def decrease_max_tp(amount) @max_tp = [@max_tp, 0].max end def set_max_tp(amount) @max_tp = amount endendclass Game_Interpreter def maxtp_set(amount, actor_id=1) $game_actors[actor_id].set_max_tp(amount) end def maxtp_up(amount, actor_id=1) $game_actors[actor_id].increase_max_tp(amount) end def maxtp_down(amount, actor_id=1) $game_actors[actor_id].decrease_max_tp(amount) endendclass Scene_Battle < Scene_Base alias :th_tp_level_create_skill_window :create_skill_window def create_skill_window th_tp_level_create_skill_window @skill_window.set_handlerX, methodtp_level_down)) @skill_window.set_handlerY, methodtp_level_up)) end def tp_level_down BattleManager.actor.tp_level_down @skill_window.refresh @skill_window.activate end def tp_level_up BattleManager.actor.tp_level_up @skill_window.refresh @skill_window.activate endendclass Window_BattleSkill < Window_SkillList include Tsuki::TP_Levels def process_handling return unless open? && active return process_x if Input.trigger?(Power_Up_Key) && handle?X) return process_y if Input.trigger?(Power_Down_Key) && handle?Y) return super end def process_x Sound.play_cursor Input.update deactivate call_handlerX) end def process_y Sound.play_cursor Input.update deactivate call_handlerY) endend
Protected download

Protected download

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

Referenced Images / Attachments

Event. com.png
Event. com.png
Error.png
Error.png
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#caped#check#rpg-maker-archive#rgss-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar