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

PGMZ - The Community-Driven Plugin Library for RPG Maker MZ

MZ plugins

Variable Plus - VariablePlus.js

Plugin desc : Improve variable and switch functionality.

License : MIT License

Author : あわやまたな (Awaya_Matana)

Website : https://awaya3ji.seesaa.net/

Desc page : https://awaya3ji.seesaa.net/article/517527057.html

File name : VariablePlus.js

Help of plugin :

* @target MZ
* @plugindesc Improve variable and switch functionality.
* @author あわやまたな (Awaya_Matana)
* @url https://awaya3ji.seesaa.net/article/517527057.html
* @help Ver.1.0.0
* "Optimization" and "No-Refresh Variables" are primarily intended
* to reduce the load on parallel processing.
*
* Whenever a value is assigned using an event command or the setValue function,
* the map will be refreshed and all conditions will be re-verified.
* When used in conjunction with parallel processing this is done every frame,
* which is inefficient.
*
* Optimization:
* Reduce the refresh frequency.
* If the current and new values are the same, do not refresh the map.
*
* For example, if you created a parallel processing event that constantly
* retrieves a region ID, previously it would be refreshed even if the retrieved
* region ID did not change, but by using this function it will no longer
* be refreshed unless the region ID changes.
* I think it is also suitable for managing character XY coordinates.
*
* No-Refresh Variables:
* Not refreshing at all.
* This is ideal for variables that are not used for conditions at all,
* but are used only for conditional branching or numerical calculations.
*
* Initial Variables:
* You can manage the initial values all at once.
* This is usually done at events, but if you absolutely need it, go ahead.
*
* This is also useful when performing a battle test when using v[n]
* in the damage calculation formula.
* The value function corrects the initial value of undefined to 0
* before returning it, but v[n] returns the contents of the variable directly,
* so undefined will not be corrected to 0.
* Since undefined is not a number, the calculation formula will be incorrect.
* By using this function to enter correct values beforehand,
* you can perform a battle test with a minimum number of events.
*
* @param optimization
* @text Optimization
* @desc If the newly assigned value of a variable or switch is the same as the current value, the map will not be refreshed.
* @type boolean
* @default true
*
* @param noRefreshVariables
* @text No-Refresh Variables
* @desc Specifies variables to not refresh the map.
* For multiple entries, use ",", "-", or "to".
* @type variable[]
*
* @param noRefreshSwitches
* @text No-Refresh Switches
* @desc Specifies switches to not refresh the map.
* For multiple entries, use ",", "-", or "to".
* @type switch[]
*
* @param initialVariables
* @text Initial Variables
* @desc Set initial values of variables.
* @type struct<variables>[]
*
* @param initialSwitches
* @text Initial Switches
* @desc Set initial switches of variables.
* @type struct<switches>[]
*

スポンサードリンク

-MZ plugins

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