Formula for Yanfly TP Manager

http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/tp-manager/

I would like to give 10 tp when a specific state is inflicted upon the enemy.

This doesnt work at all 🙁

        :deal_state  => "if b.state?(48);10;end",

      3 => { # New TP mode!
      # :setting     => Adjust settings as you see fit.
        :name        => "Ninergy",
        :icon        => 102,
        :description => "Energy regenerates per turn and each time you dodge.",
        😛reserve_tp => false,
        :init_tp     => "100",
        :regen_tp    => "10",
        :take_hp_dmg => "0",
        :deal_hp_dmg => "0",
        :heal_hp_dmg => "0",
        :ally_hp_dmg => "0",
        :take_mp_dmg => "0",
        :deal_mp_dmg => "0",
        :heal_mp_dmg => "0",
        :ally_mp_dmg => "0",
        :deal_state  => "if state?(48);10;end",
        :gain_state  => "0",
        :kill_ally   => "0",
        :kill_enemy  => "0",
        :win_battle  => "0",
        :flee_battle => "0",
        :lose_battle => "0",
        :low_hp_turn => "0",
        :low_mp_turn => "0",
        😮nly_alive  => "0",
        :evasion     => "5",
        :critical    => "0",
      }, # Do not remove this.
 Hmm,what does this script do or better yet suppose to do?
It defines how a characters tp system works. What I would like it to do is increase tp by 10 when the character inflicts state 48
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Noob question, TP??
Noob question, TP??
TP (short for Techpoints) is one of the three point values (HP, MP, TP) in the game, usually used to pay for non-magic skill costs.

In default, it has a lot of special behaviours different from MP implemented (like gaining TP by being damaged), so quite a lot of developers are looking for ways to change/control those fixed default rules by using scripts.
I think it's because it doesn't know which battler to check the state for or it might simply be because the state isn't there yet when the check is done...

Also, if you get it to find the correct actor, it might work too if you inflict a different state to a battler that has state 48 because the state? method simply checks if the battler/actor/enemy has the state or not... so to make a workaround, I think you need to understand when the :deal_state method is run...
Yanfly's tp manager does not work the way you are thinking that it does. what it is expecting where you've placed "if b.state?(48);10;end" is either an integer or a formula to determine how much tp an actor gains when inflicting any state to an enemy. It's not set up to be determined by single states. If you wan't to alter it to recognize only certain states you'll have to edit the script itself. I believe it's right here that needs to be edited:

  alias game_battler_item_effect_add_state_tpm item_effect_add_state
  def item_effect_add_state(user, item, effect)
    original_states = states.clone
    game_battler_item_effect_add_state_tpm(user, item, effect)
    return unless $game_party.in_battle
    if original_states != states && opponents_unit.members.include?(user)
      user.tp += eval(user.tp_setting🙂deal_state))
      self.tp += eval(tp_setting🙂gain_state))
    end
  end

I don't have the scripting knowledge to get that working though, you might actually do better just asking for a snippet that allows for actors to gain tp when they inflict specific states on enemies however, as you'd lose the functionality already in yanfly's script by changing it.
so my idea is right, you need to modify the script to add that capability...

hmmmmm... it's quite simple... somebody else might do it for you, I can't for I'm busy...

Original thread: https://forums.rpgmakerweb.com/threads/formula-for-yanfly-tp-manager.19098/