Game Development Community

InteriorInstance Size

by Sky Frostenson · in Torque Game Engine · 04/22/2005 (3:58 pm) · 4 replies

I am trying to place Interior objects in the game world through script calls. I currently am able to do this using the new InteriorInstace() {...}. From here, I need to determine the dimensions (width, length, height) of the interior so that I can determine where to place other interiors along with it. The interiors are randomly chosen, so I cannot hard code in values or make any assumptions as to their dimensions.

Is this possble to do through scripting? Also, is there a good resource where I can find existing script functions? ie all the functions related to an InteriorInstance in the scripts?

Thanks!

#1
04/24/2005 (5:55 pm)
Dump()?
#2
04/25/2005 (12:44 pm)
I came across the following function inside of the InteriorInstance.cc:

ConsoleFunction( isPointInside, bool, 2, 4, "(Point3F pos) or (float x, float y, float z)")
{
   static bool lastValue = false;

   if(!(argc == 2 || argc == 4))
   {
      Con::errorf(ConsoleLogEntry::General, "cIsPointInside: invalid parameters");
      return(lastValue);
   }

...
}

At first, I thought this might be a solution to my problem, but it seems not. I am having trouble figuring out exactly what this function does. First off, it is my understanding, based on the code above, that the function will require either 2 or 4 parameters (argc is argument count, correct?). However, when I call it from the code, it complains about an incorrect number of parameters unless I pass 1 or 3 parameters.

So I started looking through the code a little more. It seems like this function just returns true if the specified point is within any interior instance in existence.

Can anyone confirm or deny my suspicions / beliefs here? Does anyone know how to use this function?

Or know an approach to my problem? Is it possible to simply obtain a bounding box for a given interior instance?

Also, Ben - What did you mean by "Dump()"?

Thanks!
#3
04/25/2005 (3:20 pm)
Call %object.dump(); to get the methods it supports. If you see it in the mission editor, you will notice a small 4 digit notice associated with the object - something 1347. You can call 1347.dump() to see the methods the object supports. Dump() is your friend. Dump() lists all the fields, all the methods, that an object supports. It also describes most of them.
#4
03/31/2006 (2:59 am)
Hi
trying to create interiorinstance in script as above but all i get is a crash, with no entry in console log.

have attached the creation to a trigger just to get it operational

function Area5WallOutsideTrigger::onEnterTrigger(%this,%trigger,%obj)
{
%wallpc=sidewall15.getid(); //get the id
%wallpc.setTransform("-192.895 -55.8616 35"); //drop the wall

//mtk test of creation on the fly

new InteriorInstance(medtmp)
{
position = "-192.895 -55.8616 35";
rotation = "1 0 0 0";
scale = "1 1 1";
interiorFile = "~/data/interiors/buildings/med5.dif";
useGLLighting = "0";
showTerrainInside = "0";
};

echo("at the wall now");
Parent::onEnterTrigger(%this,%trigger,%obj);
}

any help would be appreciated, thanks in advance