Unexplained change of default on battle start

When a battle starts, the leader opens up with his default on 'Item' instead of on 'Attack'.  This has not happened before on any play test, and has only now started about one third of the way through the game.  It is irritating and if the player is acting even slightly on auto-pilot is likely to be confusing.

Does anyone have any ideas about why it should be starting now?  I'm using Yanfly's battle scripts, but these have never caused this problem before.

Thanks
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Check to see if any of your scripts changed the self.index of the Window_ActorCommand.

Window_ActorCommand defines 4 commands that actors can use; by default the self.index is set to 0 which is the first command in the list or attack.

Hope this helps.

Edit: Sorry my info is probably incorrect thought you were using vx instead of vx ace.

Edit2: Just got the RPG maker VX demo and it appears as if Window_ActorCommand is written in a similar but more complex way to VX. I believe you should look and see if any of your scripts changes the select(). The default for this local variable is 0. If this is just happening to the leader of the party than I would assume that there's an if statement somewhere that looks at the current battle actor and if the current battle actor is equal to 1 then select equals 3.
Thanks for the suggestion.

If this were a script issue then I would expect it to be a fairly consistent phenomenon, but it's not.  It just seems to happen on one map, so I think it must be triggered by something else, but I can't think what else might do that.
Then it may be that a switch or variable you are using in your game is also being used by one of the scripts you are using. It is not uncommon for people to use scripts, forget to go through the customization options, and accidentally use the same switch/variable, not realizing the script is also using it.


That would perfectly explain why it just starts happening at a certain point in the game (or on a certain map).


AFTER it starts happening, when you leave the map and go back to one where it was previously working properly, does the problem continue to happen?
No it didn't happen anywhere else, and according to my tester, the problem went away of its own accord.  My concern, though, is to find out what might be the underlying reason so that it doesn't happen to anyone else.  It is unlikely to be a switch or variable, because none are being used on that map.  The only variable used is on 'child' maps (secret rooms) which count up the number of secret rooms found to give a reward at the end, but these should not affect the main map.
Question did it happen when fighting only certain battles or all battles on that map?

If it happened to just certain battles on that map you may want to look and see if there is anything that makes those battles special.

If it was for all battles on that map and if all those battles had one of a certain monster or all of a certain monster it could be monster related.
Battles in this game are of 2 different sorts, depending on what the player chooses at the beginning.  Visible (evented) and invisible.  Both, however, are randomly generated from a list of at least 3 different troops per maps all of which contain a mix of enemies, so that the player has some variety of battles even on one map.  No monster, however, appears in all troops.  My tester was using invisible and reported that the problem occurred with all troops.

Original thread: https://forums.rpgmakerweb.com/threads/unexplained-change-of-default-on-battle-start.18732/