When reloading a room it seems that it is no longer possible to get the tilemap id of a given layer. Are these perhaps being moved/consolidated/disconnected from their layers somehow?
I can still get layers by name but when looking for the tilemap associated with that layer I get -1 from layer_tilemap_get_id().
Edit: nevermind! I found the older topic mentioning this. For anyone else, because the layers are recreated dynamically by gmlive you cannot access their tilemap ids using tilemap_get_id(). YAL suggested the following script as a fix:
/// layer_tilemap_get_id_fixed(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;