Actually, I did create variables for offsetting the tiles. it's on line 398-423 in the 'after' code, in the function TileEngine_Scroll_Screen(): (tileWidth = 32, tileHieght = 32, TileNumX, TileNumY)
TileNumX = MapX / tileWidth
TileNumY = MapY / tileHeight
TempX = MapX - (TileNumX * tileWidth)
TempY = MapY - (TileNumY * tileHeight)
Temp1 = 0
Temp2 = 0
if TilesPerScreenX + TileNumX >= mapWidth then Temp1 = 1
if TilesPerScreenY + TileNumY >= mapHeight then Temp2 = 1
for t = 0 to 3
for y = 0 to TilesPerScreenY - Temp2
for x = 0 to TilesPerScreenX - Temp1
paste image TileMap(t ,x + TileNumX, y + TileNumY)+1, (x * tileWidth) - TempX, (y * tileHeight) - TempY
And as for the changes, All I did was add another FOR LOOP for the pasting images for the 4 layers of tiles. I also made a function to load the image file and the tile map file. Oh and the variables that went along with the tile map file.
As for the array out of bounds error, I dont know why it worked for you, but its probably because I had a commented out section for the 'before' code that handled the collsion stuff allowing the character to never leave the area.