Nathan Laing
Member
Greetings,
In specific circumstances, I've been using alarms as alternative create events.
The circumstances being that I require object A to create object B and object B must do some calculations in the create event with variables specified by object A. However, the create event for object B is run immediately before being given the chance to use the variables specified by object A. (that problem code below). So the solution is to put the calculations in an alarm in object B.
My problem
Apparently, depending on the amount of stuff being processed (game wide?), the set alarm time, say 0.5 or whatever, can at times not be long enough for object B to "get" the values specified from object A before the alarm triggers. i.e. an alarm time of 1 works, but an alarm time of 0.6 or less does not.
In specific circumstances, I've been using alarms as alternative create events.
The circumstances being that I require object A to create object B and object B must do some calculations in the create event with variables specified by object A. However, the create event for object B is run immediately before being given the chance to use the variables specified by object A. (that problem code below). So the solution is to put the calculations in an alarm in object B.
Code:
// OBJECT A create event
var b = instance_create(x, y, obj_b);
b.image_angle = 25;
// OBJECT B create event
if (image_angle == 25) do some calculations // this will never be 25 at the moment of creation
// so we must do alarm[0] = some value (say, 0.5), and put the above if statement in alarm 0. Problem solved.
My problem
Apparently, depending on the amount of stuff being processed (game wide?), the set alarm time, say 0.5 or whatever, can at times not be long enough for object B to "get" the values specified from object A before the alarm triggers. i.e. an alarm time of 1 works, but an alarm time of 0.6 or less does not.