Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

[GM issue - workaround] Tile collisions don't work in live rooms

A topic by (: created Aug 09, 2020 Views: 235 Replies: 2
Viewing posts 1 to 2

Hello, just bought your extension it’s really good so far, apart from one thing: collisions using the Pixelated Pope’s tile_meeting() method doesn’t work in live rooms due to the fact layer ID change. It bothers me, since I bought the product mainly for the live room editing feature. Is there any solution to that? I only have one tile layer per room, which contains, which is the one I want to collide with. Thanks in advance :)

Developer(+2)

It's rather that layer_tilemap_get_id doesn't work for runtime-created layers at all.

Here's a replacement that does:

/// layer_tilemap_get_id_fixed(layer)
/// @param layer
var els = layer_get_all_elements(argument0);
var n = array_length_1d(els);
for (var i = 0; i < n; i++) {
    var el = els[i];
    if (layer_get_element_type(el) == layerelementtype_tilemap) {
    return el;
    }
}
return -1;

It works, thank you so much!