Hello, everyone. I hope this hasn't been answered elsewhere. I would like to disable any TP gain from taking damage in my game. Can anyone let me know how I can achieve that?
How to stop TP gain from taking damage in combat
RPG Maker MV SupportDo you mean you want to disable TP altogether? Remove it from your game? In that case, there's a Disable TP in Battle option in the System tab.
No, just to disable TP gain when taking damage. I'm using it as a sort of ammo-like tracked resource, so I don't want it to vanish completely. I just want it to only be restored through the use of very specific skills or items.
A plugin to more directly alter TP may be necessary - at the moment those formulae seem wrapped up somewhere not easily accessible. Obviously they can be, but I havent found a way yet. Until it can be, it's something that feels too at the original developer's mercy to want to touch too in depth.
Honestly surprised there isn't a plugin to directly control TP gain yet (heck, I'm downright disappointed that isn't something built into the editor out of the box; you'd think they would know by now that makers hate being force-fed mechanics they have no control over). That was one of the first things I changed in my VX Ace project, and I kinda can't imagine my project without it; it's just so essential to my battle system.
How are they going to gain TP if not from damage?
Unless I'm mistaken, practically any act gains TP. Guarding, attacking, etc.
The code in rpg_objects.js that charges TP when damaged is
Game_Battler.prototype.onDamage = function(value) { this.removeStatesByDamage(); this.chargeTpByDamage(value / this.mhp);};All you have to do is create a new plugin that has this code:
Game_Battler.prototype.onDamage = function(value) { this.removeStatesByDamage();};As you can see, it's just a matter of leaving out the line that charges TP on damage. Alternatively, you can edit rpg_objects.js directly and delete that chargeTPByDamage line.
Game_Battler.prototype.onDamage = function(value) { this.removeStatesByDamage(); this.chargeTpByDamage(value / this.mhp);};All you have to do is create a new plugin that has this code:
Game_Battler.prototype.onDamage = function(value) { this.removeStatesByDamage();};As you can see, it's just a matter of leaving out the line that charges TP on damage. Alternatively, you can edit rpg_objects.js directly and delete that chargeTPByDamage line.
Thanks Otaku, that worked for me! Do you know how you can make it start off TP at 0 when the battle begins? I can't seem to find it.
Nevermind, I just commented out this line in the same document and it seemed to do the trick:
Game_Battler.prototype.initTp = function() { /* this.setTp(Math.randomInt(25)); */};In case someone else wants to do that.
Nevermind, I just commented out this line in the same document and it seemed to do the trick:
Game_Battler.prototype.initTp = function() { /* this.setTp(Math.randomInt(25)); */};In case someone else wants to do that.
Many thanks, Otaku, that seems to have done it! Hope a plugin comes along to allow more manipulation of TP in the future, but this will do for now.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-stop-tp-gain-from-taking-damage-in-combat.47088/