Placeholder States

Placeholder States are special states that use a formula to determine which state will be added, when they are actually being added to a battler.

For example, let’s say you had a state called “Freeze”. When you first apply the freeze state, the enemy will be frozen. However, if you applied the freeze state to an enemy that is already frozen, they will shatter and die.

As another example, suppose you had a state called Poison. When you first apply the state to a battler, Poison 1 will be added. When you add the Poison state to a battler that already has Poison 1, it will be removed, and replaced with Poison 2.

This allows you to create states that can be used on the same battler multiple times, but potentially have different results.

Download

Plugin: download here (right-click, save as)

This is for MV only. For the Ace version, click here.

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_PlaceholderStates plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

Note-tag states with

<placeholder state>
  FORMULA
</placeholder state>

Where the FORMULA is any javascript expression that returns a number, which will be the ID of the state that is actually added or removed. You can use any number of conditions.

The following formula variables are available

a - "this" battler.
v - game variables

So for example, if you wanted a state to have the following logic

  if state 4 is applied     
     add state 5
  else
     add state 4

You can write

  if (a.isStateAffected(4)) {
     5;
  }
  else {
     4;
  } 

Note that the value that the formula resolves to must be a number, so be careful with complex logic.

This plugin can be used in conjunction with any other of my state-related plugins. For example, in the Poison 1 –> Poison 2 example I showed, you can use Overriding States to have Poison 2 automatically remove Poison 1 when it is added.

You may also like...

24 Responses

  1. Anonymous says:

    i’ve been thinking of using M.ATK for determining how effective a debuffing state is depending on its user (returning a variation between a weak state, a strong state, or no state depending on the target’s M.DEF vs the caster’s M.ATK), and this seems like it can do the trick, but how do i actually determine the m.atk of who “caused” the debuff? ive thought maybe i could set a variable to be equal to m.atk before the state is applied in a common event but im not sure how to make the variable the m.atk of the caster

  2. Angelus says:

    Hi, I’m trying to use your plugin, but I can’t get it. I put the formula as in the directions and the status does not change, no matter what I do. You are still around. Could you help me?

  3. Wonderful post! We will be linking to this great post on our website.

    Keep up the great writing.

  4. Pajamas:Pajamas, also referred to as pyjamas are neat, chic and timeless, but different styles mail out
    different messages. Even men who think of silk being a “feminine” fabric quickly realize precisely how wonderfully
    this fabric might be incorporated into their unique
    clothing. Typically, men will buy flowers or something that
    is, which is good, nevertheless it could possibly be much better.

  5. Welⅼ I truly enjߋyed studying it. Τhis article providеd
    by you is νery effective for proper planning.

  6. I visit day-to-day some sites and websites to read articles or reviews, however this website offers quality based articles.

  7. Sundricat says:

    Could this work for switching out the death state used when HP reaches 0?

  8. AresSF says:

    How can I use this in a way that when the affected enemy is attacked by a certain element do extra damage and change the state to another?
    As an example, an state “Greek Fire” that indicates that the enemy is “soaked” with greek fire, and when attacked by the element “Water”, this attack does extra damage and after that the state change to and state that indicates that is on fire, we can say “Burned” o simply “On fire”.
    Can I use this in a way that an state is removed by a certain element? As an example, a “Frozen” state removed by a “Fire” element attack.

    • Hime says:

      The plugin basically allows you to execute a formula when the placeholder state is added or removed.
      It only runs under those two situations.

      You can have the state have a trait that makes the target weak against water using the element rate feature.
      If you want a state to be removed when attacked by a certain element, you should take a look at the State Damage Modifiers plugin, which are formulas that run whenever you’re affected by an action.

      State damage modifiers is intended to be used on top of damage formulas, so that you CAN change the amount of damage that is dealt, and other things like removing the state after being hit by a fire spell or something.

  9. Jason Banchs says:

    For example, if i don’t put a else handler it doesn’t activate the state at all, but when i put what was given it never took the state off… i still cant figure out what is wrong. (sorry I have been busy)

    • Hime says:

      If you want the state to be activated when your MP is not 0, and automatically removed when your MP is 0, placeholder state isn't meant to do that on its own.

      The plugin simply allows other state-related functions to add or remove a state, and then the game dynamically figures out which state will actually be added or removed, based on the formula.

      If you're adding a state, and the placeholder says 0, that means no state is added. If you're removing a state, and the placeholder says 0, that means no state is removed.

  10. Jason Banchs says:

    Hey Hime, I’ve been trying to use your plugin and i keep getting some errors. I don’t know the limitations of this plugin but i’m trying to use it to make some sort of hyper form. I’m using most of the Yanfly plugins as well but i think i’m getting the concept wrong. I’m trying to do this based of the example:

    if (a.mp(0)) {
    0;
    }
    else {
    28;
    }
    </placeholder state>
    what I am trying to do is if the user’s MP is 0 then the state disappears on the spot, as with the tutorial I was previously using left on turn on the state even if the MP was zero. any help?

Leave a Reply

Your email address will not be published. Required fields are marked *