Game Development Community

New TerrainBlock on the fly

by Kiraya2 · in Technical Issues · 10/12/2003 (4:42 am) · 5 replies

I't possibile to register a new TerrainBLock on the fly ?

I've tryed with this
function loadTerr()
{
	dataBlock TerrainBlock(Terrain2) 
	{
		rotation = "1 0 0 0";
		scale = "1 1 1";
		terrainFile = "./newMission.ter";
		squareSize = "8";
		emptySquares = "99744 443522 443778 444034";
		bumpScale = "1";
		bumpOffset = "0.01";
		zeroBumpScale = "8";
		locked = "true";
		position = "0 0 0";
	};

	%newTerr = new TerrainBlock()
	{
		dataBlock = Terrain2;
	};
}

but doing loadTerr() from console tells me that it cannot
register new Object Terrain2 for class TerrainBlock.

There's something wrong in the code or it's totally absurd ?

#1
10/12/2003 (6:32 am)
You cannot load more than one TerrainBlock, nor unload the TerrainBlock you've already loaded using stock Torque (while the mission is running).
#2
10/12/2003 (6:40 am)
I'm not talkin about rendering or managing, I'm intending
to create te TB object on the fly.

I guess I will have the same error loadgin another object
in mission, so I would like to intend well wich is the
correct way to create a datablock and load an object during
mission, such as a TerrainBlock.
#3
10/12/2003 (8:14 am)
Ok solved thanks :)
#4
10/12/2003 (9:02 am)
Solved? Care to share? =)
#5
10/12/2003 (10:56 am)
Heheh great elettrozero.
we are managing another way to use infinite terrains . we are very very near to the completation (we not use TM, but studied it very much)..
Sure that if we can solve this, we will share the resource.