MV DreamX State Descriptions all out of order.

So I'm using DreamX's State Descriptions plugin, and for some reason all the states are out of order. I cannot figure out for the life of me why- they're properly ordered in the Passive States list (Using Yanfly's Auto Passive States as well.)
No matter what I do, it just seems to get mixed up somehow, and I'm at my wit's end trying to fix it.
I think it has something to do with how many states there are, but even that's inconsistent at best.
1684431999557.png
You're showing us the output but not the input. Is there anything about this plugin or the Yanfly one that makes it display states by level unlocked order? What is the default sort order and what have you input into the plugin parameters?
Yanfly's plugin doesn't sort by anything as far as I can tell because states aren't a part of it to begin with. DreamX's is the only way it works, though i have no clue how.
I can't figure out what the default sort order is- there isn't a parameter or anything for that in either DreamX's plugin or Yanfly's Auto Passive States one.
The array I've used for Auto Passive States is:

<Passive State: 4, 51, 52, 56, 58, 59, 60, 67, 68, 69, 73, 74, 99, 101, 102, 103, 104, 105>

But for some reason it gets scrambled on the way out. (I used a console log to check the state display order.)

As for sorting by level unlocks, those were (attempted) to be handled by having dummy states that disappear (using a passive condition) once the required level is reached in the appropriate place in the ordering. For some reason the states sometimes switch places when this happens, and I can't figure out why.
Argh, I double posted by accident.
If everything worked properly, the values displayed should all be in ascending order- of course not every value is present but that's due to how some of the passive states work- they're based on conditions like what HP your party's at and whatnot.
I can't figure out what the default sort order is
In most cases the default sort order is by ID, exactly the order as it is in the database
Some plugins change orders, but in most cases almost everyone uses the database-ID-order for everything.
Because that is easier to program
In most cases the default sort order is by ID, exactly the order as it is in the database
Some plugins change orders, but in most cases almost everyone uses the database-ID-order for everything.
Because that is easier to program
See, I assumed that- I made sure all the states are in database order numerically ascending, but for some reason it randomly switches around- and occasionally switching places.

The order they are in the database is the order in which they're supposed to appear, but for some reason they're not. I think it MAY have something to do with how many states are on one character but I'm not really sure considering it looked fine then immediately broke again upon levelling up, even though the amount of states visible didn't change.
Can you show us the database entries for these states and the noteboxes for them?
I don't think this needs so much examining of the why and wherefor - just sort the output 😉

I'm gonna add a line of code to the DreamX plugin; put this as a mini plugin below it.
Code:
Game_Actor.prototype.statusMenuDescriptionStates = function () {
    let stateList=this.states().filter(function (state) {
            return !state.meta.stateDescriptionHide;
        });
    return stateList.sort((a, b) => (a.id-b.id));
    };
Sure.
(Note: how some are coded is that some of them are actually two states: one's a dummy to show up in the menus to tell what it does and the other is for actually doing the business in battle.)
The others you see in between the earlier "unlock at level X" skills are intended for other characters, i'm just using one as an example. They don't show in the first one's passive state array.
I don't think this needs so much examining of the why and wherefor - just sort the output 😉

I'm gonna add a line of code to the DreamX plugin; put this as a mini plugin below it.
Code:
Game_Actor.prototype.statusMenuDescriptionStates = function () {
    let stateList=this.states().filter(function (state) {
            return !state.meta.stateDescriptionHide;
        });
    return stateList.sort((a, b) => (a.id-b.id));
    };
1684437488493.png

Uh... huh. I wonder if I messed it up somehow?

EDIT: never mind, fixed it. let's see if this works...
I don't think this needs so much examining of the why and wherefor - just sort the output 😉

I'm gonna add a line of code to the DreamX plugin; put this as a mini plugin below it.
Code:
Game_Actor.prototype.statusMenuDescriptionStates = function () {
    let stateList=this.states().filter(function (state) {
            return !state.meta.stateDescriptionHide;
        });
    return stateList.sort((a, b) => (a.id-b.id));
    };
OH MY GOD, it works!
Thank you so much, this was driving me up the wall for hours!!
Excellent.

Original thread: https://forums.rpgmakerweb.com/threads/dreamx-state-descriptions-all-out-of-order.157620/