Thread:ヌヌハラ/@comment-46261745-20200811184042/@comment-44256294-20200811235155

I haven't tried editing a class definition in AinDecompiler before but I'm not surprised that it doesn't work. It would be very tricky to implement. However I believe it should be possible to achieve what you're trying to do with AinDecompiler.

First, you need to understand how constructors work in system 4. Whenever you have a class with an array member, a constructor will be generated for that class (whether one is explicitly defined or not) because the system needs to run some code when the object is created in order to allocate memory for the array. This constructor function will be named "ClassName@0" (or "ClassName::0").

The first thing this "0" function does is call another function named "ClassName@2" (or ClassName::2)[1]. THIS is the function that actually allocates memory for the array. If you find the "tagBattleStatus@2" function, you will see it contains the line:

this.m_aspSp.Alloc(5);

By changing this number you should be able to change the size of the array.

[1] Frustratingly, AinDecompiler doesn't actually show the call to ClassName@2 in the ClassName@0 function. If you open the "Disassembled" view you can see it, but the "Decompiled" view hides the fact that this is happening.