Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(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.