Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[A mystery] Sprites and Objects are Not Recognized

A topic by RandomFangamer created Dec 19, 2019 Views: 237 Replies: 2
Viewing posts 1 to 3
(1 edit)

Hello!

I just installed the new version of GMLive for GM:S1 after not using the program for a while, but I'm encountering a strange error. This occurs on both the error-catching and normal versions of the program. Occasionally, when testing my game, the runner will fail to identify a sprite or object referenced in code. When this happens with sprites, the CompileForm will display a message similar to the following:
(object1) does not have a variable `sprite1`
Nothing is displayed in either the gmlive-server.exe or the CompileForm for objects.
Additionally, the object or sprite will not be created or assigned, and when I was using the non error-catching version the runner would throw an error.

This only occurs within events with live calls in them. Also, I have not yet experimented with live reloading rooms or sprites. Here is an example of code that is causing this problem:

if (live_call()) return live_result;
with (instance_create(x,y,object1)){ //object1 does not have a live call in any code, and it always generates, but sometimes with the original sprite
sprite_index = sprite1; //sprite1 is a normal sprite, but is not the sprite assigned to object1 in its resource properties.
} instance_create(x,y,object2); //object2 has a live call in its Create event. Most of the time, object2 will not generate at all.

This issue started soon after installing the non error-catching version, but after switching to the error-catching version the issues went away for several hours before coming back. What is even weirder is that by spamming the key I've assigned to restart the game with "game_restart()" (F2), the issue can be delayed a few seconds. Generally, the more I spam it, the longer until the issues occur. However, once the issues start all events with live calls are broken until the game is reset.

Other information:
gmlive-server.exe is allowed through my firewall.
I am using Option C with GMEdit to update my code.
I have tried closing and reopening the gmlive-server.exe window and both GMEdit and GM:S1.

Developer

I'll need a sample project that has the issue. game_restart has strange effects since GMLive needs to receive project information from server again, so the reason why doing that a lot delays the error is that you kind of DDOS-ed your gmlive-server with requests and it couldn't reply on time.

In an attempt to fix this issue, I installed GMLive in a new project and copied the files over to the first project. I forgot to remove netlog.exe when doing so. For whatever reason, the issue was fixed. This means that either my installed files were messed up, even though I used the same .gmex file in the new project, or that having netlog.exe in the directory fixed it (even though I am not using Option A).

I must also confess that the issue with the object was my mistake. When I was trying to figure out what was going on with the sprites yesterday, I used GMEdit to add a live call in the object's Create Event, and then wrote "instance_destroy()" below it. After testing to confirm that they did destroy themselves, I removed the line from GMEdit but did not save it, so in GM:S that line still existed. That was my bad :/

If I get this issue again, I will send you a project file with it, but since I can't make it occur again (and really don't want to) I will leave it be for now.