Casper Gaming Developer Corner
Casper Gaming Developer Corner

Documentation

Back to Plugin


Quick InfoVersion: Beta R3
Made for RPG Maker MZ 1.9.0

Creating Self VariablesTo create a self variable, either set the variable as a self variable via the plugin's Variables parameter OR add the tag <self> to the variable's name in the editor. You can do both, but only one of the above is needed.

This will make that variable a self variable, and it can no longer be used as a normal variable. You can turn as many variables into self variables as you need.

Game VariablesTo access self variables, you will just use game variables as normal via event command or script call. While within an event, the plugin should know which variable you are trying to access.

If it is easier for you, you may instead optionally access any self variable by using the Get Self Variable and Set Self Variable plugin commands.

Self SwitchesThis plugin's main feature is self variables, but it also allows you to take over global switches and turn them into self switches in the same way as you can do so with self variables. The above documentation for self variables should also apply to self switches.

Self Variable Script CallsIf you are an advanced user writing custom JS either in your own plugin or in some JS parameter where the context is not an event you will need to use the functions
$cgmz.getSelfVariableFromInfo(variableId, eventId, mapId);
and
$cgmz.setSelfVariableFromInfo(variableId, eventId, mapId, value);

Plugin CommandsThis plugin supports the following plugin commands:
Get Self Variable - This command takes an input of the self variable variable ID, event ID, and map ID, and stores the self variable value into a different game variable.

Set Self Variable - This command sets a self variable using the given variable ID, event ID, and map ID. You can use either a static value or a value stored in a game variable as the operand, and it supports set, add, sub, mul, div, and mod operations (same as a normal variable).

Get Self Switch - This command takes an input of the self switch name, event ID, and map ID, and stores the self switch value into a more easily accessible game switch. For use in event processing.

Set Self Switch - This command sets a self switch using the given name, event ID, and map ID. You can use either a static value or a value stored in a game switch as the new value.

Saved GamesThis plugin is fully compatible with saved games. This means you can:

✓ Add this plugin to a saved game and it will work as expected.
✓ Change any plugin params and changes will be reflected in saved games.
✓ Remove the plugin with no issue to save data.

Filename

The filename for this plugin MUST remain CGMZ_SelfVariables.js. This is what it comes as when downloaded. The filename is used to load parameters and execute plugin commands. If you change it, things will begin behaving incorrectly and your game will probably crash. Please do not rename the js file.


Known Issues

This plugin currently has no known issues that need to be fixed. If you believe you have encountered a bug, please report it to Casper Gaming.


Compatibility

This plugin currently has no known compatibility issues with other RMMZ plugins. If you believe you have encountered a conflict, please report it to Casper Gaming.


Version HistoryVersion Beta
  • Reduced chance for incompatibility with other plugins and optimized code
Version BetaR2
  • Self variables now automatically recognized, no manual setting required
  • Added self variable tag
  • Removed change variable plugin command
Version BetaR3
  • Added self switches and various supporting features

Back to Plugin