An open library of RPG Maker MV plugins, powered by the community.

PGMV - The Community-Driven Plugin Library for RPG Maker MV

MV plugins

FTKR Ex Variables Change - FTKR_ExVariablesChange.js

Plugin desc : v1.2.4 Plugin that extends variable operations

License : MIT License

Author : Futokoro

Desc page : https://github.com/munokura/futokoro-MV-plugins

Download Page : https://raw.githubusercontent.com/munokura/futokoro-MV-plugins/refs/heads/master/FTKR_ExVariablesChange.js

File name : FTKR_ExVariablesChange.js

Help of plugin :

@plugindesc v1.2.4 Plugin that extends variable operations
@author Futokoro
@url https://github.com/munokura/futokoro-MV-plugins
@license MIT License

@help
English Help Translator: munokura
This is an unofficial English translation of the plugin help,
created to support global RPG Maker users.
Feedback is welcome to improve translation quality
(see: https://github.com/munokura/futokoro-MV-plugins ).
Original plugin by Futokoro.
Please check the URL below for the latest version of the plugin.
URL https://github.com/futokoro/RPGMaker
-----
-----------------------------------------------------------------------------
Overview
-----------------------------------------------------------------------------
By implementing this plugin, you can manipulate variables and switches in the following situations.

1. When items, weapons, or armor are acquired or removed.
2. When an item or skill is used.
3. At the end of battle.

-----------------------------------------------------------------------------
Setup
-----------------------------------------------------------------------------
1. Add this plugin to the "Plugin Manager."

----------------------------------------------------------------------------
When items, weapons, or armor are acquired or removed.
----------------------------------------------------------------------------
By adding a note tag to the Note field, you can change variables and switches in the following situations.

Applies to: Items, weapons, and armor

1. Execute when purchased from the shop
: Executes each time if purchased multiple times from the shop.
<EVC BUY>
Calculation formula
</EVC BUY>

2. Execute when sold from the shop
: Executes each time if sold multiple times from the shop.
<EVC SELL>
Calculation formula
</EVC SELL>

3. Executes when the number of items increases.
<EVC GAIN>
Calculation formula
</EVC GAIN>

4. Executes when the number of items decreases.
<EVC LOSE>
Calculation formula
</EVC LOSE>

-----------------------------------------------------------------------------
When using an item or skill
-----------------------------------------------------------------------------
Adding a notetag to the Note field will change variables and switches in the following situations.

Applies to: Items, skills, actors, enemies, classes, equipment, and states.

Note that the order in which variables set in tags are calculated is as follows:
Item/Skill ⇒ Actor/Enemy ⇒ Class ⇒ Equipment ⇒ State

<When an Item/Skill is Used>

1. Executes when used, regardless of success or failure.

<EVC USE>
Calculation Formula
</EVC USE>

2. Executes when used successfully.

<EVC SUCCESS>
Calculation Formula
</EVC SUCCESS>

3. Executes when used unsuccessfully (misses or is Evasiond).

<EVC FAILURE>
Calculation Formula
</EVC FAILURE>

4. Executes when damage is dealt.

<EVC DAMAGE>
Calculation Formula
</EVC DAMAGE>

6. Executes when damage is dealt and the enemy is defeated.
(Executes when an actor defeats an enemy, or when the enemy is defeated.)

<EVC KILL>
Calculation Formula
</EVC KILL>

<When Using an Item/Skill>

1. Executes when damage is taken.

<EVC RECEIVE_DAM>
Calculation Formula
</EVC RECEIVE_DAM>

2. Executes when Evading

<EVC When Evading>
Calculation Formula
</EVC When Evading>

-----------------------------------------------------------------------------
At the End of Battle
-----------------------------------------------------------------------------
By adding a note tag to the Note field, you can change variables and switches in the following situations.

Applies to: Actor, Enemy, Class, Equipment, State

Note that the order in which variables set with tags are calculated is as follows:
Actor ⇒ Class ⇒ Equipment ⇒ State
Actor ⇒ Enemy

This process is executed for actors and enemies who participated in battle.
It is executed even if the actor is Collapse.

1. Executes when battle ends: This process is executed last.

<EVC End of Battle>
Calculation Formula
</EVC End of Battle>

2. Executes when the player wins the battle.

<EVC Victory>
Calculation Formula
</EVC Victory>

3. Executes when the player loses the battle.

<EVC Defeat>
Calculation Formula
</EVC Defeat>

4. Executes when the battle ends due to an escape.

<EVC Escape>
Calculation Formula
</EVC Escape>

The end-of-battle generic process does not have a user or target.
Self variables cannot be used.

-----------------------------------------------------------------------------
About generic plugin parameter processing
-----------------------------------------------------------------------------
You can specify a process to be executed every time for each situation, without specifying it using tags such as items or actors.

This generic process is executed after any tag-based processing for items, actors, etc.

To execute multiple calculations, separate the formulas with semicolons (;), as shown below.

Example)
v[1] += 1; v[2] += 1

