ロジック部分は完成
var _updateMotionCount = Sprite_Actor.prototype.updateMotionCount; Sprite_Actor.prototype.updateMotionCount = function() { if (Imported.ButtleAnimationManagerEnabled) { debugger; // this._loopCount : あと何回ループさせるか if (this.loopCount >= 0 && this._motion && ++this._motionCount >= this._motion._speed) { if (+new Date() > this._endTm) { // 時刻指定なら通過をチェック this.loopCount = 1; // 最後のループに指定 } if (this._motion.loop || this.loopCount > 0) { if (++this._pattern >= 4) { this._pattern = 0; this.loopCount--; // ストップ確定するのはここだけ! } } else { if (this._pattern < this._motion._last) { this._pattern++ } else { if (Sprite_Actor.MOTIONS[this._motion._next]) { this.startMotion(this._motion._next); // 次のモーションに進む } else { this.loopCount = -1; // 止める } } } this._motionCount = 0; } } else { // _updateMotionCount.call(this); if (this._motion && ++this._motionCount >= this.motionSpeed()) { if (this._motion.loop) { this._pattern = (this._pattern + 1) % 4; } else if (this._pattern < 2) { this._pattern++; } else { this.refreshMotion(); } this._motionCount = 0; } } };
ことはじめ
RPGツクールMVに関する情報を集めてます。
ピックアップした情報は
はてなブックマーク
http://b.hatena.ne.jp/tkoolmv/bookmark
Twitter
https://twitter.com/tkoolmv
ほか、にちゃんねるのRPGツクールMV総合スレで共有していきます。
他に、トラブル報告があった時の調査や、その際に判明した解析結果なども記録しておこうと思います。
戦闘アニメーションの設定とロジック
以下のコードを乗っ取ってアレコレすればいいと判明
rpg_sprites.js(649)
Sprite_Actor.MOTIONS = { walk: { index: 0, loop: true }, wait: { index: 1, loop: true }, chant: { index: 2, loop: true }, guard: { index: 3, loop: true }, damage: { index: 4, loop: false }, evade: { index: 5, loop: false }, thrust: { index: 6, loop: false }, swing: { index: 7, loop: false }, missile: { index: 8, loop: false }, skill: { index: 9, loop: false }, spell: { index: 10, loop: false }, item: { index: 11, loop: false }, escape: { index: 12, loop: true }, victory: { index: 13, loop: true }, dying: { index: 14, loop: true }, abnormal: { index: 15, loop: true }, sleep: { index: 16, loop: true }, dead: { index: 17, loop: true } };
rpg_sprites.js(827)
Sprite_Actor.prototype.updateMotionCount = function() { if (this._motion && ++this._motionCount >= this.motionSpeed()) { if (this._motion.loop) { this._pattern = (this._pattern + 1) % 4; } else if (this._pattern < 2) { this._pattern++; } else { this.refreshMotion(); } this._motionCount = 0; } }; Sprite_Actor.prototype.motionSpeed = function() { return 12; };
企画:戦闘モーション アニメーション管理プラグイン
18種の各アクションについて、それぞれ
- アニメーションパターンを3コマから変更できるようにする。
- アニメーションの早さを設定できるようにする。
- アニメーションをループさせるかさせないかを指定。
- アニメーションをループさせる回数/秒数を指定できるようにする。
- ループ終了時の止め絵を指定できるようにする。
- ActorsのNoteにタグ記述することでキャラ毎に個別設定できるようにする。
プラグインの設定パラメータは
- walk_loop 0 (0 の場合は無限ループ、1以上の場合はループ回数、-1以下の場合は停止させるまでのミリ秒)
- walk_stop 1 (ループ終了後に 1〜4 のどのコマで停止させるか)
- walk_speed 12 (アニメーションさせる間隔、60fps 前提なのでデフォルトの12で秒間5コマ)
の3つを18アクション分
プラグインコマンドで、イベントでパラメータを変更できるようにする?
→ 全員が倍速の世界や、ゆっくりしか動けなくなるシーン演出ができそう?
プラグインコマンドで設定されたパラメータはセーブデータに保存可能か調査。
来月中には、他の調査してる挙動の制御プラグインとしてリリースできたらいいなぁ