Set TP to 0 after battle, regen MP on steps?

So this may be an easy question as I have searched before. I was able to get my TP to set to 0 after battles in MV and I assume it's the same here but I can't remember how to do it. Upon searching the forums I found a page that said to open _objects and change line 3206 to this.setTP(0); However, line 3206 for me is something about item return, so I figured I would check here in case it was different for MZ.

In terms of regaining MP on steps, it's important for the flow and difficulty of my game to regenerate MP (called Energy). I thought about doing it after battles but didn't want players to cheese it by just fleeing (unless there is a way to differentiate between running and winning in terms of regening) because otherwise it would just make the Regen mechanic pointless and, in the end, tedious to just run.

Basically, TP will be used for "Breaking" abilities, where the character gains points when they take damage to use strong abilities, stronger abilities cost more Breaking Points and the player is encouraged to use Breaking in battle to conserve Energy, which is used for regular spells and abilities. I want Breaking Points (TP) to be reset after battle so my game doesn't become Overdrives from FFX where you can nuke anything immediately with powerful abilities. Breaking Abilities are powerful in my game, some may be status effects that ignore resistant (useful for bosses) or spells that deal more damage than their Energy costing counterparts. As well as the "Limit Break" costing a full 100 Breaking Points to use, hence why I want to reset them after battle.

TL;DR: Literally just the subject
TP is always set to 0 at the beginning of battles unless you add the trait Preserve TP to actors.
If you don't have the trait on, then you might have a plugin that is doing it.

The MP one will be a bit more difficult.

You can set a state that regains MP easy enough (via common event), but it will work in battles as well.

You can set MP to gain a bit after battles won, but that would require JS knowledge to edit to code a little bit.
With the MP regen, perhaps you can make a state that apply MP regen similar to poison that is removed by number of steps, and only apply it to the whole party when checking if the party has won a battle. This may be easier to achieve with some sort of plugin to run some common event when you win a battle (eg off the top of my head, visustella battlecore can do this).
@SoulBlade32 VisuStella has a plugin that lets you customize the TP regen, although it sounds what Maliki79 suggested would be enough, you don't need that much customization.
Another way to do the MP regen is a plugin that allows an event before and after battles, thus adding and removing the state every time.
@SoulBlade32 VisuStella has a plugin that lets you customize the TP regen, although it sounds what Maliki79 suggested would be enough, you don't need that much customization.
Another way to do the MP regen is a plugin that allows an event before and after battles, thus adding and removing the state every time.
Really what I am looking for, for the MP, is to have it regenerate, slowly (say a couple points) every 3 or 5 steps. From my understanding, if I used this plugin and had it use a state that regens MP, it would still activate the event when the party flees from battle? This is something I want to avoid.
I just I want make sure I understand, you want MP to recover by steps after fleeing battle as well?

1608486282365.png


There is the place to make events in the battle core for post battle, victory and escape. Whichever you intend, you would have to customize each. Make it so that the state is added after victory, and the pre-battle event makes it so the state is eliminated during battle. This was my suggestion.
I just I want make sure I understand, you want MP to recover by steps after fleeing battle as well?

View attachment 172086

There is the place to make events in the battle core for post battle, victory and escape. Whichever you intend, you would have to customize each. Make it so that the state is added after victory, and the pre-battle event makes it so the state is eliminated during battle. This was my suggestion.
Sorry, I either want MP to recover after winning a battle but not running. Or I want to be able to recover mp while walking. Thank you for all your help. Sorry I was being confusing 😛
Here's how I did an MP regen that sounds similar to what you describe. It's a parallel process that runs all the time and regenerates 1 MP every 10 steps. There are two variables. MP Regen Counter is used to store the player's step counter. Then it is modded by 10 to see if it is a multiple of 10 (remainder = 0). The Step Counted variables is used to turn off the MP gain after the players gain their +1 MP since the common event will run many times during the step that grants the party their MP gain. You can adjust this to fit your game. Hope it helps.

1608613332450.png
Here's how I did an MP regen that sounds similar to what you describe. It's a parallel process that runs all the time and regenerates 1 MP every 10 steps. There are two variables. MP Regen Counter is used to store the player's step counter. Then it is modded by 10 to see if it is a multiple of 10 (remainder = 0). The Step Counted variables is used to turn off the MP gain after the players gain their +1 MP since the common event will run many times during the step that grants the party their MP gain. You can adjust this to fit your game. Hope it helps.

View attachment 172249
Thank you so much! This is exactly what I wanted. I appreciate all the help from everyone!
Here's how I did an MP regen that sounds similar to what you describe. It's a parallel process that runs all the time and regenerates 1 MP every 10 steps. There are two variables. MP Regen Counter is used to store the player's step counter. Then it is modded by 10 to see if it is a multiple of 10 (remainder = 0). The Step Counted variables is used to turn off the MP gain after the players gain their +1 MP since the common event will run many times during the step that grants the party their MP gain. You can adjust this to fit your game. Hope it helps.
This is an incredibly clean way to handle this. I like it.
Upon searching the forums I found a page that said to open _objects and change line 3206 to this.setTP(0);

I recently saw someone say they had changed their core files, but when they deployed with the encrypted option, it used the default core files rather than their changed ones, so I would not go with that approach for ANY change.

Plus, every time there's an engine update and you apply the update to existing projects (which is now even easier with MZ as the editor has an option to do it), you have to go back and redo all of those changes. Better to pull the function into a plugin and make the change there.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/set-tp-to-0-after-battle-regen-mp-on-steps.131183/