Using TP as a common event variable?

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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?
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
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.
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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.


Could you give me an example of how to do i Via Auto Passive + Buff & States? I use both, but I have Dyslexia, so trying to do all of this get's super frustrating, especially when I'm not a coder. Reading the help logs, I don't seem to see a way to set it to be influenced by TP. Arghhhhhhh. Im about to have a nervous breakdown 
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
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. 
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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 would be awesome!


Would it be too much to ask if in these notes, or in a separate document, you can light highlight the things I can like, swap out for other things?


Like, if the code line or something, is for TP, could you highlight that so I know I can just edit that into MP or something?


Sorry if that's a lot to ask for D:
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
That's the point of notes ;p I'll leave you well informed. 
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
That's the point of notes ;p I'll leave you well informed. 
Whoohoo! This is gonna be so great!


I'm trying to make all of my characters kind of unique, mechanic and gameplay wise, so having more interactive passives and resources is how I'm trying to do it. Originally, her Heat would be tied to a timer, of like 30 seconds, but that didn't feel too interactive. I have a few other characters who have resources that when they fall off they get nerfed and stuff, so I'm so excited now for this, omgggg.
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
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? 
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
t1 is state 84


t2 is state 85


t3 is 86 


t4 is 87
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
I haven't actually tested this yet, but it should work just fine. Just add it to a passive state and decide who you want to have it and who you don't.

Code:
//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 && 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 && currentTp > 35){
	
	//Add it
	user.addState(85);
}


//Apply Logic
if (currentTp <= 80 && currentTp > 50){
	
	//Add it
	user.addState(86);
}


//Apply Logic
if (currentTp <= 100 && 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 <= 9){
	
	//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) {
			if (user.isStateAffected(i)){
				user.removeState(i);
			}
		}
}

if (currentTp <= 35 && currentTp > 9){
		var stateRowList = [85, 86, 87];
		var total = stateRowList.length;
		for (var i = 0; i < total; ++i) {
			if (user.isStateAffected(i)){
				user.removeState(i);
			}
		}

		
		//Add it
	user.addState(84);
	
}

if (currentTp <= 50 && currentTp > 35){
		var stateRowList = [84, 86, 87];
		var total = stateRowList.length;
		for (var i = 0; i < total; ++i) {
			if (user.isStateAffected(i)){
				user.removeState(i);
			}
		}

	//Add it
	user.addState(85);
}

if (currentTp <= 80 && currentTp > 50){
		var stateRowList = [84, 85, 87];
		var total = stateRowList.length;
		for (var i = 0; i < total; ++i) {
			if (user.isStateAffected(i)){
				user.removeState(i);
			}
		}

	//Add it
	user.addState(86);
}

if (currentTp <= 100 && currentTp > 80){
		var stateRowList = [84, 85, 86];
		var total = stateRowList.length;
		for (var i = 0; i < total; ++i) {
			if (user.isStateAffected(i)){
				user.removeState(i);
			}
		}
	//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)
//			}
//		}
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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?
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
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
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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.
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
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
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
Haha, sorry. It's not too much of a complication. It would just mean some rebalancing. Thank you again for all your help
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
i was thinking about just moving the for loops to the states as a <custom apply effect> 
 

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
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.
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
Don't worry, I got you covered. I just made it so it works right instead :p


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
 
Last edited by a moderator:

LuLingqi1

A Spellthief With A Bone To Pick
Veteran
Joined
Jun 23, 2016
Messages
175
Reaction score
66
First Language
English
Primarily Uses
N/A
Don't worry, I got you covered. I just made it so it works right instead :p
Yay! It works! omg. Thank you so much! Sorry it's been so long since I responded!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,995
Messages
1,018,212
Members
137,775
Latest member
yj8570
Top