Author Topic: How do .dts collision boxes work?  (Read 1871 times)

I'm trying to make a brick with Blender and the obj-blb converter. It has a slanted face that I need a collision box on, like the Ramp bricks. I tried putting a simple cube on the face and rotating it, both in edit and object mode, but it reduces it to a bounding box anyways (making the collision box the model's bounds box). How do I fix this?

Discovered .dts collision boxes, but I can't get them to work right. What's the format for a .dts collision box? Right now I'm just sticking a mesh named 'COLLISION1' in Blender 2.49 and exporting it with the standard weapon-export settings.
« Last Edit: June 23, 2013, 09:59:44 PM by ThinkInvisible »

Quote from: Demian
The collision model needs to be convex and on the second layer/different layer from the visual model. When exporting you need to add a new (collision) detail level and select the layer with the collision mesh.
Quote from: Demian
Name the collision object col-0 (or any other number) and move it to layer 2. When exporting to DTS add a new collision level and select layer 2 and change the detail-1 level to layer 1 instead of all the layers.
I've gone over this a few times in the past. You could have searched. Anyways I don't think the object name matters actually.

I've gone over this a few times in the past. You could have searched. Anyways I don't think the object name matters actually.

Actually, object names matter. If the collision mesh is not named properly, the console will scream profanities at you, resulting in console spam.

-snip-
If it needs to be convex, then how would I go about making a collision box for a tent?

If it needs to be convex, then how would I go about making a collision box for a tent?

You can add another convex mesh. Or even more. The max number of collision meshes for an object is 8 or 10, not sure.
« Last Edit: June 24, 2013, 10:14:46 AM by Barnabas »

Also, what the heck's detail-1? I'm used to just making meshes and parenting bones to detail32/shape, then exporting.

Okay. Layer 1 is Detail1 and contains absolutely nothing. Layer 2 is Collision-1 and contains two extremely thin trapezoidal prisms Col-1 and Col-2. The entire model is being exported as triangle strips. Both Col-1 and Col-2 are selected in Nodes. What am I doing wrong?
« Last Edit: June 24, 2013, 10:49:04 AM by ThinkInvisible »

What am I doing wrong?
Well what exactly is wrong? Model not visible? Collision not working? Exporter error?

The exporter has detail levels.

Visible Detail Level is something you see in the game. By default one Visible Detail Level is added called Detail1 and every layer is selected. (Dark box) This means you can have stuff on any Blender layer and when you export the model you can see all the stuff in-game. When you click a layer in a Visible Detail Level it automatically deselects (light box) all other layers except the one you clicked. Now if you were to select layer 1 and exported, the stuff on layer 2 is not visible in-game because it was not exported in the first place.

Collision Detail Level is not visible in-game but you can collide with it. It works exactly like the Visible Detail Level. Only stuff from the layers that are selected are exported.

In your case you have a tent model, and two collision models. It is irrelevant in which layers these models are as long as the correct layers are selected in the exporter. For example you could put the tent model in layer 3 and both of the collision models in layer one. In the exporter you would click layer 3 in the Visible Detail Level called Detail1. Then you would select Collision Detail Level from the drop drown list and click the Add: button. This adds Collision-1 detail level where you select layer 1 because your collision models are there.

Well what exactly is wrong? Model not visible? Collision not working? Exporter error?

The exporter has detail levels.

Visible Detail Level is something you see in the game. By default one Visible Detail Level is added called Detail1 and every layer is selected. (Dark box) This means you can have stuff on any Blender layer and when you export the model you can see all the stuff in-game. When you click a layer in a Visible Detail Level it automatically deselects (light box) all other layers except the one you clicked. Now if you were to select layer 1 and exported, the stuff on layer 2 is not visible in-game because it was not exported in the first place.

Collision Detail Level is not visible in-game but you can collide with it. It works exactly like the Visible Detail Level. Only stuff from the layers that are selected are exported.

In your case you have a tent model, and two collision models. It is irrelevant in which layers these models are as long as the correct layers are selected in the exporter. For example you could put the tent model in layer 3 and both of the collision models in layer one. In the exporter you would click layer 3 in the Visible Detail Level called Detail1. Then you would select Collision Detail Level from the drop drown list and click the Add: button. This adds Collision-1 detail level where you select layer 1 because your collision models are there.

It works now, but it only collides from the inside. If anything approaches from the outside, it goes right through it. Also, it appears to be twice as big as the model and I can't get it any smaller.

Edit: And now it's not working again.
« Last Edit: June 24, 2013, 01:37:53 PM by ThinkInvisible »

Okay, I just can't get this to work. Here's what I'm doing in detail:
 I have a tent.blb file, in which the first few lines are:
Code: [Select]
14 14 24
SPECIALBRICK

1

0.000000 0.000000 0.000000
14.400000 14.400000 24.000000
The Blender model used to create the file has a BOUNDS mesh, but no COLLISION mesh.
 The server.cs is as such:
Code: [Select]
datablock fxDTSBrickData (brickTentData)
{
brickFile = "./tent.blb";
category = "Special";
subCategory = "Props";
uiName = "Small Tent";
collisionShapeName = "./tent.dts";
isWaterBrick = true;
};
And the blender file I am attempting (right now) to export as tent.dts is:
 tentcol.blend


Didn't work. There's no collision box anywhere.

Overlapping collision meshes are not a good idea. Also, make sure the file names match in the script.

Your collision mesh let projectiles through coming from the outside, because of a flipped normal.

Try this: http://mirror.dataorb.net/temp.zip
OH WAIT NO THIS WORKS.

It's just scaled down to around 1/2 of the brick, and it's floating like the 2x2 ramp collision was. There appears to be no way to resize it.
« Last Edit: June 25, 2013, 12:52:26 PM by ThinkInvisible »