Making Synchronized TP Without Plugins

As a guy who tinkers with how RPG Maker works, I have come up with a lot of ideas I find to be cool, and I typically like creating them without the help of plugins to see how far I can get. To be honest, I'm kind of proud and surprised I managed to do this one!

UPDATE: Thanks to @Arthran, a bug was spotted that somehow made the system work as intended, but just have some extraneous data that wasn't needed. The issue is fixed, and now said extraneous data is needed.

Synchronizing TP means that for every party member, the TP is the same, both earned and used. If member #1 has 10 TP, then so does everyone else.


Grand.

How I did this was a bit complicated and required using scripts to prevent things from getting too bloated in the variables department and less roundabout in general.

Before I get to code anything, to keep things simpler, I disabled TP Charging from skills and attacks by just giving all Actors the Sp-Parameter:
1641887457963.png


First up was a common event to start our battle commands to prevent enemy event tabs from getting big:
Screenshot 2022-01-11 154759.png

1641958144766.png

To prevent the random TP charges at the beginning, I drained the TP of all the actors in battle (though I do have the variables so that it can be every party member instead of specific actors) to 0, then activate a CE before doing a pre-battle sync, then turning on a switch that turns on constant TP Sync every turn.

1641887566968.png

A big boy. The script is pretty simple, it's just a very primitive version of level scaling for TP charging, where the actor's levels determine how much TP they contribute to the TP charge, and it's repeated for every party position. Because I didn't actually feel like learning how to and making a curve calculation, this is just what I did.

1641958315089.png

1641958345800.png

This is what is activated by the switch. In battle, it adds up the party's TP gain determined by the CE above before adding it to the party leader's, then it uses script to set the party members' TP to the party leader's every turn, thus syncing their TP.

EDIT: Adding "Turn End" as a condition in your battle page fixes the issue where TP Gain only happens after you choose your actions in battle instead of before. If you like that for some reason, don't put Turn End in.

1641887978910.png

1641888003176.png

While syncing TP every turn works fine if you aren't using any TP using skills, if you do, the TP bars get desynced, so to fix this I put this CE in in order to "reset" the leader's TP to the party member with the lowest TP, setting the other members to 0 TP, then resyncing their TP bars. This allows the usage of TP as a shared bar without having to use a plugin!


ADDENDUM: As for the "bug," I simply failed to give the Party Leader variable, an actual value. This caused it to spread TP love to the whole party instead of just the leader, which acts as a "TP Core" in this post. If you don't wish to keep the Sync TP CE, then just make it so that everyone receives TP from the TP Charge (although the Resync TP CE is still needed to prevent Skills from desyncing TP).



Now, of course there are issues/differences from standard TP. First of all, TP gain is completely static (whether that's a boon or a curse is your call). If you can figure out how to keep TP charges while keeping the bar from desyncing, then be my guest. Second, TP doesn't increase until after you've made your turn. This means that to use TP skills, you have to use wait an extra turn before you can actually use it if you're lacking in TP (FIXED. The edit explains how). Third, TP doesn't sync after skills until the skill effect is finished. It's a minor visual "bug," but it might annoy some people.

But other than that? It's a perfectly usable way of using TP to act as a shared gauge for the party, leading to better management of TP skills, if you so want. Is application cumbersome? A bit, yeah. Is it clunky? Sure. Can plugins do what I just did much better? Definitely. But this was a fun test to see the limits of RPG Maker and my own skills, and to be honest, I kind of like the result.
Moved to: MZ Tutorials
AFAIK, by default, parallel common events do not run in battle. How is your "Sync TP" parallel common event working?
AFAIK, by default, parallel common events do not run in battle. How is your "Sync TP" parallel common event working?
Good question. I'm not too sure myself, but I can gander a guess. Something like, parallel common events are active in conjunction with battle events, so since the active page I have in battle events activates every turn, so does the common event.

It sounds correct to me from the little bit of messing about your question prompted me to do, but I'm not 100% sure if it's correct.
Something like, parallel common events are active in conjunction with battle events, so since the active page I have in battle events activates every turn, so does the common event.
That shouldn't be the case. Are you certain that you don't have any plugins that could be affecting this behavior, and that you aren't manually calling the common event somewhere?
That shouldn't be the case. Are you certain that you don't have any plugins that could be affecting this behavior, and that you aren't manually calling the common event somewhere?
No, not really. (Misread.) I'm pretty sure that there's nothing like that going on.
1641945361218.png

As you can see, my plugin list is completely blank for the project I use for this stuff.
1641945421300.png

1641945432684.png
1641945490336.png

None of the code I use for the battle tests have any reference to the CE either.
Weird. Sorry to be a pain, but I don't suppose you'd be willing to upload a sample project somewhere, if you get time? I'm not doubting you. I'm just trying to figure out why parallel common events behave differently for you than they do for me.
Weird. Sorry to be a pain, but I don't suppose you'd be willing to upload a sample project somewhere, if you get time? I'm not doubting you. I'm just trying to figure out why parallel common events behave differently for you than they do for me.
No worries, I figured that you asking questions were worthwhile. I guess my copy is just full of black magic.

I can send you a download link to a project with just the Synced TP via PM, if you want. I confirm that the skeleton copy's Synced TP works just fine.
No worries, I figured that you asking questions were worthwhile. I guess my copy is just full of black magic.

I can send you a download link to a project with just the Synced TP via PM, if you want. I confirm that the skeleton copy's Synced TP works just fine.
Please do, and thanks.
Well, I've checked it out, and I've got both good news and bad news. The bad news is that I have verified that the Sync TP parallel common event is *not* running at any point. The good news is that I have figured out what *is* happening.

The reason that it looks like the synchronization is occurring is because of your Troop Event:

Code:
◆Control Variables:#0013 Total Party TP Gain = Party #1 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #2 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #3 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #4 TP Gain
◆Change TP:{Party Leader}, + {Total Party TP Gain}

You're using the {Party Leader} variable inside your Change TP command, but you never actually assigned a value to that variable, so it's just being read as 0. The issue is that there is no such thing as actor 0--the list of actors starts at 1. The engine is set up so that if you use the value 0 in that command, it will change the TP of the whole party.

So it looks like the actors are getting synced, but that's just because their TP all has the same starting value, and then you're adding the exact same value to each of them every time. If that makes sense.

You can fix this by assigning the actor ID of the party leader to your {Party Leader} variable before the first time you use it in your Battle Start Commands CE. And then change the Sync TP CE so that it's regular, instead of parallel, and then just manually call it when you need it (once at the end of Battle Start Commands, and once at the end of page 2 on your Troop Event). You don't actually need it to be parallel anyway, and it's actually better if it's not--because you don't want it to be constantly running while you're outside of battle, especially since it doesn't have a Wait in it to slow it down a little.

But interestingly enough, I don't think it actually matters. In terms of functionality, I think your accident actually wound up yielding the same results as it would if things were working as you intended. In this particular situation, there's not really a difference between adding a value to the party leader's TP and then syncing everybody elses, compared to simply adding that value to everybody at the same time. So you don't actually even need to fix it. But if you don't, then I recommend deleting the Sync TP CE, or at least change it so it's not parallel, because you're turning that switch on, but then never turning it back off, so it would be constantly running while you're outside of battle despite the fact that it's never actually serving a purpose.
Well, I've checked it out, and I've got both good news and bad news. The bad news is that I have verified that the Sync TP parallel common event is *not* running at any point. The good news is that I have figured out what *is* happening.

The reason that it looks like the synchronization is occurring is because of your Troop Event:

Code:
◆Control Variables:#0013 Total Party TP Gain = Party #1 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #2 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #3 TP Gain
◆Control Variables:#0013 Total Party TP Gain += Party #4 TP Gain
◆Change TP:{Party Leader}, + {Total Party TP Gain}

You're using the {Party Leader} variable inside your Change TP command, but you never actually assigned a value to that variable, so it's just being read as 0. The issue is that there is no such thing as actor 0--the list of actors starts at 1. The engine is set up so that if you use the value 0 in that command, it will change the TP of the whole party.

So it looks like the actors are getting synced, but that's just because their TP all has the same starting value, and then you're adding the exact same value to each of them every time. If that makes sense.

You can fix this by assigning the actor ID of the party leader to your {Party Leader} variable before the first time you use it in your Battle Start Commands CE. And then change the Sync TP CE so that it's regular, instead of parallel, and then just manually call it when you need it (once at the end of Battle Start Commands, and once at the end of page 2 on your Troop Event). You don't actually need it to be parallel anyway, and it's actually better if it's not--because you don't want it to be constantly running while you're outside of battle, especially since it doesn't have a Wait in it to slow it down a little.

But interestingly enough, I don't think it actually matters. In terms of functionality, I think your accident actually wound up yielding the same results as it would if things were working as you intended. In this particular situation, there's not really a difference between adding a value to the party leader's TP and then syncing everybody elses, compared to simply adding that value to everybody at the same time. So you don't actually even need to fix it. But if you don't, then I recommend deleting the Sync TP CE, or at least change it so it's not parallel, because you're turning that switch on, but then never turning it back off, so it would be constantly running while you're outside of battle despite the fact that it's never actually serving a purpose.
Ah, really? Wow, that's a very contrived coincidence. Well, time to update this post. I could swear I set that variable a value... Tunnel vision, I suppose. I think I'll keep the CE, but just set it to be activated by the troop page instead to prevent it from running all the time, like you said. And give that party leader var an actual value. I suppose I mixed it up with party index, which starts at 0. Boo.

Original thread: https://forums.rpgmakerweb.com/threads/making-synchronized-tp-without-plugins.143835/