Silverfire
Member
Hi all, thanks in advance for the help.
Running GM Studio 1.4, I have obj_waterfall which is an invisible object that creates water objects every few steps.
Instance Creation Code (set in Room window):
Create event:
End Step event:
Alarm 0 event:
global.time is a variable that can range between -3 and 3 that can be changed at any time by another object and that affects the rate at which obj_water instances appear, that's why I run an End Step instead of using an alarm that resets itself every few steps.
obj_water code:
End Step event:
I'm not sure why I get this error. endpoint is set in the room creation code for obj_waterfall and obj_water is not supposed to have an endpoint variable, but its kill variable should be set to its obj_waterfall spawner's endpoint value no? There will be multiple obj_waterfall instances in a room, so I don't think I can use a global.endpoint variable.
Running GM Studio 1.4, I have obj_waterfall which is an invisible object that creates water objects every few steps.
Instance Creation Code (set in Room window):
Code:
endpoint=416
Code:
trigger=0
Code:
trigger+=abs(global.time)
if trigger>6 {alarm[0]=1 trigger=0}
Code:
with instance_create(x+random(64)-32,y,obj_water) {start=y kill=endpoint}
obj_water code:
End Step event:
Code:
if y>kill or y<start instance_destroy()
vspeed=global.time*8
I get the following error when running the game:
Code:
FATAL ERROR in
action number 1
of Alarm Event for alarm 0
for object obj_waterfall:
Variable obj_water.endpoint(100007, -2147483648) not set before reading it.
at gml_Object_obj_waterfall_ObjAlarm0_1 (line 1) - with instance_create(x+random(64)-32,y,obj_water) {start=y kill=endpoint}
I'm not sure why I get this error. endpoint is set in the room creation code for obj_waterfall and obj_water is not supposed to have an endpoint variable, but its kill variable should be set to its obj_waterfall spawner's endpoint value no? There will be multiple obj_waterfall instances in a room, so I don't think I can use a global.endpoint variable.
Last edited: