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 Item Self Variables - FTKR_ItemSelfVariables.js

Plugin desc : v1.2.2 A plugin that implements self variables for items and skills

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_ItemSelfVariables.js

File name : FTKR_ItemSelfVariables.js

Help of plugin :

@plugindesc v1.2.2 A plugin that implements self variables for items and skills
@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 implement self variables that can be recorded and manipulated during saves for the following objects.

1. Items
2. Weapons
3. Armors
4. Skills
5. Actors
6. Enemies

Self variables can be displayed using control characters.

For instructions on how to use the plugin, please refer to the following website:
https://github.com/futokoro/RPGMaker/blob/master/FTKR_ItemSelfVariables.ja.md

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

This plugin rewrites the damage calculation formula.

For this reason, please add it as high up in the Plugin Manager as possible.

----------------------------------------------------------------------------
Self Variable Settings
----------------------------------------------------------------------------
Change the settings using the following plugin parameters.

<*** Number>
: Sets the number of self variables to use individually.

<Enabled Save>
: Specifies whether self variables are saved when saving.
: If not saved, they will be reset each time the game is started.
: This setting applies to items, weapons, armor, skills, actors, and enemies.

You can set initial values by adding the following tags to the Note field for items (including weapons and armor), skills, and actors.

<ISV IV[x]: y>
: Sets the initial value of self variable ID x to y.

-----------------------------------------------------------------------------
Script Commands
-----------------------------------------------------------------------------
The following script commands can be used with self variables.
Please change the item(x) part to 'weapon(x)' for weapons, 'armor(x)' for armor,
'skill(x)' for skills, 'actor(x)' for actors, and 'enemy(x)' for enemies.

1. Getting the Value of a Self Variable
$gameSelfVariables.item(x).value(y)
: Gets the value of self variable y for item ID x.

2. Changing the Value of a Self Variable
$gameSelfVariables.item(x).setValue(y, value (, 'code') )
: Assigns value to self variable y for item ID x.
: You can perform calculations other than assignments by entering the following characters in the code section.
: Addition (+) - Adds value to the value of self variable y.
: Subtraction (-) - Subtracts value from the value of self variable y.
: Multiplication (*) - Multiplies the value of self variable y by value.
: Division (/) - Divides the value of self variable y by value.
: Remainder (%) - Assigns the remainder when dividing value by self variable y.
:
: Input example)
: $gameSelfVariables.item(10).setValue(1, 10)
: Assigns 10 to self variable 1 of item ID 10.
:
: $gameSelfVariables.weapon(12).setValue(2, 6, '+')
: Adds 6 to self variable 2 of weapon ID 12.
:

3. Deleting Self Variables
$gameSelfVariables.item(x).clear()
: Deletes all self variables for item ID x.
: Does not assign 0.

4. Initializing Self Variables
$gameSelfVariables.item(x).allReset(value)
: Assigns value to all self variables for item ID x.
: 'All' here refers to the number specified by <*** Number>.

-----------------------------------------------------------------------------
Plugin Commands
-----------------------------------------------------------------------------
This plugin supports the following commands.
Note that they are case-insensitive, so either uppercase or lowercase is acceptable.

1. Changing Self Variables
Changes the self variable for the specified item ID.

ISV_SET_SELF_VARIABLES ITEMTYPE itemId selfVariableId CALCTYPE value

For item type, enter item, weapon, armor,
skill, actor, or enemy.
For calculation method, enter assignment (=), addition (+), subtraction (-), multiplication (*), division (/), or remainder (%).
You can specify in-game variables for the item ID, self variable ID, and assigned value.
To use an in-game variable, enter v[n] instead of a numeric value.

Input example)
ISV_SET_SELF_VARIABLES item 10 1 = v[5]
: Assigns the value of in-game variable ID 5 to self variable ID 1 of item ID 10.

2. Get Self Variable
Assigns the self variable of the specified item ID to an in-game variable.

ISV_GET_SELF_VARIABLES variableId ITEMTYPE itemId selfVariableId

For item type, enter item, weapon, armor, skill, actor, or enemy.
You can specify in-game variables for the in-game variable ID, item ID, and self variable ID.
To use an in-game variable, enter v[n] instead of a numeric value.

