Works fine for me. However, if I try to reuse the same object ID for another object then I get an error - but not if I make another terrain.
This is what I tried (code fragment only)
xscale#=3: yscale#=0.6: zscale#=3
make object terrain 1 ` create the terrain object
set terrain heightmap 1, "terrain.png" ` set the heightmap
set terrain scale 1, xscale#, yscale#, zscale# ` set the scale
set terrain split 1, nTiles ` split value by nTiles x nTiles
set terrain tiling 1, 8 ` detail map tiling
set terrain texture 1, 1, 2 ` base and detail texture
set terrain light 1, 0.7071067, -0.7071067, 0, 1, 1, 1, 0 ` lighting
build terrain 1 ` finally build the terrain
` as a test try deleting and then recreating the terrain
destroy terrain 1
`delete object 1 - this needed if you want to reuse the old object ID for something else
make object terrain 1 ` create the terrain object
set terrain heightmap 1, "terrain.png" ` set the heightmap
set terrain scale 1, xscale#, yscale#, zscale# ` set the scale
set terrain split 1, nTiles ` split value by nTiles x nTiles
set terrain tiling 1, 8 ` detail map tiling
set terrain texture 1, 1, 2 ` base and detail texture
set terrain light 1, 0.7071067, -0.7071067, 0, 1, 1, 1, 0 ` lighting
build terrain 1 ` finally build the terrain
You could try adding delete object terrainID after destroying the terrain.