Sorry with a somewhat specific question, but I'm trying to figure out a concept where I can adapt the ranges for what I have now...
Example - tile (5,4) will get array [(3,3)...(5,5)] as it will be in that array.
Right now, I can use these two functions to generate an array of all the tile positions in the rectangle between (0,0) and (2,2) (I realise I've generated the array twice but one's for a check only) based on if the current tile position is in the array.
Helper function (should determine which 3x3 grid to use)
var tile = get_n_pos()
#var a = 0
#var b = 3
for x in range(0,3):
for y in range(0,3):
var check = 
if tile in check:
Main region array function
var rect = 
for x in range(tile_pos.x,tile_pos.x+3):
for y in range(tile_pos.y,tile_pos.y+3):
if get_cell(x,y) != -1: