Moghunter Battle Cursor/Yanfly Selection Control Compatibility

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
70
Reaction score
65
First Language
English
Primarily Uses
RMMV
Affected plugins:
MOG Battle Cursor
YEP Target Core
> YEP Selection Control

My issue is that the cursor becomes permanent when you hover over your targeted allies with a skill/item, as seen below. It works fine for enemies. I noticed someone else has made a thread about the same exact issue. Also, I am aware that Yanfly has their own battle cursor plugin, but I prefer the look and feel of Moghunter's, not to mention that I can't select targets with left or right arrow keys for Yanfly's, so I'm reluctant to swap plugins.

mog.jpg

I've attached the cursor plugin and images (img/system) for your convenience. Thanks in advance.

BattleCursor_A.png BattleCursor_B.png
 

Attachments

  • MOG_BattleCursor.js
    34.6 KB · Views: 18

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
70
Reaction score
65
First Language
English
Primarily Uses
RMMV
Hello @zaraku,
Did you fix the problem?
I have the same

Thanks
Unfortunately no, I decided to just use Yanfly's cursors. I tried to mimic Mog's cursors the best I can:

Yj0PQYa.png

aYjNcOg.png
 

shukiri

Villager
Member
Joined
Nov 6, 2018
Messages
21
Reaction score
8
First Language
english
Primarily Uses
RMMV
Here's a start (just know that I am not a developer). I'm sure there is a less convoluted way to fix this. For whatever reason, yanfly's plugin commandeers the battleenemy window for BOTH actors and enemies, which is where the compatibilities clash. None of the battleactor functions get used from mog.

First of all, you need to add the MOG arrow clearing code to ok/cancel for skills and items since it's not doing it automatically. I just added it to the 4 Scene_battle functions at the bottom of targetcore:
Code:
Yanfly.Target.Scene_Battle_onEnemyOk = Scene_Battle.prototype.onEnemyOk;
Scene_Battle.prototype.onEnemyOk = function() {
    BattleManager.clearCustomTargetSelectGroup();
    Yanfly.Target.Scene_Battle_onEnemyOk.call(this);
    $gameTemp._arrowAllTargets[1] = false;
    for (var i = 0; i < $gameParty.members().length; i++) {$gameParty.members()[i]._arrowVisible = false; };
    
};

Yanfly.Target.Scene_Battle_onEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
Scene_Battle.prototype.onEnemyCancel = function() {
    BattleManager.clearCustomTargetSelectGroup();
    Yanfly.Target.Scene_Battle_onEnemyCancel.call(this);
    $gameTemp._arrowAllTargets[1] = false;
    for (var i = 0; i < $gameParty.members().length; i++) {$gameParty.members()[i]._arrowVisible = false; };
};

Yanfly.Target.Scene_Battle_onActorOk = Scene_Battle.prototype.onActorOk;
Scene_Battle.prototype.onActorOk = function() {
    BattleManager.clearCustomTargetSelectGroup();
    Yanfly.Target.Scene_Battle_onActorOk.call(this);
    $gameTemp._arrowAllTargets[1] = false;
    for (var i = 0; i < $gameParty.members().length; i++) {$gameParty.members()[i]._arrowVisible = false; };
};

Yanfly.Target.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel;
Scene_Battle.prototype.onActorCancel = function() {
    BattleManager.clearCustomTargetSelectGroup();
    Yanfly.Target.Scene_Battle_onActorCancel.call(this);
    $gameTemp._arrowAllTargets[1] = false;
    for (var i = 0; i < $gameParty.members().length; i++) {$gameParty.members()[i]._arrowVisible = false; };
};

Secondly, you need to edit the processcursormove in MOG's plugin because it's not clearing after every move. Also, again, it applies to both actors and enemies now.
Code:
var _alias_mog_bcursor_wbeny_processCursorMove = Window_BattleEnemy.prototype.processCursorMove;
Window_BattleEnemy.prototype.processCursorMove = function() {
     if (!this._window_mode && this.isCursorMovable()) {
        
        var lastIndex = this.index();    
        if (Input.isRepeated('down')) {this.addIndex(1)};
        if (Input.isRepeated('up')) {this.addIndex(-1)};
        if (Input.isRepeated('right')) {this.addIndex(1)};
        if (Input.isRepeated('left')) {this.addIndex(-1)}; 
        var newindex = this.index();
        if (this.index() !== lastIndex) {
            SoundManager.playCursor();
            //---------------------------------- changed
            for (var i = 0; i < ($gameParty.members().length); i++) {$gameParty.members()[i]._arrowVisible = false; } 
            if (this.enemy().isActor()) {
                this._enemies[newindex]._arrowVisible = true; 
            }
            //------------------------------------
        };
        return;
     };
     
     _alias_mog_bcursor_wbeny_processCursorMove.call(this);
};

Hopefully this helps someone get started on a fix. The only issue left is that if you use an item that targets all allies, it doesn't clear the blinking white flash on actors. I can't find whatever makes that effect.
 

Latest Threads

Latest Posts

Latest Profile Posts

Posted some halloween freebies! Grab them while on season :kaopride:
hallow_cat.png
So my birthday was about a week ago! Just forgot to post it. I went to a Golden Corral, and it was soooooo good! :kaojoy: I also got some Animal Crossing in my life! Yay, Animal Crossing!
At this point, "unique and diverse cast of characters" might as well be slang for Every Character is a Human-Sue.
I found an absolutely brilliant lifehack on the internet today.

Screenshot_760.jpg

Forum statistics

Threads
116,143
Messages
1,096,143
Members
151,570
Latest member
grungewitch
Top