Closed vim449 closed 1 year ago
I think arrays are supposed to be supported if you initialize it with a size like so:
const int Personas[14] = { 363, 366, 368, 371, 190, 191, 192, 193, 194, 195, 196, 197, 198, 188 };
It is fixed length and values are required to be known at compile time, so it's still pretty much like a fancy shorthand for variables, but it's nice for code readability I suppose
Sorry, I guess I didn't make it clear enough in my original post, arrays are supported, and you can use them for specific things, however, in nearly any case where you try to access an element of an array with a variable index, the compiler will return the error: return address corruption, and then the array access will behave very inconsistently. Here's a post I made in the Persona Modding discord that outlines exactly what cases cause this error: https://discord.com/channels/746211612981198989/1052660832330334308 In this post I did not initialize it with a size, but I tested all of the cases again with that, and am still getting the error, so even then they still do not function correctly.
Covered by fb798269fc96892aeaf9cab2b32d4b25ad1e2f63
First off, thank you for all the work that you've provided for the modding scene around these games.
From what I understand, the flow file specification does not support arrays, so the way that arrays work in flowscript is that they get compiled to individual variables that represent an individual element. As a result of this, being able to simply access any index of an array with a variable does not work. However, by doing something like the following, it should be possible to support this anyways:
Array lengths are fixed and known at compile time, so it should always be possible to convert any array access with variables into something that the compiled BF files actually allow for. I do not know C# nor have enough understanding of the codebase here to actually implement this feature, but I'm hoping that by outlining a potential fix, someone may implement this at some point such that arrays are actually usable for mod development.