Physics model Malfuntioning

My physics model appears normal, but in game it\'s weird. Any advice?

By
Username
90SK
4 years ago

I can compile the model I'm working with no problem, and it's in the game no problem: the textures show up and when an NPC is holding it, it looks fine (minor clipping, but whatever). However, when an NPC drops it, it goes all weird. There's obviously something wrong with the physics model, but I can't seem to figure it out.

I save the model as the reference SMD, and then save it again as phymodel.smd

I compile the model, and it goes without a hitch. Here's my .qc

$cd "C:\Users\Zach 1\Desktop\Models\DECOMPILED WORLDB" $modelname "weapons/w_IRifle.mdl" $body "90SK" "W_IRifle_reference" $cdmaterials "models\weapons\W_G3\" $hboxset "default" $hbox 0 "ValveBiped.Bip01_R_Hand" 0.000 -1.500 -5.000 5.000 0.000 0.000 $hbox 0 "ValveBiped.Weapon_bone" -14.793 -4.928 -5.976 28.580 5.620 7.635 // Model uses material "Map2.vmt" // Model uses material "Map1.vmt" // Model uses material "m203.vmt" // Model uses material "V_IRifle.vmt" $attachment "muzzle" "ValveBiped.muzzle" -8.50 -0.00 -0.00 rotate -0.00 0.00 -90.00 $attachment "1" "ValveBiped.w_shotgun" 1.00 -7.00 3.00 rotate 0.00 0.00 -0.00 $surfaceprop "weapon" $illumposition 4.184 -0.655 1.736 $sequence idle1 "idle1" loop ACT_VM_IDLE 1 fps 30.00 $sequence fire "fire" ACT_RANGE_ATTACK_AR2 1 fps 30.00 { { event AE_NPC_MUZZLEFLASH 0 "COMBINE MUZZLE" } { event 3007 0 "1" } } $collisionmodel "phymodel" { $mass 20.0 $inertia 1.00 $damping 0.00 $rotdamping 0.00 }

Like I said the gun is held by NPCs no problem. It fires and there's a muzzleflash, it's textured, everything works fine aside from the physics model (as in, when the gun is on the ground).

Free Image Hosting at www.ImageShack.us I approach the gun in Lost Coast (see its shadow?)

Free Image Hosting at www.ImageShack.us I grab the gun with the gravity gun. Notice that the gun itself is off to the lower left side, and it's vertical.

Free Image Hosting at www.ImageShack.us After grabbing it, I put it back down and it lands like this.

Free Image Hosting at www.ImageShack.us This is the model in the SDK model viewer, with "Physics Model" checked under the "Render" tab. It looks fine, right? I have no idea why it's behaving the way it is in game.

Is there some kind of command I can put in the .qc file to fix this, or is it a compiling error? I really couldn't say, I'm very new at all this so I don't really know what to do. Any help would be very appreciated :)

4 posts 1,102 views
  • You must be a member

Replies

  • BlackHoleSon's Levels
    • P4: Worker
      Points: 45,879
    • E4: Teacher
      EF: 93
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 4 years ago

    I dont know if this is the problem, but delete

    $hbox 0 "ValveBiped.Bip01_R_Hand" 0.000 -1.500 -5.000 5.000 0.000 0.000 $hbox 0 "ValveBiped.Weapon_bone" -14.793 -4.928 -5.976 28.580 5.620 7.635

    those lines.

    ohh, and in notepad, press control H replace what: fps replace with: snap rotate -90 fps

    User Title
    Stand still, I'm used to paper
  • RedRogueXIII's Levels
    • P1: Beggar
      Points: 941
    • E2: Guide
      EF: 22
    • C2: Treehouse Member
    • A6: Elder
      Account Age: 7 years
    Posted 4 years ago

    In notepad, open your reference smd and your physbox smd. Make sure that the time portion of the the physbox matches the reference. It\'ll look something like this, and it\'s right at the top, just copy and paste it to match.

    time 0
      0 0.000000 0.000000 0.000000 1.570796 0.000000 0.000000
    end
    

    [Edit:]

    Also make sure your physmodel is one solid concave shape and i think all the normals for it are supposed to be inverted inwards.

    const bool is_Failing = true;
  • 90SK's Levels
    • P2: Drudge
      Points: 1,248
    • E1: Helper
      EF: 7
    • C2: Treehouse Member
    • A5: Veteran
      Account Age: 6 years
    Username
    90SK
    Posted 4 years ago
    Posted by BlackHoleSon ohh, and in notepad, press control H replace what: fps replace with: snap rotate -90 fps

    It looks like that did it! Everything seems to work fine now. Thank you both for responding, I really appreciate the help.

    Human Male
  • BlackHoleSon's Levels
    • P4: Worker
      Points: 45,879
    • E4: Teacher
      EF: 93
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 4 years ago

    Mark thread as done.

    User Title
    Stand still, I'm used to paper
  • You must be a member