Hi all. The documentation and looking up on the forums suggest that if using the new style functions and structs etc within scripts they should be available before the create method of an object., but I am finding after many tests the scripts are always too late to the party. To re-create, make a script with this:
And then make an object with a create event that has:
I always get an error saying that Vector2 is undefined at this point, but I assume this must not be correct game maker functionality because of course you would always want your global functions etc defined before your objects are created. Is there something I'm missing here to make sure scripts are read within the correct execution order?
Thanks in advance!
GML:
Vector2 = function(_x, _y) constructor
{
x = _x;
y = _y;
}
Code:
someVar = new Vector2(3, 5);
Thanks in advance!