ページ 12

【解決】MOG Battle Cursor マウス動作不具合

Posted: 2019年11月19日(火) 23:16
by ムノクラ
MOG Battle Cursor Frontal 1.0
https://fungamemake.com/archives/5428
敵キャラ選択時にマウスクリックに反応しない。

MOG Battle Cursor 2.3
https://fungamemake.com/archives/5424
最初の敵キャラ以外をマウスクリックで選択できない。

という不具合にあっています。

動作はコア 1.6.2です。

MOG系なので、プラグインパラメーターだけがあるという可能性もありますが…修正方法がお分かりの方がいらっしゃいましたら、ご指導お願いいたします。

※プラグインと必要画像を添付いたしました。
動作検証用であり再配布用ではありませんので、ご理解ください。

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 00:40
by 奏ねこま
MOG_BattleCursor.jsについては明らかにバグなので
「Window_BattleEnemy.prototype.refresh_touch_selection」を以下のコードと差し替えてください。

コード: 全て選択

//==============================
// * Refresh Touch Selection
//==============================
Window_BattleEnemy.prototype.refresh_touch_selection = function() {
    if (this.isCursorMovable()) {
	for (var i = 0; i < $gameTroop.aliveMembers().length; i++) {		
		if ($gameTroop.aliveMembers()[i] === $gameTemp._arrowTarget[0]) {
			var _i = this._enemies.indexOf($gameTemp._arrowTarget[0]);
			if (_i === this._index) {
				this.processOk();
			} else {
			   this._index = _i;			
		 	   this.select(this._index);
			};
		};
	};
	};
	$gameTemp._arrowTarget[0] = null;	
};
MOG_BattleCursorFrontal.jsは、pluginsフォルダに入ってはいますけどサイト上では配布リストに含まれていないので
そもそも公開するつもりがなかったプラグインなのではないでしょうか?
 

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 01:36
by ムノクラ
奏ねこま さんが書きました:MOG_BattleCursor.jsについては明らかにバグなので
「Window_BattleEnemy.prototype.refresh_touch_selection」を以下のコードと差し替えてください。

コード: 全て選択

//==============================
// * Refresh Touch Selection
//==============================
Window_BattleEnemy.prototype.refresh_touch_selection = function() {
    if (this.isCursorMovable()) {
	for (var i = 0; i < $gameTroop.aliveMembers().length; i++) {		
		if ($gameTroop.aliveMembers()[i] === $gameTemp._arrowTarget[0]) {
			var _i = this._enemies.indexOf($gameTemp._arrowTarget[0]);
			if (_i === this._index) {
				this.processOk();
			} else {
			   this._index = _i;			
		 	   this.select(this._index);
			};
		};
	};
	};
	$gameTemp._arrowTarget[0] = null;	
};
MOG_BattleCursorFrontal.jsは、pluginsフォルダに入ってはいますけどサイト上では配布リストに含まれていないので
そもそも公開するつもりがなかったプラグインなのではないでしょうか?
 
早急な対応いただき、ありがとうございます。
コードを差し替え、正常に動作いたしました。

ところで、MOG_BattleCursorFrontal.js には、コード自体が抜けているような未完成な状態だったということでしょうか?
サンプルプロジェクトで、プラグイン管理でもONになっているので、作者がどう考えているのかが分かりかねているのです。
(サンプルプロジェクトやコード・ヘルプを見るに、プログラマーっぽくない面を感じるところはありますが…)

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 09:23
by kiruko
奏ねこま様ムノクラ様ありがとうございます。
MOG_BattleCursorFrontal.jsではなく。
MOG_BattleCursor.jsのみ正常動作を確認いたしました。


私はプラグイン>編集>メモ帳>コピペ しただけなんですが。サイドビュープラグインのみ正常動作しました。

ムノクラ様の言われている通り。Mog様の正式に配布しているダウンロードデータはフロントビューを主軸に
説明したデータとなっており、配布の時点でMOG_BattleCursorFrontal.jsも正常とみなし配布されたと思われますが
サイドビュー。フロントビュー共にバグ状態です。奏ねこ様に教えていただいたプラグインでサイドビューの動作の
正常確認はできました。ありがとうございます。

私はMOG_BattleCursorFrontal.jsを使用したいのですが。どうにかできないでしょうか。
こちらはエネミーだけでなくアクターのマウスタッチもバグっています。
アクターの最後の選択がタッチできません。

よろしければ正常動作するプラグインを張ってもらえないでしょうか。
見比べててみると結構違いがあり。難航しております。詳しくはないので専門の人に見てもらうしかありません。
どうかよろしくお願いいたします。
画像

フロントプラグインの原因はこいつかとおもいます。

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 19:42
by ムノクラ
奏ねこま さんが書きました:MOG_BattleCursor.jsについては明らかにバグなので
「Window_BattleEnemy.prototype.refresh_touch_selection」を以下のコードと差し替えてください。

コード: 全て選択