-----------------------------------------------------------------------------
About Calculation Formulas
----------------------------------------------------------------------------
Calculation formulas (eval) allow you to use non-fixed values by entering a formula, such as the damage formula.
The following codes can be used:
s[x] - Represents the value of switch ID x.
v[x] - Represents the value of variable ID x.
a - References the user's game data. (Only if a user exists.)
b - References the target's game data. (Only if a target exists.)
item - References the data of the used item. (*1)
av[x] - Represents the value of the user's self variable ID x. (*2)
bv[x] - Represents the value of the target's self variable ID x. (*2)
iv[x] - Represents the value of the item's self variable ID x. (*1)(*2)
number - Represents the number of items when buying, selling, or increasing/decreasing.
result - References the result of using a skill or item.
Get the amount of HP damage with result.hpDamage.

(*1) Items refer to skills or items used, or items purchased or sold.
(*2) FTKR_ItemSelfVariables.js is required to use self variables.

[Configuration Example]
Set the following notetags on items to manipulate variables when purchasing.

<EVC BUY>
s[1] = true
v[10] = 10
iv[1] += v[5]
iv[2] += number
</EVC BUY>

Turn switch ID1 ON.
Assign 10 to variable ID10.
Add the value of variable ID5 to self variable ID1 of the purchased item.
Add the number of items purchased to self variable ID2 of the purchased item.

<Notes on variable calculations>
In-game variables are initially set to unknown values other than 0.
Therefore, if you have never assigned a value to an in-game variable,
running a calculation such as v[x] += 1 will result in an incorrect calculation.

Be sure to initialize the in-game variable ID (assign it to 0) before use,
or enter it in the calculation formula as shown below.

Example: To add 1 to variable ID 10:
if(!v[10]) v[10] = 0
v[10] += 1

Note that the self variable in FTKR_ItemSelfVariables.js is always assigned a value of 0
at the start of the game, so the above step is not necessary.

-----------------------------------------------------------------------------
About the License of This Plugin (License)
-----------------------------------------------------------------------------
This plugin is released under the MIT License.
This plugin is released under the MIT License.

Copyright (c) 2017 Futokoro
http://opensource.org/licenses/mit-license.php

----------------------------------------------------------------------------
Change History
----------------------------------------------------------------------------

v1.2.4 - 2018/07/01: Specification Changes
1. Changed the timing of data acquisition upon damage to avoid conflicts with other plugins.

v1.2.3 - 2017/08/24: Bug Fixes
1. Fixed an issue where actor job IDs were not being acquired correctly.

v1.2.2 - 2017/06/07: Bug Fixes
1. Fixed the timing of processing upon receiving damage. (Bug fix in v1.2.1)

v1.2.1 - June 7, 2017: Bug fixes and Traits additions
1. Fixed an issue where game data for the user, target, and skill (item) used could not be referenced when taking damage.
2. Tags at the end of battle are now applied to enemies.
3. The timing of processing when dealing damage has been changed.

v1.2.0 - June 5, 2017: Traits additions
1. Added functionality for item and skill evasion.
2. Reviewed processing.

v1.1.1 - May 19, 2017: Help revisions

v1.1.0 - May 11, 2017: Traits additions
1. Added functionality for when enemies are defeated and when battle ends.
2. Added general-purpose calculation processing that can be set via plugin parameters.

v1.0.6 - 2017/05/03: Bug Fixes
1. Fixed an issue where non-damage situations were not being processed correctly.
2. Fixed an issue where calculation formulas were not being processed correctly.

v1.0.5 - 2017/05/02: Bug Fixes
1. Changed the processing order when adding or subtracting items.

v1.0.4 - 2017/04/28: Bug Fixes
1. Added exception handling when adding or subtracting items.

v1.0.3 - 2017/04/26: Traits Additions
1. Added variable manipulation functionality when taking damage.
2. Expanded the scope of tag targets when using items or skills.

v1.0.2 - 2017/04/25: Bug Fixes
1. Fixed an issue where the target's self variable was not being Reflectioned correctly.

v1.0.1 - April 19, 2017: Bug fixes

v1.0.0 - April 18, 2017: First version created

-----------------------------------------------------------------------------

@param --アイテム増減時--
@text --When items increase or decrease--

@param Buy
@desc General processing when purchasing an item

@param Gain
@desc General processing when items increase

@param Sell
@desc General processing when selling items

@param Lose
@desc General processing when items decrease

@param --アイテム・スキル使用時--
@text --When using an item or skill--

@param Use
@desc General processing when using items and skills

@param Success
@desc General processing when an item or skill is successfully used

@param Failure
@desc General processing when an item or skill fails to be used

@param Damage
@desc General processing when dealing damage using an item or skill

@param Receive Damage
@desc General processing when receiving damage from an item or skill

@param Evade
@desc General processing when avoiding the use of an item or skill

@param Kill
@desc General processing when defeating an enemy using an item or skill

@param --戦闘終了時--
@text --At the end of the battle--

@param Battle End
@desc General processing at the end of battle

@param Battle Victory
@desc General processing when winning a battle

@param Battle Escape
@desc General processing when fleeing from battle

@param Battle Defeat
@desc General processing when losing a battle

スポンサードリンク

-MV plugins

Copyright© PGMV - The Community-Driven Plugin Library for RPG Maker MV , 2026 All Rights Reserved.