Equip Requirements (YEP)

From Yanfly.moe Wiki
Jump to navigation Jump to search


System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.

Download

Required Plugins

The following plugins are required in order to use this plugin.

Place the following plugins above this plugin located in the Plugin Manager.

Yanfly Engine Plugins

This plugin is a part of the Yanfly Engine Plugins library.

Click here if you want to help support Team Yanfly on Patreon.

Introduction

This plugin requires YEP_EquipCore.js to work.
Place this plugin beneath YEP_EquipCore.js in the Plugin Manager list.

Place restrictions on when an actor can equip a weapon or piece of armor.
Set level requirements, stat requirements, switch requirements, and more.
This plugin will also provide a separate equipment requirement window to
show the player what is needed in order for gear to be equipped.

Notetags

NotetagsMV.png

RPG Maker MV's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.

You can use these notetags to implement requirements onto your weapons and
armors. These notetags will have to be set up in a certain way:

Weapon and Armor Notetags:

  <Equip Requirement>
   requirement
   requirement
  </Equip Requirement>
  - The main requirements will have to be placed in between these notetags.
  You can have a multitude of requirements for your weapons/armors. Replace
  'requirement' with any of the following below:

Weapon and Armor Requiprements:

  param > x
  param >= x
  param === x
  param <= x
  param < x
  - Replace 'param' with 'level', 'maxhp', 'maxmp', 'atk', 'def', 'mat',
  'mdf', 'agi', or 'luk'. This will make the piece of equipment require the
  actor's base parameter to be greater than (>), greater than or equal to
  (>=), equal to (===), less than or equal to (<=), or less than (<). This
  is NOT the value for the total parameter, only the base parameter. The
  base parameter is calculated by the user's class parameter value, any
  bonuses received by equipment and/or permanent stat increases.

  class: x
  class: name
  - This will make the piece of equipment require the actor to be class x.
  If 'name' is used, priority will be given to the class with the highest ID
  in the database. Insert multiple of these requirements to add more
  classes. Having multiple classes will mean that the actor can be any of
  those classes to be able to equip the gear.

  skill: x
  skill: name
  - This will make the piece of equipment require the actor to have learned
  skill x. If 'name' is used, priority will be given to the skill with the
  highest ID in the database. Insert multiple of these requirements to add
  more skills. Having multiple skills means the actor must have learned ALL
  of the skills to be able to equip the gear.
  *NOTE: The actor needs to have LEARNED the skill. This means that if you
  have added a skill to the actor's skill library through a trait, it will
  not count.

  switch: x
  - This will require switch X to be on. If it isn't, the piece of equipment
  cannot be worn. Insert multiple of these to add more switches that are
  are required to be on.

  unique only
  - This will make the piece of equipment to be "unique", rendering the
  actor to be unable to wear more than 1 of its kind.

Lunatic Mode

JavaScript.png

For advanced users who have an understanding of JavaScript, you can use the following features added by the plugin to further enhance what you can do with your game project.

Custom Equip Requirement Conditions

For those with JavaScript proficiency, you can use these notetags to give
certain pieces of equipment a special requirement before it can be equipped.

Weapon and Armor Notetags:

  <Custom Equip Requirement Condition>
   if (user.name() === 'Harold') {
     condition = true;
   } else {
     condition = false;
   }
  </Custom Equip Requirement Condition>
  The 'condition' variable will determine whether or not the piece of
  equipment can be worn by the user. If 'condition' returns 'true', then the
  piece of equipment can be worn. If 'condition' returns 'false', then the
  piece of equipment can't be worn.

Custom Equip Requirement Text

For those with JavaScript proficiency, you can use these notetags to alter
the text displayed in the Requirement Window.

Weapon and Armor Notetags:

  <Custom Equip Requirement Text>
   text = user.name() + ' has used this sword since young!\n';
   text += 'This is another line for the text!'
  </Custom Equip Requirement Text>
  For those who would like to write custom text for the Requirement Window,
  you can use this notetag. Text codes are allowed here. Use \n for line
  breaks. If you plan on using text codes, \i[4] would appear as \\i[4].
  Whatever value the 'text' variable has at the end will determine the text
  that will be displayed.

Changelog

Version 1.09:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

Version 1.08:
- Updated for RPG Maker MV version 1.5.0.

Version 1.07:
- Fixed a bug that caused unique equipment to not work properly.

Version 1.06:
- Lunatic Mode fail safes added.

Version 1.05a:
- Fixed a bug that caused unremovable items to be removed.
- Added anti-crash for non-existent actors.

Version 1.04:
- Fixed a bug that caused stat comparisons to remain after cancel.

Version 1.03:
- Notetags now allows spaces (whitespace) to be before the requirements.

Version 1.02:
- Fixed a bug where Optimize was able to bypass equip requirements.

Version 1.01:
- Updated for RPG Maker MV version 1.1.0.

Version 1.00:
- Finished Plugin!