Trance (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


In Final Fantasy 9, when characters reach max limit capacity, they enter a state of Trance. In this state, they gain extra stats, more/different abilities, and their limit gauge starts dropping. Once the limit gauge hits 0, trance wears off. Here’s how we’ll recreate it in RPG Maker MV using TP instead!

Required Plugins

The following plugin(s) is required to create this Tips & Tricks effect:

For help on how to install plugins, click here.

For help on how to update plugins, click here.

About

This is a Tips & Tricks effect created for RPG Maker MV. Tips & Tricks are not to be confused with plugins. Instead, they are usually customized code created for the sake of producing unique features/effects that do not require an entire plugin to do.

Yanfly Engine Plugins

This Tips & Tricks effect is made possible due to the Yanfly Engine Plugins library.

Click here if you want to help support Team Yanfly on Patreon.

Instructions

Follow video instructions.

Here’s the copy/paste version of the code:

Place the following code into the trance state’s notebox. Change the values to fit your game.

<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
  // Default the user's trance state to false.
  user._trance = user._trance || false;
  // Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.
  condition = user._trance || user.tp === user.maxTp();
} else {
  // Otherwise, the condition is false.
  condition = false;
}
// If the condition passes...
if (condition) {
  // And if the user isn't in the trance state...
  if (!user._trance) {
    // Then play an animation as the user enters trance.
    user.startAnimation(120);
  }
  // Set the user's trance state to true.
  user._trance = true;
}
</Custom Passive Condition>

<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 10;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
  // ...then turn off trance.
  user._trance = false;
}
<Custom Regenerate Effect>

Happy trancing!