Collisions for custom models? How to make them the right size?

M

maniac618

Guest
Hi guys,

I'm importing my custom made models into hammer and have colliosion problems...


Imagine if I imported a doughnut into hammer on its side and ran the map and tried to shoot through the hole in the middle the bullets would hit an invisible wall.


How can I stop this from happening?

Please help/explain/give example/whatever. I'm pretty desperate too as I have a deadline coming up.

Thanks in advance,

Chris
 
open it up in model viewr and check on the collision model box, my bet is the model is probably rotated 90 degrees. if this is the case, just rotate the physics model 90 degrees in the modeling program and recompile it. this usually fixes the problem.
 
noldevin said:
open it up in model viewr and check on the collision model box, my bet is the model is probably rotated 90 degrees. if this is the case, just rotate the physics model 90 degrees in the modeling program and recompile it. this usually fixes the problem.

Right, I've just remade some hit boxes in model viewer, and chosen generate QC file.

Where has it generated it if the model is for hl2 deathmatch?

Pleeeeeeeeease help.

EDIT:

I think it's the physics model that's getting in the way as a barrier to the player and bullets rather than the hit boxes anyway as the physics model is the same shape that i can jump on in game.

How can i edit the physics model? Currently in the QC file i compiled with it was set as the same name as the model.

Anyway, where is the QC generating when i click on it in model viewer?

Any help much appreciated!
 
make sure the model is in the dead center of the scene (select it and enter coördinates 0 0 0 )
and add a box with the size: 72*32*32 (thats a player height) then resize your prop_model to the size it's supposed to be, this way in the .qc file you can make the scale "1"
 
simon said:
make sure the model is in the dead center of the scene (select it and enter coördinates 0 0 0 )
and add a box with the size: 72*32*32 (thats a player height) then resize your prop_model to the size it's supposed to be, this way in the .qc file you can make the scale "1"

The scale is fine! That's not the problem....

The problem is the physics model or the hit boxes (not really sure which, but in the level I can jump on the shape of what seems to be the physics model shape that can be seen in model viewer).

Any ideas how to change the physics model, or save changes to hit boxes created in model viewer? Where does it generate the QC file to when i click "generate qc" in model viewer?
 
you need 2 models. One for collision, one to be seen. Assuming that your shape is a torus (donut), you'll need to break it into a series of convex cylinders, rather then one big concave torus. Export it, and in your .qc to compile the model, point the $collision variable to the new model you created, rather then the base reference model.

Generate qc makes the file in the clipboard. Just paste it in something else. For a prop... I don't think that there's a difference between a collision model and hit box. I think they're two words for the same thing.
 
Right,

I made 2 models. A stove (stove2.smd), and a block that should be the physics (stove22.smd). I compiled them together with this QC file:

$modelname "stove2.mdl"
$cdmaterials "\"
$cdmaterials "\"
// Output stove2.MDL

$staticprop

$scale 0.75

// it's just ./stove2
$body studio "./stove2"

$sequence idle "stove2" loop fps 15

// you can make a seperate model for colisions if it's a realy complicated model and put name of it here
// otherwise just use the same model
$collisionmodel "stove22.smd"
{
// Mass in kilograms for when model is used as a prop_phys
$Mass 100
$concave
}


// refers to "D:\Program Files\Valve\Steam\SteamApps\mixroman3d\sourcesdk_content\cstrike\materialsrc\"
// this will be saying where yer texture is and in it should be in "sourcesdk_content\cstrike\materialsrc\models\

Unfortunately it didn't make a difference and as you can see below, the physics is messed up. This weird shape also acts as an invisible block in game stopping bullets like a wall and is also climbable for the player :(

modelphysics.jpg


pleeeeeeeeeeeeeeeeeease help. The other thread didn't really purerage, but thanks all the same.
 
Ok, checklist time:
Make sure that the collisionmesh is made of boxes or/and cylinders.
Make sure that you have only 1 smoothinggroup on the collisionmesh.
You must have a texture (Multi/Sub) on your collisionmesh when you export it.
Make sure that you just export the collsionmesh (save the file, delete the other meshes).
Try just using $sequence idle "stove2". No loop or fps commands.
Try removing .smd from this line: $collisionmodel "stove22.smd"

Ok, that's all I can think of for now, good luck.
 
Cubik said:
Ok, checklist time:
Make sure that the collisionmesh is made of boxes or/and cylinders.
Make sure that you have only 1 smoothinggroup on the collisionmesh.
You must have a texture (Multi/Sub) on your collisionmesh when you export it.
Make sure that you just export the collsionmesh (save the file, delete the other meshes).
Try just using $sequence idle "stove2". No loop or fps commands.
Try removing .smd from this line: $collisionmodel "stove22.smd"

Ok, that's all I can think of for now, good luck.

I've tried these things but it remains the same.

I'm using cannonfodder's 3d studio max exporter and it doesn't need the multi/sub object setting for the texture.

Here are the 3d studio max files, smd files, the textures and the qc file...

http://www.firestormrock.co.uk/downloads/stove2.zip

Please have a play around with it and let me know if you can get it to work?
 
Are you sure that you have tried all of those since stove22.smd is just an empty file...?
But sure, I can give it a quick try.
 
The forum ate my post, got your model working, can send it later tonight, try one more time (and make sure that you use a simple box as collision) I used HL2 Compile Toolkit v121b to get it ingame.
 
Cubik said:
Are you sure that you have tried all of those since stove22.smd is just an empty file...?
But sure, I can give it a quick try.


hmm that's weird i exported it the same as usual. It was 2 boxes making up the collision model attached together as editable polys with a texture on them.
 
Ok, I'm off, will be back in 3-4 hours, make sure that you have rigged the collision mesh, same as with the visible mesh.
 
Cubik said:
Ok, I'm off, will be back in 3-4 hours, make sure that you have rigged the collision mesh, same as with the visible mesh.

when you say rigged what do you mean exactly?
 
Back
Top