Casper Gaming Developer Corner
Casper Gaming Developer Corner

Documentation

Back to Plugin


Quick InfoVersion: 1.1.1
Made for RPG Maker MZ 1.9.0

Refresh ParametersThis plugin comes with some parameters such as "Refresh After Skill Change"

These parameters will cause the map to refresh after a certain action, when normally the map would not refresh after this action, such as a skill learn or forget event.

When the map refreshes, this makes events recheck their event pages and therefore their conditions for each page. Without a map refresh, it is possible the event would use the page that it used to meet conditions for but no longer does (at least until the next refresh).

Certain actions, such as turning switches on or off, automatically causes a refresh and this is part of RMMZ base code. Other actions, such as skill learn and forget do not. Turning these refresh params on will make the map refresh more often and your events will use the correct event page at all times, at the cost of checking event pages more frequently. In most cases, this should not increase lag noticeably. However, if your game is expected to run on low end hardware such as web/phones or you use maps with tons of events, you may notice performance issues. In these cases, you might be better off leaving these options off. If you do not use those event conditions anywhere, it is also better to turn the refresh params off.

Adding ConditionsTo use extra conditions, create a Comment event command and set the first line in the comment to be:
CGMZ Event Conditions

Afterwards, each line in that comment command will be one extra condition. This plugin supports the following conditions:

Switch: [id] [ON|OFF]
- This will check if the provided switch with id is ON or OFF.
- Example: Switch: 1 OFF

Selfswitch: [mapId] [eventId] [A|B|C|D] [ON|OFF]
- This will check if the provided self switch with map and event id is ON or OFF.
- Example: Selfswitch: 10 8 A OFF

Variable: [id] [>|>=|=|<|<=|!=] [amount]
- This will use the provided operation to compare a variable with the given amount
- Example: Variable: 5 >= 100

Item: [id] [>|>=|=|<|<=|!=] [amount]
- This will check if the party has the provided amount of the item
- Example: Item: 2 > 9

Weapon: [id] [>|>=|=|<|<=|!=|equipped] [amount]
- This will check if the party has the provided amount of a weapon in their inventory or equipped. If using Equipped parameter, the amount will be ignored.
- Example: Weapon: 5 > 1
- Example: Weapon: 5 equipped

Armor: [id] [>|>=|=|<|<=|!=|equipped] [amount]
- This will check if the party has the provided amount of an armor in their inventory or equipped. If using Equipped parameter, the amount will be ignored.
- Example: Armor: 2 = 1
- Example: Armor: 2 equipped

Gold: [>|>=|=|<|<=|!=] [amount]
- This will check if the party has >, <, or = the provided amount of gold.
- Example: Gold: >= 100

Actor: [id] [in|out]
- This will check if the given actor is in or out of the party.
- Example: Actor: 4 out

Vehicle: [boat|ship|airship] [on|off]
- This will check if the player is in a given vehicle.
- Example: Vehicle: boat on

Timer: [>|>=|=|<|<=|!=] [amount]
- This will check if the timer has >, <, or = the provided amount of time (in frames) left. Always false if timer is not active.
- Example: Timer: >= 60
- Please note that the timer does not update events when ticking down, so these conditions will mostly be useful when combined with some other condition or something that does cause the event to be updated.

Skill: [actorId] [skillId] [has|no]
- This will check if the given actor has or does not have the given skill
- Example: Skill: 1 53 has
- The above example will check if actor id 1 has learned skill id 53.
- Please note that if Refresh After Skill Change is set to "false", events will not update to reflect skill changes until some other event occurs which causes events to be refreshed.

State: [actorId] [stateId] [has|no]
- This will check if the given actor has or does not have the given state
- Example: State: 1 10 has
- The above example will check if actor id 1 is affected by state id 10.
- Please note that if Refresh After State Change is set to "false", events will not update to reflect state changes until some other event occurs which causes events to be refreshed.

You can also chain these comments together, just make sure that the first line in each comment is "CGMZ Event Conditions" with one condition per line.

IMPORTANT:
This plugin reports errors! Press F8 in-game and open the console to see if any events with additional conditions have incorrect formatting!

Plugin CommandsThis plugin does not have any plugin commands.

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_UnlimitedEventConditions.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 1.1.0
  • Added skill conditions
  • Added state conditions
  • Added options to refresh map events during certain actions
Version 1.1.1
  • Updated function calls to [CGMZ] Core

Back to Plugin