Button Common Events VisuStella MZ

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Download

System

This is a plugin created for RPG Maker MZ.

InstallPluginsMz.png

UpdatePlugins.png

Troubleshooting.jpg

Click here for help on how to install plugins and an explanation on the Tier Hierarchy System.

Click here to learn how to update plugins.

Click here for how to troubleshoot plugins if you get an error.


Masterarbeit Writer


ButtonCommonEventsToolbar.png

ButtonCommonEventsScreen.png


VisuStella MZ

This plugin is a part of the VisuStella MZ Plugin Library.

Click here if you want to help support VisuStella on Patreon.

Introduction

By default, there's only a few keys on your keyboard that perform any kind of action when pressed on the map screen. This plugin allows you to bind Common Events to various other keys to expand the keyboard's functionality. Plugin Commands can be used during the middle of a playthrough to change up which Common Events are bound to each key as well, allowing you, the game dev, to have full control over which keys can be used during the map screen.

Features include all (but not limited to) the following:

  • Functionality to bind Common Events to the number keys, alphabet keys, symbols, numpad, and more.
  • Change which Common Events run during a playthrough.
  • Clear Common Events from keys to remove any bindings.
  • Show visible buttons on the screen to indicate which buttons can be pressed on the keyboard (or with the mouse on the screen).
  • Apply icons to the visible buttons and change them over time.

Requirements

This plugin is made for RPG Maker MZ. This will not work in other iterations of RPG Maker.


Tier 4

This plugin is a Tier 4 plugin. Place it under other plugins of lower tier value on your Plugin Manager list (ie: 0, 1, 2, 3, 4, 5).

This is to ensure that your plugins will have the best compatibility with the rest of the VisuStella MZ Plugin library.


Compatibility Issues

This plugin will most likely have compatibility issues with anything that alters keystrokes or makes use of them through a different manner. If you are using another plugin that does something with keystrokes on the map screen, the likelihood of clashing can occur if these plugins utilize the same keystrokes and we will not be held accountable for that as it is something within your power to change by simply picking different keys.

Instructions

ButtonCommonEventsScreen.png

In the Plugin Parameters, you will see a list of all the keys that you can bind to a Common Event. If that number is something other than 0, then the number associated with it will be the Common Event that will run. If you assign it to a Common Event ID that does not exist, you will get an error so please be wary of that.

You may also notice that some of the keys have in parenthesis a word like (OK) or (Cancel) next to them. What this means is that those keys already have a function assigned to them by the game. If you assign a Common Event to these keys and the 'Forbid Default Bound Keys?' Plugin Parameter is set to 'false', then the native function of the key will be removed in favor of the Common Event you've assigned.

Here is a list of the keys that already have a command assigned:

Key What they're assigned to
Q Assigned to PageUp
W Assigned to PageDown
Shift Assigned to Dash
Z Assigned to OK
X Assigned to Cancel
Space Assigned to OK
Left Assigned to moving left
Up Assigned to moving up
Right Assigned to moving right
Down Assigned to moving down
Insert Assigned to Cancel
Page Up Assigned to PageUp
Page Down Assigned to PageDown
Numpad 0 Assigned to Cancel
Numpad 2 Assigned to moving down
Numpad 4 Assigned to moving left
Numpad 6 Assigned to moving right
Numpad 8 Assigned to moving up


Once again, if you assign Common Events to these keys, the Common Event will removing the binding the key had natively. However, this will only apply while the player is in the field map and if the 'Forbid Default Bound Keys?' Plugin Parameter is set to 'false'. Being inside of a menu or battle system will restore the previously native functions.

Notetags

RPG Maker MZ'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.


The following are notetags that have been added through this plugin. These notetags will not work with your game if this plugin is OFF or not present.

---

Assign Button-Related Notetags

ButtonCommonEvents Update19 Feature.png

---

<Assign Button Common Event: id>

- Used for: Skill, Item, Weapon, Armor Notetags
- Makes this object selectable in the Item scene or Skill scene and have it
  become assignable to a button slot.
- If the object is originally usable (ie a Healing Potion or Healing Spell),
  the button assignment process will take priority and override it.
- Replace 'id' with a number representing the ID of the Common Event you
  wish to assign to a button.
- This needs to be used together with the <Assign Button Slots: x, x, x>
  notetag in order to have any effect.

---

ButtonCommonEvents Update19 Feature.png

<Assign Button Slot: x>
<Assign Button Slot: x, x, x>

- Used for: Skill, Item, Weapon, Armor Notetags
- Lists the keyboard keys that can be assigned a Common Event when pressed.
- If the object is originally usable (ie a Healing Potion or Healing Spell),
  the button assignment process will take priority and override it.
