Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[Fixed in 1.0.26+] Issue with Tile Functions

A topic by VacantShadeGames created Feb 05, 2020 Views: 314 Replies: 2
Viewing posts 1 to 3
(3 edits)

Hey, didn't see this in the documentation, so I thought I'd report it.

This code will compile and run without throwing any console errors when in GMLive and when not:

var tile_data = 1;
draw_tile( global.TILESET , tile_data , 0 , 0 , 0 ); // First Draw
tile_data = tile_set_mirror( tile_data , true );
draw_tile( global.TILESET , tile_data , 0 , 20 , 0 ); // Second Draw

However, in GMLive, the second draw will not show up. Interestingly, if I change it to:

draw_tile( global.TILESET , 1, 0 , 20 , 0 ); // Second Draw

 or comment out the tile_set_mirror() function beforehand, the second draw will work fine.

This seems to indicate that the tile_set_mirror() function is causing an issue in GMLive. I can also confirm that the same thing occurs with tile_set_flip() and tile_set_rotate().

Developer

This seems correct - the functions are named inconsistent with their behaviour ("set" in name but return a value) so this slipped by. You would want to open GMLive_std.gml in a text/code editor, find the following bit

#define __lnc__f1632
if (live_enabled) {
tile_set_empty(argument[0]);
} #define __lnc__f1633
if (live_enabled) {
tile_set_index(argument[0],argument[1]);
} #define __lnc__f1634
if (live_enabled) {
tile_set_flip(argument[0],argument[1]);
} #define __lnc__f1635
if (live_enabled) {
tile_set_mirror(argument[0],argument[1]);
} #define __lnc__f1636
if (live_enabled) {
tile_set_rotate(argument[0],argument[1]);
}

and change all of these to be "return tile_...();" .. "} else return 0;"

I'll change this for the next release.

Awesome!

And can confirm, that fixed the issue.