Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

[Fixed in 1.0.25+] GMLive Doesn't Recognize Tileset Resources?

A topic by VacantShadeGames created Nov 29, 2019 Views: 293 Replies: 2
Viewing posts 1 to 3
(2 edits)

Came across an issue where GMLive doesn't seem to recognize Tilesets as resources.
This code executes fine without GMLive running:

draw_tile( ts_Enigma , 1 , 0 , 0 , 0 );

But with GMLive it fails to execute the code and puts this in the GMS2 Output Console:

Runtime error: RS_Draw_Cursor[L4,c12] `100169` (obj_Room_Studio) does not have a variable `ts_Enigma`

Code editor does recognize it however, and puts it in red type like all other resources.
As a note, this is not being called inside a shader. When called inside a shader, I get another error in addition to the above:

Draw failed due to invalid input layout
Developer

GMLive doesn't recognize tilesets because there used to be no way to enumerate them at runtime. It does seem like tileset_get_name was added recently, so I should be able to address that. As a workaround you could assign it into a global variable for use with GMLive.

Not sure what the shader note has to do with this - GMLive cannot live-update shaders; if your code errors halfway through, you may get unbalanced draw stack.

Thanks for the work around! I'll give it a try.

Sorry I was a little vague about the shader error.
When I mentioned shaders, I meant as in trying to call it in the draw event while a shader has been set, like so:

shader_set( shader_name );
draw_tile( ts_Enigma , 1 , 0 , 0 , 0 );
shader_reset();

That's when it throws the "Draw failed due to invalid input layout" error. Though this doesn't happen when not running GMLive.
Hope this helps!