//==============================
// * Refresh Touch Selection
//==============================
Window_BattleEnemy.prototype.refresh_touch_selection = function() {
    if (this.isCursorMovable()) {
	for (var i = 0; i < $gameTroop.aliveMembers().length; i++) {		
		if ($gameTroop.aliveMembers()[i] === $gameTemp._arrowTarget[0]) {
			var _i = this._enemies.indexOf($gameTemp._arrowTarget[0]);
			if (_i === this._index) {
				this.processOk();
			} else {
			   this._index = _i;			
		 	   this.select(this._index);
			};
		};
	};
	};
	$gameTemp._arrowTarget[0] = null;	
};
MOG_BattleCursorFrontal.jsは、pluginsフォルダに入ってはいますけどサイト上では配布リストに含まれていないので
そもそも公開するつもりがなかったプラグインなのではないでしょうか?
 
上記のコードを差し替えるのは2箇所ともですよね?

サイドビューで味方にスキルを使用(ルキウスがヒールを使う)すると、アクターを選択決定時に下記エラーが起きてしまいました。
フロントビューでは起こりません。

コード: 全て選択

rpg_managers.js:1949 TypeError: this.refresh_touch_selection is not a function
    at Window_BattleActor.update (MOG_BattleCursor.js:1059)
    at rpg_core.js:7035
    at Array.forEach (<anonymous>)
    at WindowLayer.update (rpg_core.js:7033)
    at rpg_scenes.js:262
    at Array.forEach (<anonymous>)
    at Scene_Battle.Scene_Base.updateChildren (rpg_scenes.js:260)
    at Scene_Battle.Scene_Base.update (rpg_scenes.js:113)
    at Scene_Battle.update (rpg_scenes.js:2259)
    at Scene_Battle.update (MOG_BattleHud.js:3901)
MOG_BattleCursorFrontal.js の設定項目を見ると、味方を選択する時のカーソル位置座標を指定できる項目が増えているだけのように見えました。
コードを比較するとかなり違うのですが…

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 20:17
by 奏ねこま
2箇所?
Window_BattleEnemy.prototype.refresh_touch_selectionは1箇所しかないと思いますが・・・

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 20:32
by ムノクラ
奏ねこま さんが書きました:2箇所?
Window_BattleEnemy.prototype.refresh_touch_selectionは1箇所しかないと思いますが・・・
ZIP内の元ファイルから見直してみました。
// * Refresh Touch Selection
は833行目と991行目にありました。
Window_BattleEnemy.prototype.refresh_touch_selection = function() {
の方だけだったのですね。
早とちりだったようです。

お騒がせして、申し訳ございません。

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月20日(水) 23:17
by ムノクラ
MOG_BattleCursorFrontal.js のタッチ動作できました!
多分…。
テストしていただけないでしょうか?

修正済みファイルは下記からダウンロードできます。
https://fungamemake.com/archives/5521


先程の奏ねこま様の修正と同じ箇所は同じ修正をした上で、下記を加えます。

var _alias_mog_bcursor_wbca_initialize = Window_BattleActor.prototype.initialize;
から始まる箇所の最後の }; の手前に下記2行を加えてください。

コード: 全て選択

	this._touch_selection = false;
	if (String(Moghunter.bcursor_touch_selection) === "true") {this._touch_selection = true};
全体としては下記の形になります。

コード: 全て選択

//===========================================================================
// ** Window BattleActor
//===========================================================================

//==============================
// * Initialize
//==============================
var _alias_mog_bcursor_wbca_initialize = Window_BattleActor.prototype.initialize;
Window_BattleActor.prototype.initialize = function(x, y) {
	_alias_mog_bcursor_wbca_initialize.call(this,x, y)
	this._window_mode = false;
	if (String(Moghunter.bcursor_window) === "true" || (!$gameSystem.isSideView() && !Imported.MOG_BattleHud)) {this._window_mode = true};
	this._touch_selection = false;
	if (String(Moghunter.bcursor_touch_selection) === "true") {this._touch_selection = true};
};

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月21日(木) 03:09
by kiruko
ムノクラ様ありがとうございます。
すいません確認不足でした。ごめんなさい。
貼る前。貼った後どちらもクリックしても敵を攻撃することができませんでした。

Re: MOG Battle Cursor マウス動作不具合

Posted: 2019年11月21日(木) 08:45
by ムノクラ
kiruko さんが書きました:ムノクラ様ありがとうございます。

調べてみたんですが
(修正済みファイルは下記からダウンロードできます。
https://fungamemake.com/archives/5521
こちらの日本語版のMOG_BattleCursorFrontal.jsには下記のコードが貼ってありません。

コード: 全て選択

//===========================================================================
// ** Window BattleActor
//===========================================================================

//==============================
// * Initialize
//==============================
var _alias_mog_bcursor_wbca_initialize = Window_BattleActor.prototype.initialize;
Window_BattleActor.prototype.initialize = function(x, y) {
   _alias_mog_bcursor_wbca_initialize.call(this,x, y)
   this._window_mode = false;
   if (String(Moghunter.bcursor_window) === "true" || (!$gameSystem.isSideView() && !Imported.MOG_BattleHud)) {this._window_mode = true};
   this._touch_selection = false;
   if (String(Moghunter.bcursor_touch_selection) === "true") {this._touch_selection = true};
};
ですが結果的に貼る前。貼った後どちらもクリックしても敵を攻撃することができませんでした。
ダウンロードしてみましたが、コードは貼ってありました。
しかし、新規プロジェクトに入れ直しテストしたところ、動作しませんでした…。
なぜ??

取り急ぎ、記事は引っ込めました。
追って調査します。