Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_tile_get_ids_at_depth

(view raw script w/o annotations or w/e)
1
var __tiles;
2
function tile_get_ids_at_depth(argument0) //gml_Script_tile_get_ids_at_depth
3
{
4
    var __depth = argument0
5
    __tiles[0] = -1
6
    var __currtile = 0
7
    var __layers = layer_get_all()
8
    var __numlayers = array_length_1d(__layers)
9
    for (var __i = 0; __i < __numlayers; __i++)
10
    {
11
        if (layer_get_depth(__layers[__i]) != __depth)
12
        {
13
        }
14
        else
15
        {
16
            var __els = layer_get_all_elements(__layers[__i])
17
            var __numels = array_length_1d(__els)
18
            for (var __j = 0; __j < __numels; __j++)
19
            {
20
                var __eltype = layer_get_element_type(__els[__j])
21
                if (__eltype == 7)
22
                {
23
                    __tiles[__currtile] = __els[__j]
24
                    __currtile++
25
                }
26
            }
27
        }
28
    }
29
    return __tiles;
30
}