How can I do this?

I'm looking at Yanfly's Tip & Tricks videos at the moment and I just saw the "Power up mode" video. It teach you how to automatically activate a state when an actor's tp is equal to 80. A really neat idea!


So here's my question: Is there a way to do the same thing but with Yanfly's party limit gauge plugin instead? The party limit gauge is a plugin that lets you add another bar like the mp & tp bar to your game.


Edit: Here's the code to make the power up mode:

Spoiler
<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Set the condition to whether or not the user's TP is above 80.
condition = user.tp >= 80;
} else {
// Otherwise, set the condition to false.
condition = false;
}
</Custom Passive Condition>

I know I have to change the "user.tp" part but with what exactly? That's what I don't know. 🙁
Hi!


From the plugin help file, it seems you can use


user.partyLimitGauge()


to return the value of the gauge.


In your case:


condition = $gameParty.partyLimitGauge() >= your_value_here


should do the trick.
Still doesn't work. T.T


Here's a picture of the errors:

Spoiler
Untitled_zpsjg69xryn.png
That's weird. I have state 4 defined as a actor passive in the plugin parameters and this as my state 4 notebox:


<Custom Passive Condition>
if ($gameParty.inBattle()) {
condition = $gameParty.partyLimitGauge() >= 100
} else {
condition = false;
}
</Custom Passive Condition>


And it's working perfeclty.


Could you show how you have setup your state? (paste its entire notebox)
Sure thing. Here you go!

Spoiler
<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Set the condition to whether or not the user's TP is above 80.
condition = $gameParty.partyLimitGauge() >= 100;
} else {
// Otherwise, set the condition to false.
condition = false;
}
</Custom Passive Condition>
<Custom Apply Effect>
// Check if user is an actor.
if (user.isActor()) {
// Archive the previous settings.
user._prevCharName = user._prevCharName || user._characterName;
user._prevCharIndex = user._prevCharIndex || user._characterIndex;
user._prevFaceName = user._prevFaceName || user._faceName;
user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
user._prevBattlerName = user._prevBattlerName || user._battlerName;
// Check if the actor ID is 1.
if (user.actorId() === 1) {
// The filename of the character graphic without the file extension.
var charName = 'Actor1';
// The index of the character graphic used.
var charIndex = 6;
// The filename of the face graphic without the file extension.
var faceName = 'Actor1';
// The index of of the face graphic used.
var faceIndex = 6;
// The filename of the battler graphic without the file extension.
var battlerName = 'Actor1_7';
}
// Changes the character image to the setting applied from above.
user.setCharacterImage(charName, charIndex);
// Changes the face image to the setting applied from above.
user.setFaceImage(faceName, faceIndex);
// Changes the battler image from the setting applied from above.
user.setBattlerImage(battlerName);
// Refreshes the user's appearance.
user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
// Retrieve archived settings.
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
// Changes the character image to the archived setting.
user.setCharacterImage(charName, charIndex);
// Changes the face image to the archived setting.
user.setFaceImage(faceName, faceIndex);
// Changes the battler image from the archived setting.
user.setBattlerImage(battlerName);
// Clear archived data.
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
// Refreshes the user's appearance.
user.refresh();
</Custom Remove Effect>

The other part is to make the 1st actor "transform". It works perfectly.


I tested the game without the "transforming" part of the code but it still didn't work. :/ 
Okay. I pasted your code and everything is working right in my game.


Side note: the custom apply part doesn't work for me when I use this as a passive state, but it does when you add it via a skill or manually. Does it work as a passive effect to you?


That means the error isn't in the code itself, but is likely coming from somewhere else.


This is gonna sound obvious but is the party limit gauge plugin set up correctly in your project? Is it active?


If yes to both, paste this and print the console when you get an error and show it to me again. 

Code:
<Custom Passive Condition>
if ($gameParty.inBattle()) {
  console.log($gameParty._partyLimit) //this is the value itself the plugin checks when 
  //calling the function below, if it does't exist, your plugin is messed up or not active.
  console.log($gameParty.partyLimitGauge())
  //This is the function that seems to be the problem. You should see the same number appear twice?
  condition = $gameParty.partyLimitGauge() >= 100;
} else {
  condition = false;
}
</Custom Passive Condition>
I use the custom apply and custom remove codes together. And yes, I also have to add the state to a skill for it to work.


Edit: I apologize for last time. I'm not feeling sleepy today, so I'll be able to write a better explanation.


First of all, I should give an explanation of what I'm trying to do:
When the party limit gauge is full, a new command appears for all characters. Let's call it "Overdrive Mode" in this example. Only one character at a time can use this command. For example: Actor 1 uses the Overdrive Mode. The Overdrive Mode command for the other actors would then disappear and the player would have to fill the party limit gauge again if they want another actor to use the Overdrive Mode. The Overdrive Mode would automatically give actor 1 a state that would make them change appearances and powerup. The powerup state would also make the skill and magic commands disappear and a new command would take their place. The new available skills that comes with the new command would use the party limit gauge instead of MP/TP. The state would disappear if the party limit gauge isn't full anymore or when 3 turns have passed and actor 1 would revert to their original appearance. Finally, if actor 1 lose their powerup state after 3 turns, the party limit gauge becomes empty.


Now, here's my main problem:


I can't make the Overdrive Mode command appear for all characters when the party gauge is full.
I can add the Overdrive Mode command without problem with Tsukihime's Battle Command: Use Skill Plugin, but can't figure out how to make the command appear when the party limit gauge is full. Once I can make this work, I'm pretty sure I'll be able to do everything else by myself.
I edited my previous post. Any help would be appreciated.
So it's not possible to do or is it because I haven't given enough information?


If it's not possible to do, I'll just give up on this but if it's because more information is needed, then please, tell me what you need to know and I'll post it here.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-do-this.70939/