papyrus-compiler icon indicating copy to clipboard operation
papyrus-compiler copied to clipboard

Create array with size determined at runtime

Open Scrabx3 opened this issue 2 years ago • 1 comments

Being able to allocate arrays dynamically without relying on a script extender wrapper functions,

int i = 4
int[] a = new int[i]

Scrabx3 avatar Nov 18 '22 19:11 Scrabx3

The op-code for array creation requires a constant size. This is a limitation imposed by the PEX format and can only be solved by very hacky solutions. I will leave this issue open for now, but this is not something that can easily be added by a compiler.

erri120 avatar Nov 18 '22 20:11 erri120