Scope Change Rules

This plugin allows you to change an action’s scope dynamically based on a set of conditions that are defined for the item or skill.

For example, imagine you have a “Fire” spell that targets one enemy. However, when a special “Cast All” state is applied to the battler, the
spell’s scope is changed to “All Enemy”, allowing you to target everyone while the state is active.

A single skill or item can have multiple scope changing rules defined. The first rule that is met will be the scope that is used.

Download

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

Required

Installation

Download ths 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_ScopeChangeRules plugin.

Place this plugin below Hime Scope Core

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

Usage

To assign scope changing rules, note-tag items or skills with

<scope change rule: SCOPE_TYPE>
  FORMULA
</scope change rule>

Where the SCOPE_TYPE is the type of scope that you would like to change it to. See the instructions for Hime Scope Core for a list of scopes that you can use.

The FORMULA is a javascript formula that evaluates to true or false.

You can use the following formula variables:

  a - the user of the skill
  s - game switches
  v - game variables

For example, let’s say you wanted a skill to change to target all enemies if state 14 was applied. You would write in the skill’s note

<scope change rule: all-enemy>
  a.isStateAffected(14)
</scope change rule>

And whenever state 14 is applied, the scope of the action will change when you select the action.

For more formulas, consult the formula reference.

 

You may also like...

30 Responses

  1. Sukimin says:

    Can it makes the scope only target enemy with certain states?

  2. Anonymous says:

    Hi, is there a way to have it trigger all enemies if the state is applied to the enemy instead? I tried:

    b.isStateAffected(14)
    </scope change rule>
    But it does not work. What would I have to change in order for it to check the state on the enemy instead?

  3. Zarsla says:

    How would I go making the scope change between single and all targets, with a press of a button. The skills I have are all single targets, and I want to make it where when I press say “shift” it goes from single to multiple targets. Then when I press shift again it goes back to single taeget.

    Thanx, for any help you can give.

    • Hime says:

      This plugin alone would not be suitable for what you would like to do.
      This is meant to change the scope based on things like having a state applied, or having certain equips on the actor.

      There may be other plugins that would allow you to change scope based on button presses.

  4. QT says:

    Hi Hime,
    is it possible to use your plugin to have a skill with scope “X random enemies” only affect each enemy once?
    For example by adding a state with no further effect, that only lasts for one turn, but would dynamically prevent the enemy from being targeted a second time within the same skill use s soon as it is applied? If yes, what would I have to write as scope change rule?
    scope change rule: ???
    b.isStateAffected(XX)
    /scope change rule
    Thank you in advance & Have a great day

    • Hime says:

      I don’t think it would be possible using the scope change rules. The way targeting works, it checks what the scope is, and then uses that scope to determine who the targets will be.

      So for example, if the scope was X-random enemies, it would pick X random targets. The “random target” functionality is the one that can pick the same target multiple times.
      You will need to change how the random target function works to accomplish what you would like to do.

  5. Podglu says:

    What is the plugin you used for the gauge in the bottom right, i searched but didn’t found it.

  6. Robert Masengale says:

    A lot of my stuff requires Yanfly’s scripts in the project I am working on. Is this plugin and its prerequisite compatible with YEP?

    • Hime says:

      I cannot guarantee that they are compatible with all of yanfly’s plugins. You will have to see whether it works for you.

Leave a Reply to Podglu Cancel reply

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