WrongInstall
Member
I wanted to post about some issues I've run into in case someone else has the same problem. As of now, if you're output is YCC, it looks like you can't reference delta_time inside a function defined in a struct. This code inside a create event runs just fine in VM and HTML, but fails for YCC:
The error I get for this specific example is:
I'm curious to know if anyone else is running into similar problems.
GML:
test = {
data: 0,
set_data: function() {
data = delta_time;
}
};
test.set_data();
show_debug_message(test.data);
However it's varied in different contexts. All of them seem to have something to do with the variable being unset. Luckily, it looks like we can get around this by setting delta_time to another variable outside of the struct definition, and referencing that instead. This code works just fine on my machine when outputting to YCC:___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object o_test:
STRING argument is unset############################################################################################
gml_Object_o_test_Create_0 (line 9)
GML:
global.DELTA_TIME = delta_time;
test = {
data: 0,
set_data: function() {
data = global.DELTA_TIME;
}
};
test.set_data();
show_debug_message(test.data);