Secondary MP Gauge

I'm looking to make an AP system for my game as a secondary MP system. So, MP will be the cost to use magical abilities and AP for non-magical ones. So far using VisuStella plugins I've been able to replace the TP bar (which I'm not going to use) and color it yellow (which I want), BUT the gauge says undefined both where it should say "AP" and where it should say the current amount. Also, I'd like the game to start out with full AP for everybody, just like MP.
Just rename TP to AP and make the non magical skills use it. That sounds like what you are looking for.
I don't want it to function like TP though; the TP system in RPGMaker is odd...I just want it to act as a second MP bar, without the weird increasing on taking damage, etc.
I don't want it to function like TP though; the TP system in RPGMaker is odd...I just want it to act as a second MP bar, without the weird increasing on taking damage, etc.
Do you have the TP system plugin? You can set it up to work the same as MP if you want.
I don't currently have the TP system plugin, no. If I were to get it, would I be able to disable the menu that lets you change modes? I'd be happy to set it up to act as MP but I also want to recolor/rename it (which may be possible in the plugin, idk), as well as not clutter up my menu with things like a TP mode screen. Unfortunately there's not a ton of in-depth tutorial material on VS plugins, at least that I've found, so I welcome any info!
I don't currently have the TP system plugin, no. If I were to get it, would I be able to disable the menu that lets you change modes? I'd be happy to set it up to act as MP but I also want to recolor/rename it (which may be possible in the plugin, idk), as well as not clutter up my menu with things like a TP mode screen. Unfortunately there's not a ton of in-depth tutorial material on VS plugins, at least that I've found, so I welcome any info!
Yes, you can disable the TP mode option.
Alright, I caved and got the plugin. So right away I was able to disable that menu, that's good. I was also able to rename/recolor the gauge. The only thing I'm missing now is how to set it to start at 100%, and something I think I'll run into later is how to increase the max on level up.
Alright, I caved and got the plugin. So right away I was able to disable that menu, that's good. I was also able to rename/recolor the gauge. The only thing I'm missing now is how to set it to start at 100%, and something I think I'll run into later is how to increase the max on level up.
I would set "preserve TP" to true and just do a script call when a party member joins that sets their TP to its max value.
Ok I have "preserve TP" as true, so I'm not losing it after battle, which is what I want. Can I do that script call for my first character too? Like on game launch? And can I set inns and other restorative things like certain items to refill TP? And how will I set it to increase maxTP with level up? Just trying to cover all my bases to make it act exactly like MP.
We have discussed exactly all this on discord.
I'll provide an example:
First change the name of your TP to AP from Database > Terms
1669973662663.png
>>>
1669973686683.png


Go to Database > Skills > Attack and remove the TP Gain
1669973768942.png
>>>
1669973785983.png


Go to Plugin Manager > VisuMZ_2_EnhancedTpSystem > General Settings
Change Default TP Mode to something you want, this example: ExMp
1669974072245.png
>>>
1669974098930.png


Change Show TP Mode? to false(disables menu option)
1669974155332.png
>>>
1669974175562.png


Go to TP Modes and create a new mode by double clicking the blank space at bottom of list
1669974251725.png


TP Mode Name >> set to ExMp
MaxTP Formula >> can be whatever you want, as an example I will use the actor's level multiplied by 25% of their own magic attack.
1669974406213.png


The Gauge section is cosmetic and you can use it or not.
1669974579308.png

Custom Label is an alternative way to change the label used for TP(besides step 1) .. making multiple copies of this mode(ExMp, ExMp2m ExMp3, etc), you can label them different things if you want(such as class specific labels -- see notetags)

You can leave or customise any of the listed conditions if you want.

Starting the game with full TP:
You can setup an auto event or use:
VisuMZ_1_CoreEngine > Quality of Life Settings > Play Test > NewGame > CommonEvent
VisuMZ_1_CoreEngine > Quality of Life Settings > Misc > NewGame > CommonEvent
1669975001086.png
>>>
1669975027356.png

1669975106320.png

Code:
for (const member of $gameParty.members()) {
    member.setTp(member.maxTp());
}
Use this same code to restore all during Inn Events, etc.
1669975194551.png


1669975317862.png
Well we've discussed it somewhat on discord; I did not have the plugin last we spoke there though. Thank you for going in depth here! Is there a script I could use for mimicking the level up curve of other parameters for MaxTP Formula? I figure the basic part would be something like:
BaseTP + Inc * (user.level - 1)
Where BaseTP will be a number for max TP at level 1, and Inc will be the amount increased every level. Where I get confused is the exponential growth stuff. If my HP and MP are following those exponential curves I don't want my TP to fall behind by using something linear.
Also:
for (const member of $gameParty.members()) {
member.setTp(member.maxTp());
}
works like a charm, thank you!
Is there a script I could use for mimicking the level up curve of other parameters for MaxTP Formula?
I've already set an example, you can play with it to suit your project.

I don't want my TP to fall behind by using something linear.
Have you tried? Is the example linear?
Yes, my example:

30 + 20 * (user.level - 1)

Is a linear function. I was wondering what the equation for parameters such as HP and MP looks like, because they have some sort of exponential growth, not linear (unless you set it to be perfectly linear). I could enter in a stat into the equation, such as in your example, but then it’d all have to be based off that stat’s curve. The equation:

Math.round(user.mmp / 2)

For example, would make my maxTP curve be half of the maxMP curve. I may have to settle for basing the curve off the MP curve if I don’t know/can’t find the equation for standard parameter curves based on how fast/slow the growth is. So my MP growth curve has a starting position, an ending position, and an exponential factor (fast/slow). I want to set up a TP curve in the same manner. I may just have to you around with different equations until I find something somewhat balanced.
In the example I provided, it was based on MAT.
MAT has a curve, as other stats do, etc..
If you want a custom curve, you will need to first create the array it is based on.
(as all parameters are)
Spoiler: JSON
Code:
{"id":1,
"expParams":[30,20,30,30],
"traits":[{"code":23,"dataId":0,"value":1},
{"code":22,"dataId":0,"value":1},
{"code":22,"dataId":1,"value":0.05},
{"code":22,"dataId":2,"value":0.1},
{"code":41,"dataId":2,"value":1},
{"code":51,"dataId":2,"value":0},
{"code":51,"dataId":1,"value":1},
{"code":52,"dataId":1,"value":0},
{"code":52,"dataId":3,"value":0},
{"code":52,"dataId":5,"value":0}],
"learnings":[{"level":2,"note":"",
"skillId":172},{"level":5,"note":"",
"skillId":173},{"level":8,"note":"",
"skillId":175},{"level":12,"note":"",
"skillId":176},{"level":15,"note":"",
"skillId":174},{"level":20,"note":"",
"skillId":178}],"name":"Swordsman",
"note":"",
"params":[[1,544,618,691,764,838,911,984,1058,1131,1204,1278,1351,1424,1497,1571,1644,
1717,1791,1864,1937,2011,2084,2157,2231,2304,2377,2450,2524,2597,2670,2744,2817,2890,
2964,3037,3110,3184,3257,3330,3403,3477,3550,3623,3697,3770,3843,3917,3990,4063,4136,
4210,4283,4356,4430,4503,4576,4650,4723,4796,4870,4943,5016,5089,5163,5236,5309,5383,
5456,5529,5603,5676,5749,5823,5896,5969,6042,6116,6189,6262,6336,6409,6482,6556,6629,
6702,6776,6849,6922,6995,7069,7142,7215,7289,7362,7435,7509,7582,7655,7728],
[0,41,50,59,68,76,85,94,102,111,120,129,137,146,155,163,172,181,190,198,207,216,224,233,
242,251,259,268,277,285,294,303,312,320,329,338,346,355,364,373,381,390,399,407,416,425,
434,442,451,460,468,477,486,495,503,512,521,529,538,547,556,564,573,582,590,599,608,617,
625,634,643,651,660,669,678,686,695,704,712,721,730,739,747,756,765,773,782,791,800,808,
817,826,834,843,852,861,869,878,887,895],
[1,19,21,23,25,27,29,30,32,34,36,38,39,41,43,45,47,48,50,52,54,56,57,59,61,63,65,66,68,
70,72,74,75,77,79,81,83,85,86,88,90,92,94,95,97,99,101,103,104,106,108,110,112,113,115,
117,119,121,122,124,126,128,130,131,133,135,137,139,141,142,144,146,148,150,151,153,155,
157,159,160,162,164,166,168,169,171,173,175,177,178,180,182,184,186,187,189,191,193,195,
196],
[1,17,19,21,22,24,25,27,29,30,32,33,35,36,38,40,41,43,44,46,48,49,51,52,54,55,57,59,60,
62,63,65,67,68,70,71,73,74,76,78,79,81,82,84,86,87,89,90,92,93,95,97,98,100,101,103,104,
106,108,109,111,112,114,116,117,119,120,122,123,125,127,128,130,131,133,135,136,138,139,
141,142,144,146,147,149,150,152,154,155,157,158,160,161,163,165,166,168,169,171,172],
[1,15,17,18,19,20,22,23,24,25,26,28,29,30,31,32,34,35,36,37,38,40,41,42,43,44,46,47,48,
49,50,52,53,54,55,56,58,59,60,61,62,64,65,66,67,68,70,71,72,73,74,76,77,78,79,81,82,83,
84,85,87,88,89,90,91,93,94,95,96,97,99,100,101,102,103,105,106,107,108,109,111,112,113,
114,115,117,118,119,120,121,123,124,125,126,127,129,130,131,132,133],
[1,17,19,20,22,23,25,26,28,29,31,32,33,35,36,38,39,41,42,44,45,46,48,49,51,52,54,55,57,
58,60,61,62,64,65,67,68,70,71,73,74,75,77,78,80,81,83,84,86,87,88,90,91,93,94,96,97,99,
100,102,103,104,106,107,109,110,112,113,115,116,117,119,120,122,123,125,126,128,129,131,
132,133,135,136,138,139,141,142,144,145,146,148,149,151,152,154,155,157,158,159],
[1,29,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,106,
109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,
175,178,182,185,188,191,194,197,200,203,206,209,212,215,218,221,224,227,230,233,236,239,
242,245,248,251,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,
309,312,315,318,321,324,327],
[1,27,31,34,37,40,43,46,49,52,56,59,62,65,68,71,74,77,80,84,87,90,93,96,99,102,105,108,
112,115,118,121,124,127,130,133,136,140,143,146,149,152,155,158,161,164,168,171,174,177,
180,183,186,189,192,196,199,202,205,208,211,214,217,220,224,227,230,233,236,239,242,245,
248,252,255,258,261,264,267,270,273,276,280,283,286,289,292,295,298,301,304,308,311,314,
317,320,323,326,329,332]]},
The array must be available before calling the value.
Ah, so it looks like I have to manually enter the value for each level? I was hoping I could just use the same type of equation the stats do. As in, when I set an MP curve, I can generate a curve by setting a start value, end value, and 'speed'. When speed is 0 (the slider is in the center), the function is linear. That equation (for MP for example) would be mmp = mx + b where m is rate of change per level x, and b is a constant that helps set the starting value for level 1.

I want to write the version that includes 'speed' as an equation, such as map = a^(bx) where a and b are constants and x is level...however you would express that in code. This way, at level 1, max ap would just be a^b, but as level increases the stat increases exponentially. I just need to figure out what a and b are, as well as if there are any constants added anywhere, e.g. map = a^(bx + c) + d, or if it's a different style equation entirely, such as map = (x - 1)^2 + a. In that case, at level 1, max ap would just be a. There are a lot of possibilities for equation, but it'd be much easier to balance if I knew the equation style used for generating the curves for the typical stats. I'd rather not have to make an array with a value for every level for every single class, if I could just make one equation per class that would automatically form a curve that does the job.
You can create a formula, just be aware of what values are available at the time of calling it. In that regard, how would you decide the differences amongst different actors?
Hm, well using a variable like user.level should take care of that right? But then per class would be nice as well. If only I could set the curves using notetags on classes...

EDIT: I've figured out the formula the game uses to generate the curves for stats. It is:

((f - i - 98b)/9800)x^2 + bx + ((9801i - f - 9702b)/9800)

where f is the value at level 99 and i is the value at level 1. b is how fast or slow the growth will be, and should be a value from 0-20, 0 being slow, 20 being fast, and 10 being linear. x is level. This formula also assumes level goes from 1 to 99.

My next question is: I'm using SumRndmDde's TPUpgrade plugin to be able to put a formula for max TP into a notetag for actors, classes, etc. I want to put it as a class notetag. What phrase can I type into the notetag to make it call the actor's current level? Once I plug in the values I want for f, i, and b, level is the only variable left. I'm just not sure how to call it using JS.

Final question: once I have the level call working, what command can I use to round the final result of the formula to the nearest whole number?
I'm noticing that your AP bar in this image is full width (the same width as HP and MP bars), but when I set this up the AP gauge begins to the right of the text 'AP'. Any idea why this might be the case? I'll fiddle with the settings in the meantime but I'm not sure how to troubleshoot this. Screenshot attached.

Original thread: https://forums.rpgmakerweb.com/threads/secondary-mp-gauge.153023/