Comments

Log in with itch.io to leave a comment.

(1 edit)

ribbyte, can you look at my error log please? 🙏

ERROR in

action number 1

of Alarm Event for alarm 1

for object oPlayer:

Unable to find instance for object index -4

 at gml_Script_execute_every_n_frames (line 44) -        inst._interval = n

###############################

gml_Script_execute_every_n_frames (line 44)

gml_Script_execute_after_n_frames (line 51) -        inst = execute_every_n_frames(n, callback)

gml_Script_execute_after_n (line 113) -        execute_after_n_frames(interval, callback);

gml_Object_oPlayer_Alarm_1 (line 5) - execute after 120 frames

What could go wrong? Thanks.


Edit: I solved it, but I still don't know what caused this.

(+1)

Hmm, did the object get deleted by any chance? I think I have a check if the object that’s executing the code still exists but I may have missed a check somewhere.

Alternatively, how do you create the object? You might have the same problem the other commenter had. 

If you still have the old code with the bug, you can send it to me at ribbyteapps@gmail.com 

(3 edits)

Here it is:

var inst = instance_create_depth(0,0,-9999,oWarp); //create Warp object, which will change room with fade-in and fade-out animation
    inst.target_x = oPlayer.x; //
    inst.target_y = oPlayer.y; //
    inst.target_room = RoomTV; //change room and teleport player when screen is covered (it takes ~~1.5 sec)
execute after 3 seconds // I think the timer stays in the last room, which caused the error because it can't run from previous room
var inst = instance_create_depth(0,0,-9999,oWarp);
    inst.target_x = oPlayer.x; //
    inst.target_y = oPlayer.y; //
    inst.target_room = Room1; //this code returns the player to the previous room in 3 seconds
done

if you still have questions, please ask

(1 edit)

It looks like this is the same error Dave encountered in the comment below. I posted the fix there (change instance_create_depth to instance_create_layer or adjust the Muffel script the other way around, refer to the comment below for more details).


I‘m not sure yet how to fix Muffel to allow both of those functions to be used, might have to look into it later.

Very nice idea, but it is very buggy. For example: when I used this in one object, everything works well, then tried it with another object and got this error:

ERROR in
action number 1
of Create Event
for object o_element:

Unable to find instance for object index -4
 at gml_Script_execute_every_n_frames (line 44) -        inst._interval = n
############################################################################################
gml_Script_execute_every_n_frames (line 44)
gml_Script_execute_after_n_frames (line 51) -        inst = execute_every_n_frames(n, callback)
gml_Script_execute_after_n (line 113) -        execute_after_n_frames(interval, callback);
gml_Object_o_element_Create_0 (line 3) -                       execute after 60 frames
gml_Script_instance_create (line 7)
gml_Script_engine_ne (line 120) -                (    0 + _spc + _xplus  +        (i-1)  * ( ( (room_width - _spc*2)  / (_noeol-1)) ) ,
gml_Script_scr_new_task (line 27)
gml_Script_anon_anon_gml_Object_o_program_Create_0_1590_gml_Object_o_program_Create_0_1798_anon_gml_Object_o_program_Create_0_1590_gml_Object_o_program_Create_0 (line 53) -                      scr_new_task();
gml_Object_obj_muffel_Alarm_0 (line 11) -        _my_callback(self);


I used very simple line in event create:

execute after 60 frames
      audio_play_sound(snd_score,3,0);
done

Thanks for the report!

What I can gather from your error log is that the object which is calling the "execute after 60 frames" was deleted/destroyed in the meantime? I thought I caught all errors of that type, but I might have missed a checked somewhere. I will look into it and update when I find the error.

It would be really helpful if you could share your project with me, so I can debug it faster (you can also create a new project that reproduces the same bug). You can reach me via ribbyteapps at-symbol gmail.com

If you find any more bugs, feel free to report all of them.

I just sent you the file that reproduces this bug. The problem is, I think when you try to use Muffel system in objects that weren't put manually to the room. If the object has some muffel functions and is created by another object, then you will get the error.

Did you have time to look at the example with this error?

For completeness' sake: The bug probably occurs when using "instance_create_depth" which adds a new layer for that specific object and Muffel can't find it (due to limitations of GM). I have not heard back from Dave if this resolved his problem yet, but I would be surprised if not. If anybody else has the same problem, feel free to contact me! Here is the fix if you want to try it for yourself:

Either use "instance_create_layer" instead of "instance_create_depth" in your own script, or do the opposite in the Muffel script (replace "instance_create_layer(0, 0, layer, obj_muffel)" with "instance_create_depth(0, 0, 0, obj_muffel)")

Yep, it works. Instance_create_depth caused the problem. Sorry for not replying. 

(+1)

This is pure Genius! Thanks!

Glad you like it!