I've searched all through the forums and no-one seems to have the same problem I have. It's probably a simple solution, but here's the problem.
Using this code, I create my terrain:
// Destroy Terrain should it Exist
If Object Exist( 9999 ) = 1
Delete Object 9999
Endif
If Terrain Exist( 9999 ) = 1
Destroy Terrain 9999
Endif
// Create Terrain
If Terrain Exist( 9999 ) = 0
scaleFactor# = 100000 / textureResolution
xScale# = scaleFactor#
yScale# = scaleFactor#
zScale# = scaleFactor# / 10
Make Object Terrain 9999
If File Exist( "Shared/Themes/" + TerrainMap + "_Height_" + textureDetail + ".png" ) = 1
Set Terrain Heightmap 9999, "Shared/Themes/" + TerrainMap + "_Height_" + textureDetail + ".png"
Endif
Set Terrain Scale 9999, xScale#, yScale#, zScale#
Set Terrain Split 9999, nTiles
Set Terrain Tiling 9999, 16
Build Terrain 9999
Endif
When I first call the function where this code sits, the terrain is created fine. The next time I call it, it crashes with the very cryptic "Error 4".
Does anyone know what the hell is happening here?
Self Destruction Computer Entertainment