- Replace 'x' with a number or letter representing the button you wish to
  assign a Common Event to.
- This needs to be used together with the <Assign Button Common Event: id>
  notetag in order to have any effect.
- The choices that become available will be listed in the order found in
  this notetag.
- Forbidden, non-existent, and non-valid keys will be filtered out of this
  list and cannot be assigned a Common Event.

  Example:

  <Assign Button Slot: A, S, D, F>
  <Assign Button Slot: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0>

---

<Assign Button Show Cost>

- Used for: Skill Notetags
- If a skill can be assigned, show the cost of the skill if it has one.
- Using this assigned button will not pay the cost. If you want to the pay
  the cost, use the following notetag.

---

<Assign Button Pay Cost>

- Used for: Skill Notetags
- If a skill can be assigned, show the cost of the skill if it has one and
  pays the cost when pressed and activated.
  - If the cost cannot be paid, due to lacking resources or other reasons,
    then the button will be disabled.
- The actor that will pay the cost will be the actor that the button was
  assigned from in the first place.
  - As such, if the actor is not in the party, this will also be disabled.

---

<Assign Button Show Quantity>

- Used for: Item, Weapon, Armor Notetags
- If an item, weapon, or armor can be assigned, show the quantity of the
  party has of that item, weapon, or armor.
- Using this assigned button will not consume the item, weapon, or armor.
  If you want to consume the quantity, use the following notetag.

---

<Assign Button Consume Quantity>

- Used for: Item, Weapon, Armor Notetags
- If an item, weapon, or armor can be assigned, show the quantity of the
  party has of that item, weapon, or armor. This will also consume one of
  the item, weapon, or armor when pressed.
  - This also applies to Key Items. If you don't want Key Items to be
    consumed but have their quantity displayed, use the previous notetag.
  - If the cost cannot be paid, due to lacking resources or other reasons,
    then the button will be disabled.

---

Plugin Commands

PluginCommandsMZ.png

Plugin Commands are event commands that are used to call upon functions added by a plugin that aren't inherently a part of RPG Maker MZ.

Here is a list of Plugin Command(s) that you may use:

---


The following are Plugin Commands that come with this plugin. They can be accessed through the Plugin Command event command.

---

System Plugin Commands

---

ButtonCommonEventsToolbar.png

VisuMZButtonCommonEventsCommand1.png

System: Change Button Common Event - Change the Common Event bound to specific key(s).

 Keys:
 - Select which key(s) to change.
 Common Event ID:
 - Change the Common Event bound to specific key(s).
 Button Icon:
 - What icon do you want to show on this button?

---

VisuMZButtonCommonEventsCommand2.png

System: Change Visibility - Determines whether or not buttons are shown on screen.

 Visible?
 - Show or hide the visible Button Common Events on the screen?

---

VisuMZButtonCommonEventsCommand3.png

System: Clear All Button Common Events - Clears Common Events from all keys.

---

VisuMZButtonCommonEventsCommand4.png

System: Clear Button Common Event - Clears any Common Events bound to specific key(s).

 Keys:
 - Select which key(s) to clear.

---

ButtonCommonEvents Update19 Command1.png

System: Clear Common Event ID(s) - Clears any keys with the marked Common Event ID(s).

 Common Event ID(s):
 - Clears any keys with the marked Common Event ID(s).

---

ButtonCommonEvents Update19 Command2.png

System: Run Stored Button Common Event - Run the Common Event stored on a specific key.

 Target Key:
 - Run the Common Event stored in this key.

---

Plugin Parameters

General Settings

VisMZButtonCommandEventsParam1.png

These are the Plugin Parameters for this plugin. They manage all the key bindings and which Common Events are linked by default to which keys. These links are not permanent as they can be changed/cleared with Plugin Commands.

---

Restriction

 Forbid Default Bound Keys?:
 - Forbid already bound input keys?
 - Allowing them may cause clashes.

---

ButtonCommonEventsToolbar.png

Visible Buttons

 Show On Screen?:
 - Show buttons on screen by default?
 Change Tone on Hover?:
 - Change the tone of the button on hover?
 Hover Tone:
 - Tone settings upon hovering.
 - Format: [Red, Green, Blue, Gray]
 Button Width:
 - The width of the visible button on screen.
 Button Height:
 - The height of the visible button on screen.
 Picture Filename:
 - Picture used as a button background.
 - If left empty, ignore drawing a picture.
 Undeclared Icons:
 - If a Button Common Event doesn't have an assigned icon,
   use one of these instead.
 JS: Draw Data:
 - JavaScript code that determines how to draw the visible button.

---

Button Positions

 JS: Bottom Point:
 JS: Above Point:
 JS: Left Point:
 JS: Right Point:
 - The X and Y coordinates for where the specific side buttons start.

