WilloX
Member
Hi,
so one thing that bothers me a bit with GML is that by creating an instance there is no (easy / reliable / known to me) way to set variables before the create event is executed. I would have no problem with the work around
for example.
But i run into trouble time and time again once the create event relies on some variables (i "fix" it with alarms after 1 step but it feels clunky).
But now we have structs and i feel like it is the perfect time to get some new functionality with the instance creation:
where you give a struct as an argument to have the variables in it set immediately.
I sure don't know how GML works behind the curtains but this shouldn't be to difficult (i hope - could be wrong though).
Thanks for reading^^
so one thing that bothers me a bit with GML is that by creating an instance there is no (easy / reliable / known to me) way to set variables before the create event is executed. I would have no problem with the work around
GML:
var inst instance_create_depth(x, y, 0, obj_test);
inst.spd = 2
inst.type = 1
//...
But i run into trouble time and time again once the create event relies on some variables (i "fix" it with alarms after 1 step but it feels clunky).
But now we have structs and i feel like it is the perfect time to get some new functionality with the instance creation:
GML:
instance_create_depth_ext(x, y, depth, object, {spd : 2, type : 1})
I sure don't know how GML works behind the curtains but this shouldn't be to difficult (i hope - could be wrong though).
Thanks for reading^^
Last edited: