Hi guys! Today I decided I wanted to tie TP to a Passive State I'm trying to make called Heat.
So basically, from 0 TP - 9 TP, Heat would be at Tier Zero. 10 TP - 35 TP Tier One, 36-50, Tier Two. 51-80, Tier Three. And 81-100 Tier Four.
Tier One would apply +5 MAT. Tier Two would apply +25 MAT and a state that applies a 1% HP Burn. Tier Three would apply +40 MAT and a 5% HP Burn state, while Tier Four would apply +100 MAT with a 15% HP Burn State. So I know how to get it to work in common eventing, with applying everything, but I have no idea how to get it based off of TP. Would this need to be done via scripting, or am I just not scouraging the Common Event options well enough?
this is exactly the kinda thing that Yanfly's auto passive states plug is for. unfortunately it'd be much easier to just code in Javascript than it would be to use built in common events. Plus this way you could condense it all to a single state and have the tracker change icons and such as the meter rises. You'll also want the yanfly buffs and states plugin if you don't already have it. Also, you can make it a global passive or unique to certain actors or weapons or armors and such with ease this way.
Don't stress it, I can set it up for you and I'll leave plenty of notes and spacing to help make things easier for you to read if you ever decide you'd like to learn more about it. It'll take a little bit of time but I think I'll have it done within the next 3 or so hours if I don't accidentally fall asleep.
That's the point of notes ;p I'll leave you well informed.
just a quick update, it'd actually be easier for you to keep the states and just toggle between them since they affect direct stats. What are the State Id's for tiers 1-4 so I can fill that in?
t1 is state 84
t2 is state 85
t3 is 86
t4 is 87
Sorry i fell asleep! So for input processes, I would just add this to state like, 88, apply it as a passive to the character, and then it will cycle through the four parts of it?
And now just a quick game design question, do you think the MAT increase is better as a flat amount, or should I do it as percent amounts?
to the forst part, yeah that's pretty much it. It's just a lot of checking where their TP is and acting accordingly.
In terms of game design I tend to lean more towards percent changes to keep things relavant at higher levels
Currently, in battle, it shows each state's symbol. It's basically just an orange circular gem thing that get's bigger for each state. It's actually good that it shows all of them lined up at once, and removes them as she uses her Heat resource (which is really just TP but renamed). This raises one question however, would it be giving the benefits of both states?
For example, I changed the numbers around due to them being percents. Tier one gives +50% more MAT, so if she had 20 MAT, she would get +10 MAT tier one. Tier two gives +75% more MAT (really these numbers in the thing are read as 150% and so on cause RMMV is weird), so she would have +15 more MAT at Tier two. Is it stacking though, for a total of 25 MAT once she hits Tier two, or is she only getting 15 at Tier two? It's not that bad for the first couple tiers if it stacks, but at tier three she gets 100% more MAT, and at tier four she gets 300% more MAT, along with t3 5% health decay and t4 15% health decay. So if it all stacks and she had 20 MAT to begin with, she would be getting about
10+15+40+60 MAT which is like 125. As well as about a 20% health decay at t4 as opposed to the 15% i had hoped for. It's not bad if it stacks, in fact I think it would scale much better this way, because there's a chance the character would have to solo the first 2-3 hours of the game, I would just have to rebalance things like base MAT, HP, MP, etc etc, or maybe the HP decay debuff the state gives.
huh, not my intended purpose, Ill make a test game bit later to see exactly what's going on, but if it's showing the states I believe they're being affected by them
Haha, sorry. It's not too much of a complication. It would just mean some rebalancing. Thank you again for all your help
Would i just do something along the lines of if user is affected by state x, remove it, or whatever? Idk how to write it in code though or where i would place it
i was thinking about just moving the for loops to the states as a <custom apply effect>
Maybe that would work? It stacking the way it is now isn't too big of an issue, atleast, before 100 MAT. Hell I dont even think I did the math right. With the stacking, its well over a 500% increase. I would just need to figure out how to significantly debuff her during all of this.
Don't worry, I got you covered. I just made it so it works right instead 😛
this is the revised passive code. Just replace the current one.
//Does this at the beginning of the battle
<Custom battle effect>
//Sets up a variable that is equal to the value of the battler's TP
//(other changes to this are very predictable i.e. -- user.mp for MP or user.mmp for max MP)
//Also since this part happens at the beginning of the battle there's no need to set anything for if they have 9 or less.
var currentTp = user.tp;
//"if" lines are pretty easy to understand. The first condition checks if it's less than to equal to 35.
//after the "&&" if then makes sure that it's over the amount of the previous tier. I'll be annotating this with "Apply logic" from now on to save time
if (currentTp <= 35){
if (currentTp > 9){
//If the condition is met, it will apply the state number in the "()" this line will be annotated as "Add it" in future note lines
user.addState(84);
}
}
//Apply Logic
if (currentTp <= 50){
if (currentTp > 35){
//Add it
user.addState(85);
}
}
//Apply Logic
if (currentTp <= 80){
if (currentTp > 50){
//Add it
user.addState(86);
}
}
//Apply Logic
if (currentTp <= 100){
if (currentTp > 80){
//Add it
user.addState(87);
}
}
//end of the beginning of battle code
</Custom battle effect>
//These actions happen when battlers regen HP/MP/TP
<custom regenerate effect>
//setting it up again for this part of commands. New notetags, new operations, more of defining the same ol' variable.
var currentTp = user.tp;
// Since this happens during the course of combat, some code for tier 0 is needed. (also, Apply Logic)
if (currentTp < 10){
//now we're making the list of states we want to check for and get rid of based on their TP total.
//9 and less is tier 0 so that'll be all of them.
var stateRowList = [84, 85, 86, 87];
// this is setting up a new variable that calls on the "length" of the list on the list(a.k.a. Array) we made earlier
var total = stateRowList.length;
//This is a for loop..... I'll explain at the bottom what these do.
//the rest of these are the same line repeated with different conditions and slightly different lists, so go ahead and skip to the bottom
//for a lesson on for loops.
for (var i = 0; i < total; ++i) {
var deleteMe = stateRowList;
if (user.isStateAffected(deleteMe)){
user.removeState(deleteMe);
}
}
}
if (currentTp < 36){
if (currentTp > 9){
//If the condition is met, it will apply the state number in the "()" this line will be annotated as "Add it" in future note lines
user.addState(84);
}
}
//Apply Logic
if (currentTp < 51){
if (currentTp > 35){
//Add it
user.addState(85);
}
}
//Apply Logic
if (currentTp < 81){
if (currentTp > 50){
//Add it
user.addState(86);
}
}
//Apply Logic
if (currentTp < 101){
if (currentTp > 80){
//Add it
user.addState(87);
}
}
//end of "regen" effect commands
</custom regenerate effect>
//okay, so... for loops.
// you know what this line does!
// var stateRowList = [85, 86, 87];
// You know what this one does too!
// var total = stateRowList.length;
//This is complex a bit. Basically what this does is go through "total" one array item at a time and repeats the command until
//it's gone through the whole list with the variable "i" representing item on the list being processed
// for (var i = 0; i < total; ++i) {
//so now it checks if the user has the state currently being processed from our "stateRowList"
// if (user.isStateAffected(i)){
//and if they are, it removes it.
// user.removeState(i);
//by the way, JS uses "{}" to enclose different processes. (such as if branches and for loops)
// }
// }
THIS is the code you'll put in all the tiers of heat. (it wont remove itself)
<custom apply effect>
var stateArray = [84, 85, 86, 87];
var total = stateArray.length;
for (var i = 0; i < total; ++i) {
currentStateCheck = stateArray;
if (target.isStateAffected(currentStateCheck)){
console.log("it knows" + currentStateCheck + " it's there")
if (currentStateCheck != stateId){
console.log("it knows it's not the state ID");
target.removeState(currentStateCheck);
}
}
}
</custom apply effect>
I've tested it out. it functions correctly
you can delete the console.log commands if you want, those were just to help me find what was broken while I was fixing things