I was trying out to make a dynamic array of an array.
The declration of it works fine, however I ran into a strange issue.
Code: Select all
version "3.3"
Class MyDoomPlayer : DoomPlayer
{
Array<double> MyArray[MAXPLAYERS];
override void Tick()
{
int playerNum = PlayerNumber();
For (int i = 0; i < MyArray.Size(); i++)
{
MyArray[playerNum][i] = 2;
}
MyArray[playerNum].Push(4);
Super.Tick();
}
}
If I try to start the GZDoom with it, I will get the following error message:
Code: Select all
Script error, "InvalidResizableArray.pk3:zscript.txt" line 12:
Invalid resizable array
Line 12 is this:
However, if I replace "playerNum" with any number between 0 and 7, it will work fine. I only get the error message when I use the variable instead.
I was trying out to make a dynamic array of an array.
The declration of it works fine, however I ran into a strange issue.
[code]
version "3.3"
Class MyDoomPlayer : DoomPlayer
{
Array<double> MyArray[MAXPLAYERS];
override void Tick()
{
int playerNum = PlayerNumber();
For (int i = 0; i < MyArray.Size(); i++)
{
MyArray[playerNum][i] = 2;
}
MyArray[playerNum].Push(4);
Super.Tick();
}
}
[/code]
If I try to start the GZDoom with it, I will get the following error message:
[code]
Script error, "InvalidResizableArray.pk3:zscript.txt" line 12:
Invalid resizable array
[/code]
Line 12 is this:
[code]
MyArray[playerNum][i] = 2;
[/code]
However, if I replace "playerNum" with any number between 0 and 7, it will work fine. I only get the error message when I use the variable instead.