How do I disable TP gain from damage in specific fights?

8ManStudio

Villager
Member
Joined
Jan 22, 2017
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
So what I want to do is make it so that you do not gain TP from being hit, but only during specific fights.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I think you will need a script. In order for someone to write one, if you can't do it yourself, you will need to provide more information. How will you identify which battles will allow TP gain and which ones won't?

Are you using random battles or evented battles (via the Battle Processing event command) or a combination of the two?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
It generally just make TP charge rate zero from the damage which is fairly easy. But Shaz said the problem. In which fight you want the TP not getting charged
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
just make TP charge rate zero from the damage
How do you do that? Can you control TP rate using a status? Maybe just apply that status to all actors prior to the battles where you don't want them to use/gain TP, and remove it afterwards (assumes those battles are called via events and are not random encounters). Although every battle gives them a random amount of TP to start with, so they wouldn't necessarily have NO TP during the battle - that would still require a script mod to change.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
At first I was thinking of using states effect, but the OP specifically mention from the damage (not from item use). So modifying TCR aint gonna work here. Instead, a simple solution would be
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
    return if a_specific_condition_is_true
    self.tp += 50 * damage_rate * tcr
  end
end
Could be switch or anything

Edit: I'm thinking if the condition itself would be better if it's based on troop id because OP also mentioned a specific fight which I'm sure it's not a random encounter
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You could use a switch and it could be turned on prior to the call to battle, and turned off again after. So your line would simply be:
Code:
return if $game_switches[15]
if you wanted to use switch 15 for this on/off setting.

Doesn't item use still call charge_tp_by_damage though? I made the assumption the OP just didn't want any TP gain during those specific battles.
 

8ManStudio

Villager
Member
Joined
Jan 22, 2017
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
At first I was thinking of using states effect, but the OP specifically mention from the damage (not from item use). So modifying TCR aint gonna work here. Instead, a simple solution would be
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
    return if a_specific_condition_is_true
    self.tp += 50 * damage_rate * tcr
  end
end
Could be switch or anything

Edit: I'm thinking if the condition itself would be better if it's based on troop id because OP also mentioned a specific fight which I'm sure it's not a random encounter
I don't know what to do with this code...
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@8ManStudio You copy it, then open your Script Editor, either by clicking on the icon on the Menu bar at the top of the Editor or by using F11. Scroll down the list of scripts until you come to 'Materials'. Insert a new line, above 'Main' name it clearly so that you know what it is (e.g. TP Gain control) and paste it in the panel on the right. All scripts go below Materials but above Main.

However, I'd wait until the discussion between Shaz and TheoAllen is finished because the snippet might get modified as a result, e.g. if it is going to use a switch or not.

[move]RGSS3 Script Requests[/move]
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
You could use a switch and it could be turned on prior to the call to battle, and turned off again after
Yeah, this works better for public use because ppl understand switch better than editing script

Doesn't item use still call charge_tp_by_damage though?
charge_tp_by_damage only being called in target where the item/skill applied.
you might confused with the TP gain where it's being called in the item/skill user

I made the assumption the OP just didn't want any TP gain during those specific battles.
Let's ask the OP for clarification then
@8ManStudio do you only want the disable TP gain from damage only? or all the other sources as well like TP gain from item?
 

8ManStudio

Villager
Member
Joined
Jan 22, 2017
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Let's ask the OP for clarification then
@8ManStudio do you only want the disable TP gain from damage only? or all the other sources as well like TP gain from item?
I only want to disable TP gain from damage.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
I only want to disable TP gain from damage.
Then insert this script
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
   return if $game_switches[15] #<-- change switch ID here
   self.tp += 50 * damage_rate * tcr
  end
end
To disable TP gain from damage, turn on the switch 15 (you can change it)
 

8ManStudio

Villager
Member
Joined
Jan 22, 2017
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Then insert this script
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
   return if $game_switches[15] #<-- change switch ID here
   self.tp += 50 * damage_rate * tcr
  end
end
To disable TP gain from damage, turn on the switch 15 (you can change it)
Do I enable this switch before or during battle?
Edit: I just tested it, you activate the switch before battle and it works perfectly.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
yep, turn it on before the battle, and off again after, otherwise it will affect future battles as well.
 

8ManStudio

Villager
Member
Joined
Jan 22, 2017
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
yep, turn it on before the battle, and off again after, otherwise it will affect future battles as well.
Thanks Shaz this will probably prevent me from becoming really confused in the future.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top