/*============================================================================= MarkerTileset.js ---------------------------------------------------------------------------- (C)2018 Triacontane This software is released under the MIT License. http://opensource.org/licenses/mit-license.php ---------------------------------------------------------------------------- Version 1.2.0 2022/02/06 A1~A5のタイルセットを個別で非表示にできる機能を追加 1.1.0 2021/09/23 MZ用にリファクタリング 1.0.1 2020/06/03 イベントテストを実行するとエラーになる問題を修正 1.0.0 2018/08/12 初版 ---------------------------------------------------------------------------- [Blog] : https://triacontane.blogspot.jp/ [Twitter]: https://twitter.com/triacontane/ [GitHub] : https://github.com/triacontane/ =============================================================================*/ /*: @target MZ @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/MarkerTileset.js @plugindesc Marker tileset plugin @author Triacontane @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/triacontane-MZ-plugins ). Original plugin by Triacontane. Please check the latest official version at: https://triacontane.blogspot.com ----- MarkerTileset.js This allows you to hide specific images from a tileset in-game. This can be used primarily as a marker that appears only in the editor. Specify the following in the tile set's memo field: // Tab [A] will be hidden in-game. Up to E can be specified. // Same as above. To specify multiple tiles, separate them with commas, as shown below: Only the images will be hidden; passability and other information will remain intact. To target only specific tiles within the A tiles, specify the numbers as well: This plugin requires the base plugin "PluginCommonBase.js." "PluginCommonBase.js" is located in the following folder under the RPG Maker MZ installation folder. dlc/BasicResources/plugins/official Terms of Use: You may modify and redistribute this plugin without permission from the author, and there are no restrictions on its use (commercial, 18+, etc.). This plugin is now yours. */ /*:ja @plugindesc マーカータイルセットプラグイン @target MZ @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/MarkerTileset.js @base PluginCommonBase @orderAfter PluginCommonBase @author トリアコンタン @help MarkerTileset.js タイルセットのうち特定の画像だけをゲーム上でのみ非表示にできます。 主にエディタ上でのみ表示されるマーカーのような使い方ができます。 タイルセットのメモ欄に以下の通り指定してください。 <非表示タイル:A> // [A]タブがゲーム上で非表示になります。Eまで指定可 // 同上 複数指定する場合は以下のようにカンマ区切りで指定してください。 <非表示タイル:A,B,D> 表示されなくなるのは画像だけで、通行可能判定等はそのまま残ります。 Aタイルのなかでも特定の番号のタイルのみを対象にする場合は 以下のように番号も指定してください。 <非表示タイル:A1> このプラグインの利用にはベースプラグイン『PluginCommonBase.js』が必要です。 『PluginCommonBase.js』は、RPGツクールMZのインストールフォルダ配下の 以下のフォルダに格納されています。 dlc/BasicResources/plugins/official 利用規約: 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) についても制限はありません。 このプラグインはもうあなたのものです。 */ (()=> { 'use strict'; /** * Game map 条件を満たした場合のタイルセットファイル名を空にします。 */ Game_Map._tilesetTags = { 'a': [0, 1, 2, 3, 4], 'b': [5], 'c': [6], 'd': [7], 'e': [8], 'a1': [0], 'a2': [1], 'a3': [2], 'a4': [3], 'a5': [4] }; const _Game_Map_tileset = Game_Map.prototype.tileset; Game_Map.prototype.tileset = function() { const tileset = _Game_Map_tileset.apply(this, arguments); if (tileset && !tileset.makerApplied) { this.hiddenMakerTiles(tileset); } return tileset; }; Game_Map.prototype.hiddenMakerTiles = function(tileset) { const hiddenTiles = PluginManagerEx.findMetaValue(tileset, ['非表示タイル', 'HiddenTiles']); if (hiddenTiles) { const hiddenTileList = hiddenTiles.split(','); hiddenTileList.forEach(function(hiddenTile) { const indexList = Game_Map._tilesetTags[hiddenTile.toLowerCase()]; if (!indexList) { throw new Error(`Invalid tag name [${hiddenTile}]. Please set A, B, C, D, or E by MarkerTileset.js`); } indexList.forEach(function(index) { tileset.tilesetNames[index] = ''; }); }); } tileset.makerApplied = true; }; })();