As far as I can see, in AGS 3.6.0.8 (patch9) : (September 2021)
This works and it's really cool :
managed struct A { // <-- MANAGED
int i;
};
struct B { // <-- NOT MANAGED
A* a; // <-- Pointer to managed.
};
This works and it's really cool too:
managed struct A
{
int i;
};
struct B{
A* array[];
};
Later :
B b;
b.array = new A[10];
b.array[0] = new A;
b.array[0].i= 666;
This does NOT work :
struct A { // <-- NOT MANAGED
int i;
};
struct B { // <-- NOT MANAGED
A a; // <-- Compiler error! Non-managed inside struct.
};
This does NOT work :
managed struct A { // <-- MANAGED
int i;
};
managed struct B { // <-- MANAGED
A* a; // <-- Compiler error! Pointer to managed inside a managed.
};
Correct?
You should also try the AGS4 branch with the "Use extended script compiler" turned on in General Settings.
All the cool new stuff is coming there, ferne also prepared a commit to make import functions work no matter the order (not yet merged).
- Alan
Quote from: Alan v.Drake on Sat 04/09/2021 03:49:24
You should also try the AGS4 branch, all the cool new stuff is coming there.
Hm. I hear you, but you sounded like you were replying "in general" rather than specifically stating that the examples I described above are now possible.
I don't want to switch to AGS4 just to discover that there's a lot of new cool stuff, just
other cool stuff, not
this.
Nothing has changed since AGS 3.4.0 in this regard. All of the above is correct (although example #3 is not related to the pointer problem).