Input example)
ISV_GET_SELF_VARIABLES 5 weapon 10 1
: Assigns the value of self variable ID1 of weapon ID10 to in-game variable ID5.

-----------------------------------------------------------------------------
Applying self variables to damage calculation formulas
-----------------------------------------------------------------------------
Self variables can be used in item and skill damage calculation formulas.
Reference the value of self variable ID x by entering the following code in the formula:

av[x] - References the value of self variable ID x of the user.
bv[x] - References the value of self variable ID x of the target.
iv[x] - References the value of self variable ID x of the item or skill being used.

Example:
a.atk * (4 + iv[1]) - b.def * 2

<If you are unable to deal damage whenever you enter a self variable such as 'iv[x]'>
The code cannot be used due to a conflict with another plugin.
In this case, please use the following script instead.

iv[x] ⇒ item._seflVariables._data[x]
av[x] ⇒ (a.isActor() ? a.actor()._seflVariables._data[x] : a.enemy()._seflVariables._data[x])
bv[x] ⇒ (b.isActor() ? b.actor()._seflVariables._data[x] : b.enemy()._seflVariables._data[x])

Note that if the skill or item in the av[x] script is only used by actors, you can omit the line as shown below.

av[x] ⇒ a.actor()._seflVariables._data[x]

Also, if the target is only allies,
bv[x] ⇒ b.actor()._seflVariables._data[x]

If the target is only enemies,
bv[x] ⇒ b.enemy()._seflVariables._data[x]


-----------------------------------------------------------------------------
Control Characters
-----------------------------------------------------------------------------
This plugin supports the following control characters.
Note that they are case-insensitive, so either uppercase or lowercase characters can be used.

¥ITV[x,y]: References the value of the self variable ID y for item ID x.
¥WEV[x,y]: References the value of the self variable ID y for weapon ID x.
¥ARV[x,y]: References the value of the self variable ID y for armor ID x.
¥SKV[x,y]: Refers to the value of self variable ID y for skill ID x.
¥ACV[x,y]: Refers to the value of self variable ID y for actor ID x.
¥ENV[x,y]: Refers to the value of self variable ID y for enemy ID x.

Note: Both the numbers x and y are required.

When using the above control characters in descriptions or profiles,
you can omit the "x," part within [].
If omitted, for example, in the case of an item, the self variable of that item will be referenced.

-----------------------------------------------------------------------------
License for this plugin
-----------------------------------------------------------------------------
This plugin is released under the MIT License.

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

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

v1.2.2 - 2018/01/08: Help section additions

v1.2.1 - 2017/10/20: Traits additions
1. Added the ability to omit the item ID when using control characters in the item description.

v1.2.0 - October 19, 2017: Added support for control characters.

v1.1.3 - May 3, 2017: Added formula functions.

v1.1.2 - April 29, 2017: Revised damage calculation formula processing.

v1.1.1 - April 26, 2017: Bug fixes.
1. Added exception handling to the damage calculation formula.

v1.1.0 - April 18, 2017: Specification changes and Traits additions.
1. The number of self variables used can now be set for each item and skill.
2. Added self variables to actors and enemies.

v1.0.1 - April 14, 2017: Traits additions.
1. Added the ability to set the initial value of self variables.
2. Added the ability to assign strings to self variables.
3. License change.

v1.0.0 - March 26, 2017: First version created

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

@param --セーブ設定--
@text --Save settings--

@param Enabled Save
@desc Whether to save self variables when saving: 0 - Do not save, 1 - Save
@default 0

@param --アイテム設定--
@text --Item Settings--

@param Item Number
@desc Set the number of self variables used in an item
@default 0

@param --武器設定--
@text --Weapon Settings--

@param Weapon Number
@desc Set the number of self variables used by the weapon
@default 0

@param --防具設定--
@text --Armor settings--

@param Armor Number
@desc Set the number of self variables used by the armour
@default 0

@param --スキル設定--
@text --Skill Settings--

@param Skill Number
@desc Set the number of self variables used in your skill
@default 0

@param --アクター設定--
@text --Actor Settings--

@param Actor Number
@desc Set the number of self variables used by an actor
@default 0

@param --エネミー設定--
@text --Enemy Settings--

@param Enemy Number
@desc Set the number of self variables used by enemies
@default 0

スポンサードリンク

-MV plugins

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