Terrain editor save function