WordPressのソースコード表示テストを兼ねてRPGツクールMVでプラグインコマンド実行のための最低限のプラグインを作ってみた。
プラグインコマンドで「PluginCommandTest」を設定して呼び出すとメッセージを表示する。
基本的には7,8行目を変更するだけでいろいろできる。
1 2 3 4 5 6 7 8 9 10 11 |
// プラグインコマンドテスト (function() { // PluginCommandTest:メッセージ「プラグインコマンド実行」を表示する var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); if (command === 'PluginCommandTest') { $gameMessage.add("プラグインコマンド実行"); } } })(); |
ピンバック: RPGツクールMVのプラグインを作ってみた パラメータとヘルプ編 – I to C ブログ