Game Development Community

How can I make a StaticShape drop from sky?

by Mark Johnston · in Torque Game Engine · 06/04/2008 (5:57 pm) · 1 replies

I am currently working on a project recreating our town within the torque engine using version 1.5.
We are loading images of buildings onto a simple square dts shape, as we are dealing with thousands of buildings.

We have been working with a flat terrain so far, and loading each building within mission file as below

new StaticShape(gis8000007) {
canSaveDynamicFields = "1";
internalName = "8000007";
position = "270.038 -89.14 21.8";
rotation = "1 0 0 0";
scale = "1 1 2";
dataBlock = "Building";
receiveSunLight = "0";
receiveLMLighting = "1";
useAdaptiveSelfIllumination = "0";
useCustomAmbientLighting = "0";
customAmbientSelfIllumination = "0";
customAmbientLighting = "0 0 0 1";
};

Now that we have made a terrain based on real world data, I was thinking of having the buildings dropping from the sky and landing on the terrain at correct height, rather than having to manually adjust every building(2,500 of them). With the above object the height is set at z position of 21.8. Is there any way to set height to say 200 and have object fall until it hits the terrain.

Datablock for StaticShape is,

datablock StaticShapeData(Building)
{
category = "Items";
shapeFile = "~/data/shapes/newTest/Buildings/building.dts";
};

I have tried adding mass=1; and friction =1; to datablock and setting height to 200 but when the mission loads the builing just says floating in the air.

Any help or suggestions would be much appreciated, as I have spent hours trawling the forums and site but have yet to figure it out, there seems to be a very helpful community spirit here.

#1
06/04/2008 (6:38 pm)
I don't think that's going to work, mate. Static shape objects are just static.

Shape objects on the other hand are not. In game create an item like a weapon or ammo item from the SHAPE type (not static shape) - move it up and then disable (using world inspector) the static option(dynamic field). If it has mass it should drop to the ground. Have a look in the weapon scripts and see how items work there - the health item might be a better place to look actually. Try and model your building.dts data on that.