Game Development Community

How to instatiate dif

by AlexanderSLG · in Torque Game Engine · 06/12/2007 (7:53 am) · 3 replies

We made a modification to the engine because we needed cliffs to be part of the terrain, and needed to add them in the mission editor. We created cliff DTS models and we extended the tsStatic class to create and manipulate them.

This is all nice, but the DTS doesn't blend all that nicely to the terrain with all lighting settings, so we're looking for solutions. One of them is to change it to a .dif instead of a DTS, but we are not sure how to fix what we're doing for the ts to work for the dif..

we do something like this:
class TSCliff : public TSStatic
	{
		typedef TSStatic Parent;
		protected:
			bool onAdd();
*****etc****
	}


	TSCliff * pO = new TSCliff(m);
	bool 
	ret = pO->setField("shapeName", modelname);
	/* set up a lot of variables, like rotation, position and the such */
******
	if (!pO->registerObject(name))
	{
		Con::errorf("addTSCliff: could not register addTSCliff");
		delete pO;
		return ;
	}
	/* create group if needed and add the object to it */
******

so what should we change the public TSStatic to? Interior? Or am I missing something? Interiors do not seem to be console objects, and this looks like it's going to make the migration a lot of work

thanks

#1
06/12/2007 (9:52 am)
Ok, making it a subclass of InteriorInstance kind of worked, but I'm having trouble on relight. Randomly breaks with an "incorrect GLName for texture" and it doesn't light properly (when used from the subclass, interior instances work fine with the same dif file)

Has anyone ever subclasified Interior? any tips?
#2
06/12/2007 (10:39 am)
Yeay for self answering. we still can't figure out the incorrect glName for texture error, but we've worked out the "doesn't light properly" part. It can't be a ghosted object... but then, we NEED IT to be a ghosted object. Does anyone know why don't ghosted (client object) interiors get relighted?
#3
06/12/2007 (11:31 am)
Hey Alexander.
I can't help you with your problem but I'm pretty certain that you should pitch this question in the "private" section of these forums.

This is the public section of the forum and since you are not allowed to discuss details regarding the sourcecode of the SDK in public (with non-SDK owners), giving you solid advice might be hard here.

And besides, since this is the public forums alot of non-SDK owners come here and as such they lack knowledge that might help you.

So if you have the access to them, the private forums will get you much better results.

The private forums main entrance:
www.garagegames.com/mg/forums/result.area.php?qa=10

The "engine" section where you probably will yield the best results:
www.garagegames.com/mg/forums/result.forum.php?qf=49

Best regards, Jorgen