MV DreamX_BattlerSpriteIcons shows icons of passives from actors that r not even in the battle.

This is the plugin that this issue is about: https://raw.githubusercontent.com/DreamXRMMV/Rpg-Maker-MV/master/DreamX_BattlerSpriteIcons.js

The icons in the top left corner are passive states from the fifth actor that is not even in the battle.
rsz_1dreamx_party_member_that_r_not_in_battle_passives_are_showen.png



Another issue: if states are added to a battler the onMouseOver-state-description becomes incorrect.
rsz_1dreamx_states_rage_state_desc_is_poison_instead.png



I think I only used the minimum amount of plugins to recreate this issue. Here is my plugin list:

dreamx stateicon issue plugin list.png



Any help is appreciated! 🙂

edit 1: I accidentally wrote "party members" instead of actors.
as far i can see, the plugin uses allBattleMembers
JavaScript:
BattleManager.allBattleMembers = function() {
    return $gameParty.members().concat($gameTroop.members());
};

which seems to be all $gameParty.members() and all $gameTroop.members() ..

It doesnt exclude "$gameParty.members()" which are not in battle..

- you have 2 options,

1.-> always remove actors from $gameParty if they are not in battle,
(And add them back after battle)

2.
-> edit the plugin to exclude $gameParty.members() which are not in battle.. from the "var battlers" plugin variable.
=> or rebuild/replace the "var battlers" with your own code solution, if thats easier to script..
(not sure how you can tell if a $gameParty.members(), is in battle or not, but that would be required as extra condition)

here is the part of the plugin where this is located:
Spoiler
search for the function:

Scene_Battle.prototype.addBattlerStateWindows

Screenshot_10.png



edit1
Another issue: if states are added to a battler the onMouseOver-state-description becomes incorrect.
sry i got no clue on this issue

edit2
only a little hint:
the mouseHover stuff is located here: (pink marked on img)

Spoiler
search for:

DreamX.BattlerSpriteIcons.Scene_Base_update = Scene_Base.prototype.update;


Screenshot_1.png
but this Issue could also be related to the plugin not understanding that a member is not in battle, i would recommend to solve the first issue first, and look if the second issue is still there afterwards..
as far i can see, the plugin uses allBattleMembers

which seems to be all $gameParty.members() and all $gameTroop.members() ..

It doesnt exclude "$gameParty.members()" which are not in battle..
Unless this plugin modifies it, the members() method automatically only returns the members in battle.

See the base function from MV:
Code:
Game_Party.prototype.members = function() {
    return this.inBattle() ? this.battleMembers() : this.allMembers();
};
Unless this plugin modifies it, the members() method automatically only returns the members in battle.

See the base function from MV:
Code:
Game_Party.prototype.members = function() {
    return this.inBattle() ? this.battleMembers() : this.allMembers();
};
well thats weird, i assumed that party members could also be actors which are outside of battle because:

The icons in the top left corner are passive states from the fifth party member that is not even in the battle.

perhaps a missunderstanding from my side, ..
well thats weird, i assumed that party members could also be actors which are outside of battle
That part is a troubleshooting question for @HornsterLG - how do you have a 5th party member that has states on them if they're not in battle? How would they have gotten the states and not be displayed on the screen?

I don't see any way to tell that's not mistakenly printing the same icons from Harold/both enemies, and you don't seem to have any plugin that would allow you to have had that actor in battle and then swap them out.

But my point was, aside from anything else, $gameParty.members() does, in fact, exclude members who aren't in battle.
It doesnt exclude "$gameParty.members()" which are not in battle..
BattleManager.allBattleMembers() returns only the 6 battle members.(I tested it in the dev console, it has been my best bug fixing guess as well).
That part is a troubleshooting question for @HornsterLG - how do you have a 5th party member that has states on them if they're not in battle? How would they have gotten the states and not be displayed on the screen?
It is the 5th actor (another harold). He is not in the battle and he is not part of $gameParty.members().
I used Yanfly's <passive state: 5> notetag in harolds notebox. I don't know why the passive state of actor 5 is active or why it is in the screen. It doesn't make sense to me either.

I don't see any way to tell that's not mistakenly printing the same icons from Harold/both enemies, and you don't seem to have any plugin that would allow you to have had that actor in battle and then swap them out.
When I remove actor 5 the states in the top left corner disappear. Also i just tested to give actor 5 the state 8 confusion, that no one else has and now the state 8 confusion is in the top left corner.
I used Yanfly's <passive state: 5> notetag in harolds notebox.
Sorry, I missed that you said passive states in your first post.

Since you're getting the correct number of battlers from allBattleMembers(), that implies to me these icons might not be getting drawn by the DreamX plugin.

I'm thinking this might actually be a version incompatibility. The DreamX plugins are very old, and this one was released in 2016 - MV was updated to 1.5 in 2017, which I know had some major plugin-affecting updates in its code (for example, you'll see almost all the Yanfly plugins have version updates for compatibility).

It might require going through every aliased function and making sure it's written in a way that's compatible with the newest version of MV. Or finding a similar plugin that's already updated (I know Olivia has a paid plugin that does the same idea).
Sorry, I missed that you said passive states in your first post.

Since you're getting the correct number of battlers from allBattleMembers(), that implies to me these icons might not be getting drawn by the DreamX plugin.
But if I turn the dreamx-plugin off, the icons from actor 5 disappear.
I'm thinking this might actually be a version incompatibility. The DreamX plugins are very old, and this one was released in 2016 - MV was updated to 1.5 in 2017, which I know had some major plugin-affecting updates in its code (for example, you'll see almost all the Yanfly plugins have version updates for compatibility).

It might require going through every aliased function and making sure it's written in a way that's compatible with the newest version of MV. Or finding a similar plugin that's already updated (I know Olivia has a paid plugin that does the same idea).
Unfortunately OliviaStateTooltips-plugin is incompatible with yanfly's animatedSVenemies-plugin. I contacted Olivia about that issue, but she harshly refused to fix the issue. And since her plugin is obfuscated, no one else can fix that issue either.
Then if there are no other plugins that have this functionality and are updated (I almost feel like there have to be, but I'll trust that you searched)...you might need to manually go through this and check every function that's being aliased from the base code.
Code:
        var battlers = [$gameParty.members()[0], $gameParty.members()[1], $gameParty.members()[2], $gameParty.members()[3]];        //original: var battlers = BattleManager.allBattleMembers();
        for (var i = 0; i < $gameTroop.members().length; i++) {
            battlers.push($gameTroop.members()[i])
        }
The problem was that "BattleManager.allBattleMembers()" returned all actors for the plugin(Idk why). Also $gameParty.members() returns all actors for that plugin(Idk why). So I changed the battlers array to work without $gameParty.members(). I tested it and it works. I hope it stays that way.

The issue with the state-icon-hover-description remains, tho.
edit: that hover issue has something to do with SceneManager._scene._tooltipHitObjs. Pressing a skill that adds 1 state to each party.member results in 160 tooltipHitObjs added.
Line 503:
Code:
for (var i = objs.length -1; i > -1; i--) {        //i did this i reverted the loop, so that it starts from the latest _tooltipHitObjs added

The Plugin doesn't seem to update the SceneManager._scene._tooltipHitObjs correctly. Instead of properly removing and adding a tooltipHitObjs it just spams the SceneManager._scene._tooltipHitObjs array with new tooltipHitObjs. When hovering over a state the plugin loops through the tooltipHitObjs and the loop breaks as soon as it finds the first match for a specific state location, but since the tooltipHitObjs-array is spammed with old garbage it uses old garbage instead of the latest added tooltipHitObjs. Reverting the loop, so that it starts with the latest tooltipHitObjs fixed the issue! 🙂 Every state description that pops up now is the latest correct description.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/dreamx_battlerspriteicons-shows-icons-of-passives-from-actors-that-r-not-even-in-the-battle.152827/