Formula for Yanfly TP Manager

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
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.",
        :preserve_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",
        :only_alive  => "0",
        :evasion     => "5",
        :critical    => "0",
      }, # Do not remove this.
 

The Dragon God

Indie Game Dev, Concept Artist
Veteran
Joined
Oct 16, 2013
Messages
246
Reaction score
6
First Language
English
Primarily Uses
 Hmm,what does this script do or better yet suppose to do?
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

The Dragon God

Indie Game Dev, Concept Artist
Veteran
Joined
Oct 16, 2013
Messages
246
Reaction score
6
First Language
English
Primarily Uses
Noob question, TP??
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
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.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top