---

Assignment Settings

ButtonCommonEvents Update19 Feature.png

The Assignment Settings Plugin Parameters apply to whenever you use the Assign Button-Related Notetags in-game.

---

Vocabulary

 Instructions:
 - The instruction text that appears when assigning a Common Event to
   a button.

---

Window

 Key Align:
 - Text alignment for the button assignment window?
 JS: X, Y, W, H:
 - Code used to determine the dimensions for the button assignment window.

---


Cost Settings

ButtomCommonEvents CostSettings.png

Adjust the settings involving button press costs.

---

Item Cost Offsets:

 Offset X:
 - Offsets the cost x position.
 - Negative: left. Positive: right.
 Offset Y:
 - Offsets the cost y position.
 - Negative: up. Positive: down.

---

Skill Cost Offsets:

 Offset X:
 - Offsets the cost x position.
 - Negative: left. Positive: right.
 Offset Y:
 - Offsets the cost y position.
 - Negative: up. Positive: down.

---

Misc Settings:

 Disabled Opacity:
 - Opacity used for buttons that are unable to meet cost requirements.

---


Key Settings

ButtonCommonEventsScreen.png

VisMZButtonCommandEventsParam2.png

The Key Settings allow you to adjust the Common Event you want to bind to each keyboard key along with whether or not you want the said key to appear visibly on the screen.

---

Key Settings

 Common Event ID:
 - The default common event tied to this key.
 - Leave it at 0 for no common event.

---

Visible Buttons

 Show Button?:
 - Show the button visibly on the screen?
 Requires Bind?:
 - If the button is shown, does it require a Common Event to be shown?
 Button Label:
 - What text do you want to display as the button label?
 Button Icon:
 - What icon do you want to show on this button?
 JS: Position:
 - The X and Y coordinates for where this button is positioned.

---


Terms of Use

1. These plugins may be used in free or commercial games provided that they have been acquired through legitimate means at VisuStella.com and/or any other official approved VisuStella sources. Exceptions and special circumstances that may prohibit usage will be listed on VisuStella.com.

2. All of the listed coders found in the Credits section of this plugin must be given credit in your games or credited as a collective under the name: "VisuStella".

3. You may edit the source code to suit your needs, so long as you do not claim the source code belongs to you. VisuStella also does not take responsibility for the plugin if any changes have been made to the plugin's code, nor does VisuStella take responsibility for user-provided custom code used for custom control effects including advanced JavaScript notetags and/or plugin parameters that allow custom JavaScript code.

4. You may NOT redistribute these plugins nor take code from this plugin to use as your own. These plugins and their code are only to be downloaded from VisuStella.com and other official/approved VisuStella sources. A list of official/approved sources can also be found on VisuStella.com.

5. VisuStella is not responsible for problems found in your game due to unintended usage, incompatibility problems with plugins outside of the VisuStella MZ library, plugin versions that aren't up to date, nor responsible for the proper working of compatibility patches made by any third parties. VisuStella is not responsible for errors caused by any user-provided custom code used for custom control effects including advanced JavaScript notetags and/or plugin parameters that allow JavaScript code.

6. If a compatibility patch needs to be made through a third party that is unaffiliated with VisuStella that involves using code from the VisuStella MZ library, contact must be made with a member from VisuStella and have it approved. The patch would be placed on VisuStella.com as a free download to the public. Such patches cannot be sold for monetary gain, including commissions, crowdfunding, and/or donations.

7. If this VisuStella MZ plugin is a paid product, all project team members must purchase their own individual copies of the paid product if they are to use it. Usage includes working on related game mechanics, managing related code, and/or using related Plugin Commands and features. Redistribution of the plugin and/or its code to other members of the team is NOT allowed unless they own the plugin itself as that conflicts with Article 4.

8. Any extensions and/or addendums made to this plugin's Terms of Use can be found on VisuStella.com and must be followed.

Terms of Use: Japanese


『VisuStella MZ』利用規約

1. これらのプラグインは、VisuStella.comおよび/または公式に承認されたVisuStellaのソースから合法的な手段で入手したものである限り、フリーゲームや商用ゲームに使用することができます。例外的に使用が禁止される場合については、VisuStella.comの記載をご確認ください。

2. 本プラグインの「クレジット」部分に記載されているすべてのコーダーの名前は、ゲーム内にクレジット表記を行うか、もしくは「VisuStella」という名前の下にまとめて表記する必要があります。

3. ソースコードを自分のものだと主張しない限りは、必要に応じて編集することが可能です。ただしプラグインのコードに変更が加えられた場合、VisuStellaはそのプラグインに対して一切の責任を負いません。高度なJavaScriptのノートタグやJavaScriptコードを許可するプラグインのパラメータを含む、カスタムコントロールエフェクトに使用される、ユーザー提供のカスタムコードについても、VisuStellaは一切の責任を負いません。

4. これらのプラグインやプラグイン内のコードを、「自分のもの」として再配布したり使用したりすることはできません。これらのプラグインとそのコードは、VisuStella.comおよび、その他の公式/承認済みVisuStellaソースからのみダウンロードすることができます。公式/承認済みのソースのリストは、VisuStella.comでご確認いただけます。

5. VisuStellaは、意図しない使用方法による問題、VisuStella MZライブラリ以外のプラグインとの非互換性の問題、プラグインのバージョンが最新でないことによる問題、第三者による互換性パッチが適切に動作していないことなどが原因でゲーム内で発生した問題については、一切の責任を負いません。VisuStellaは、高度なJavaScriptのノートタグやJavaScriptコードを許可するプラグインのパラメータを含む、カスタムコントロールエフェクトに使用される、ユーザー提供のカスタムコードに起因するエラーについても、一切の責任を負いません。

6. VisuStella MZライブラリのコードを使用した互換性パッチをVisuStellaとは関係のない第三者を通じて作成する必要がある場合は、まずVisuStellaのメンバーと連絡を取り、承認を得る必要があります。パッチはVisuStella.comに公開され、誰でも無料でダウンロードすることができるようになります。このようなパッチを、制作発注やクラウドファンディングの対象にしたり、寄付などの金銭的な利益を得るために販売することはできません。

7. このVisuStella MZプラグインが商用製品である場合、プロジェクトチームのすべてのメンバーは、それを使用するため、それぞれ製品を購入しなければなりません。使用方法には、関連するゲームメカニクスの作業、関連するコードの管理、および/または関連するプラグインコマンドや機能の使用、が含まれます。プラグインそのものやそのコードをチームの他のメンバーに再配布することは第4項に抵触するため、そのメンバーがプラグインそのものを所有していない限りは許可されません。

8. このプラグインの利用規約の追加項目や補足については、VisuStella.comに掲載されていますので、それを参照し従ってください。

Credits

If you are using this plugin, credit the following people in your game:

Team VisuStella

Changelog

Version 1.07: March 14, 2024

  • Bug Fixes!
    • Fixed a crash that would occur upon mouse click. Fix made by Arisu.


Version 1.06: February 15, 2024

  • Documentation Update!
    • Help file updated for new features.
  • New Features!
    • New Notetags added by Arisu:
      • Skill: <Assign Button Show Cost>
      • Skill: <Assign Button Pay Cost>
      • Items, Weapon, Armor: <Assign Button Show Quantity>
      • Items, Weapon, Armor: <Assign Button Consume Quantity>
        • Read the helpfile for more information.
    • New Plugin Parameters added by Arisu:
      • Plugin Parameters > Cost Settings
        • Adjust how costs are displayed for the plugin.
      • Parameters > Key Settings > Custom Settings > Custom Width
      • Parameters > Key Settings > Custom Settings > Custom Height
        • Allows buttons to have custom width and height.


Version 1.05: September 1, 2022

  • Bug Fixes!
    • System: Run Stored Button Common Event plugin command should now be working properly. Fix made by Irina.


Version 1.04: January 20, 2022

  • Feature Update!
    • Button Common Event key presses on top of below priority touch events will only be forbidden in the context of a common event assigned to the usual OK buttons instead. Update made by Arisu.


Version 1.03: February 12, 2021

  • Bug Fixes!
    • Pressing a Button Common Event key while stepping onto a below priority touch event will no longer give priority tot he Button Common Event. Fix made by Arisu.


Version 1.02: December 25, 2020

  • Documentation Update!
    • Help file updated for new features.
  • Feature Update!
    • When pressing Button Common Events with the keyboard, any visible buttons on the screen will also flash their color tone briefly to show that they are being pressed. This is only if the Hover Tone Plugin Parameter is enabled. Update made by Yanfly.
  • New Features!
    • New Notetags Added by Yanfly!
      • <Assign Button Common Event: id>
      • <Assign Button Slot: x, x, x>
    • New Plugin Command added by Yanfly!
      • System: Clear Common Event ID(s)
        • Clears any keys with the marked Common Event ID(s).
      • System: Run Stored Button Common Event
        • Run the Common Event stored on a specific key.
    • New Plugin Parameters added by Yanfly!
      • Plugin Parameters > Assignment Settings


Version 1.01: December 4, 2020

  • Feature Update!
    • Plugin Command "System: Change Button Common Event" can now use code for icons. You can insert $gameVariables.value(50) in it and it will use whichever number is stored inside it as an icon. Update made by Irina.


  • Version 1.00
    • Plugin released!

See Also


Help File