Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_tile_get_ids

(view raw script w/o annotations or w/e)
1
var __tiles;
2
function tile_get_ids() //gml_Script_tile_get_ids
3
{
4
    __tiles[0] = -1
5
    var __currtile = 0
6
    var __layers = layer_get_all()
7
    var __numlayers = array_length_1d(__layers)
8
    for (var __i = 0; __i < __numlayers; __i++)
9
    {
10
        var __els = layer_get_all_elements(__layers[__i])
11
        var __numels = array_length_1d(__els)
12
        for (var __j = 0; __j < __numels; __j++)
13
        {
14
            var __eltype = layer_get_element_type(__els[__j])
15
            if (__eltype == 7)
16
            {
17
                __tiles[__currtile] = __els[__j]
18
                __currtile++
19
            }
20
        }
21
    }
22
    return __tiles;
23
}