Hi!
I cannot access Struct properties via array in AGS 4.0
I only see the length property of the array.
When I try to run it it throws a "Null pointer referenced" error on the first line when I try to access the struct property. (Error line: testStruct_Array[0].int1 = 1;)
However, it works perfectly in 3.6
Any idea what could be the problem?
Header:
Code: ags
Script:
Code: ags
I cannot access Struct properties via array in AGS 4.0
I only see the length property of the array.
When I try to run it it throws a "Null pointer referenced" error on the first line when I try to access the struct property. (Error line: testStruct_Array[0].int1 = 1;)
However, it works perfectly in 3.6
Any idea what could be the problem?

Header:
managed struct TestStruct {
int int1;
int int2;
int int3;
bool flag;
};
Script:
TestStruct* testStruct_Array[];
function test_func() {
testStruct_Array = new TestStruct[10];
testStruct_Array[0].int1 = 1;
testStruct_Array[0].int2 = 2;
testStruct_Array[0].int3 = 3;
testStruct_Array[0].flag = true;
}