Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Collisions - turning a model from physic to static - A Question for Source Engine

Question Answered but Unsolved

This Question has been answered but no solution has been chosen. You can still post your own answer to help the submitter.

Weird collisions when turning a model from physic to static

Hey guys, I've been facing an annoying problem with models collisions.

What I want to do is pretty simple: I just want to turn a physic model to a static model.
I can't comprehend why but for some models, it won't work as expected.

The collisions will be shifted or rotated, sometimes it's the model that is not properly aligned...
But for some other props, it works just fine so I don't understand what I'm doing wrong...

Here's the process:
  • I copy the model I want to decompile to another folder
  • I decompile it with Crowbar (version 0.71)
  • I edit the parameters of the .qc file:
    • I suffix the $modelname with _static
    • I add $staticprop
    • I remove $keyvalues and $collisiontext if it exists
    • I recompile it with Crowbar and there are no errors

As I said, it works fine most of the time but not everytime. There's something that gets screwed because I get collisions like this:







Am I doing something wrong in the process? In case there are no solutions, I guess I can always use Propper to create my own collision model, but that's a shame.
Sign up to access this!
  • Alfa1337 avatar
    Alfa1337 Joined 14y ago
    REDEMPT Manager WANTED! Manager
    Boogie
    29,473 points Ranked 182nd
    42 medals 4 legendary 13 rare
    • 10 years a member Medal icon
    • Submitted 50 Maps Medal icon
    • Submitted 100 Skins Medal icon
    • Returned 5000 times Medal icon
    • 6 years a member Medal icon
    • Submitted 50 Skins Medal icon
    9d
    Did you add $collisionmodel?

    An example is my Among Us' Bench:

    $collisionmodel "AUS_bench_phy.smd"
    {
        $mass 1
        $inertia 1
        $damping 0
        $rotdamping 0
        $rootbone " "
        $concave
        $maxconvexpieces 12

    }

     avatar
    URL to post:
  • Foofinoo avatar
    Foofinoo username pic Joined 7y ago
    Dead
    Cell 1 Flag Affiliation: Cell 1
    21,619 points Ranked 268th
    33 medals 3 legendary 8 rare
    • Returned 5000 times Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • 2nd Place - Marble Tracks Redux Contest Medal icon
    • Returned 1000 times Medal icon
    • Submitted 20 Maps Medal icon
    Foofinoo avatar
    Foofinoo
    Cell 1 Flag
    Affiliation
    Cell 1
    9d 9d
    Thanks to Suomimies55, he found that the collision model was not at the right place by opening the files in Blender.

    The solution would be done by putting back the collision model to its place.

    So I did but then, something wrong still happens. I export the new _physics.smd, recompile the model with it but once again in Hammer the model doesn't show up and is really glitchy, but in the model viewer it looks fine.

    I'm pretty much a newbie with Blender so I might do something wrong with it, but I'm just moving the part and exporting it back, I don't really see where I could break the model... Any ideas?
    Professional Crastination avatar
    Mantra
    Professional Crastination
    URL to post:
  • Foofinoo avatar
    Foofinoo username pic Joined 7y ago
    Dead
    Cell 1 Flag Affiliation: Cell 1
    21,619 points Ranked 268th
    33 medals 3 legendary 8 rare
    • Returned 5000 times Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    • 2nd Place - Marble Tracks Redux Contest Medal icon
    • Returned 1000 times Medal icon
    • Submitted 20 Maps Medal icon
    Foofinoo avatar
    Foofinoo
    Cell 1 Flag
    Affiliation
    Cell 1
    8d 8d
    Ah, I finally have it all figured out!

    Firstly, like I said in the previous post, the collisions and sometimes the model itself were kind of shifted or misplaced with the other. I believe the reason comes from the decompiling itself so I really can't do anything about that. Fortunately, this doesn't happen all the time.

    However, what I can do is to move back to its place what needs to be (I'm using Blender for that but I guess it can works for other softwares as well) and export back the fresh new collisions.

    Now that everything was correctly lined up, I still had that weird issue with the model not appearing and being glitchy: I just had to replace the line $definebone [...] with $definebone "static_prop" "" 0 0 0 0 0 0 0 0 0 0 0 0 and that did the trick. I found that line in a properly decompiled static model.

    I think this line can sometimes already be in the .qc file because it happens only for a few models. I don't really see why it breaks the model because its purpose is to "define a bone outside of any .smd source" apparently, but it might just be me not really understanding its role...

    Anyway, just to summarize everything if someone else is facing this issue, I had in fact two problems:
    • the collisions and the model were shifted: that was because of the decompilation
      • to fix it, open the .qc file in Blender (it will automatically import the correct models), move the collision model to the right place and export it back to .smd
    • the model was really glitchy and did not appear in Hammer
      • edit the .qc file in a text editor and add the $definebone line above - don't forget to add the parameter $staticprop and to remove the parameters $keyvalues and $collisiontext as well to make it fully static
    Edit: can't turn my own post "Top Answer"? I think it's pretty much the solution I was looking for anyway...
    Professional Crastination avatar
    Mantra
    Professional Crastination
    URL to post:
  • Reverend V92 avatar
    Reverend V92 username pic Joined 11y ago
    Source Engine Expert HL2 Manager HL2:MMod Manager HL2:DM Manager Source Manager OC Manager Syn Manager GMod Manager GMod 9 Manager INS Manager DoD:S Manager CS:S Manager BM Manager L4D Manager L4D2 Manager FNF Manager Moderator
    WAITING
    39,513 points Ranked 110th
    51 medals 3 legendary 13 rare
    • 2019 Top Contributor Medal icon
    • Returned 5000 times Medal icon
    • 10 years a member Medal icon
    • 2nd Place - A Bananite's Guide to... Contest Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    Reverend V92 avatar
    Reverend V92
    Source Engine Expert
    5d
    TL;DR for anyone else having this issue in the future: the bone positions didn't match. The sequence/mesh/physics model have to have the same transform origins or it'll do this.
    Friendly Neighborhood Mod avatar
    Mantra
    Friendly Neighborhood Mod
    URL to post: