Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: NPC(S) not holding/using weapons properly  (Read 2087 times)

0 Members and 1 Guest are viewing this topic.

Offline Vedad1944

  • *
  • +2% chance to make useful post
  • Vedad1944 has no influence.
NPC(S) not holding/using weapons properly
« on: October 06, 2013, 09:00:05 PM »
Hi, umm
So I've been working on this project of mine based on SMOD 40/a - piped version, I read half the wiki and nothing said how to solve this problem. The NPCs hold the guns i give them in a rather uncomfortable position..

Google'd for I dunno how long and could not find the solution, at first the NPCs weren't even firing the guns whilst holding them like that, then I set "CSworldmodel"  to  1 in the weapon_custom.txt and they started firing them but kept holding them in the waist area.
Made me laugh at first but I have to solve it. On the wiki it says that model editing is needed but theres gotta be another way and if not, an explanation maybe  what to do with the model.
Oh and here is the weapon_custom.txt
Code: [Select]
WeaponData
{
    // Weapon data is loaded by both the Game and Client DLLs.
    "printname"        "USP .45"
    "viewmodel"        "models/weapons/v_pist_usp.mdl"
    "playermodel"        "models/weapons/w_pist_usp.mdl"
    "anim_prefix"        "pistol"
    "bucket"            "1"
    "bucket_position"    "1"
    "clip_size"            "12"
    "default_clip"        "12"
    "primary_ammo"    "pistol"
    "secondary_ammo"    "None"
    "weight"            "2"
    "item_flags"            "0"
    "BuiltRightHanded"    "0"
    "AllowFlipping"    "1"
    "CSViewModel"    "1"
    "CSWorldModel"    "1"
    "MuzzleType"    "CSSMG"
    "MuzzleSize"    "1.0"
    "MuzzleAttach"    "1"
    "MuzzleOfs"    "0"
    "LagScale"        "0.1"
    "RunSpeed"    "1.0"
    "DisableROAimmode"    "1"
    "NoDrop"    "0"
    "Adjust"
    {
        "Forward"    "0"
        "Up"        "2"
        "Right"    "1"
        "Fov"    "5"
    }
    IronSight
    {
        "right"    "2"
        "up"        "1"
        "forward"    "-5"
        "fov"        "-5"
        "pitch"    "0"
        "yaw"    "0"
        "roll"        "0"
        "AdjustAccuracy"    "0.5"
    }
    VMDOF
    {
        "Default"
        {
            "start"    "0"
            "end"        "0"
        }
        "IronSight"
        {
        "start"    "2"
        "end"        "4"
        }
    }
    // Sounds for the weapon.  There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
    SoundData
    {
        "single_shot"        "Weapon_usp.Single"
        "double_shot"        "Weapon_IRifle.Single"
        "reload"            "Weapon_Pistol.Reload"
        "single_shot_npc"        "Weapon_usp.Single"
        "double_shot_npc"        "Weapon_AR2.NPC_Double"
        "reload_npc"        "Weapon_Pistol.NPC_Reload"
        "empty"            "Weapon_Pistol.Empty"
        "special1"        "Weapon_Pistol.Special1"
        "special2"        "Weapon_Pistol.Special2"
        "burst"            "Weapon_Pistol.Burst"
        "melee_hit"        "Weapon_Crowbar.Melee_Hit"
        "melee_hit_world"        "Weapon_Crowbar.Melee_HitWorld"
    }
    // Weapon Sprite data is loaded by the Client DLL.
    TextureData
    {
        "weapon"
        {
            "font"        "WeaponIcons"
            "character"    "c"
        }
        "weapon_s"
        {
            "font"        "WeaponIconsSelected"
            "character"    "c"
        }
        "ammo"
        {
            "font"        "WeaponIcons"
            "character"    "c"
        }
        "ammo2"
        {
            "file"        "sprites/640hud7"
            "x"        "48"
            "y"        "72"
            "width"        "24"
            "height"        "24"
        }
        "crosshair"
        {
            "font"        "Crosshairs"
            "character"    "Q"
        }
        "autoaim"
        {
            "file"        "sprites/crosshairs"
            "x"        "0"
            "y"        "48"
            "width"        "24"
            "height"        "24"
        }
    }
    "WeaponSpec"
    {
        "WeaponType"    "0"
        "FireRate"        "0.15"
        "UnderWater"    "1"
        "Akimbo"        "0"
        "AttachedGL"    "0"
        "FireMode"        "1"
        "Options"
        {
            "FireSoundVolume"    ""
            "ReloadSound"    "1"
            "LastFireSound"    "0"
            "LastDryFireActivity"    "ACT_VM_DRYFIRE"
            "TurnoffScope"    ""
            "TurnoffIron"    "0"
            "CrossHairMove"    "0.02"
            "CrossHairMinSize"    "20.0"
            "TimeScale"    "1.0"
            "en bloc Clip"    ""
            "ViewModelSkin"        ""
            "FireLag"    "0"   
            "IsGatlingGun"    "0"   
        }
        "Activities"
        {
            "PrimaryFire"        "ACT_VM_PRIMARYATTACK"
            "SecondaryFire"        ""
            "Reload"    "ACT_VM_RELOAD"
            "DryFire"    "ACT_VM_DRYFIRE"
            "DryFireLeft"    ""
            "Idle"    "ACT_VM_IDLE"
            "GLFire"    ""
            "ModeSwitch"    ""
            "Deploy"    "ACT_VM_DRAW"
            "IronSightPrimaryFire"    "ACT_VM_PRIMARYATTACK"
        }
        "Recoil"
        {
            "PunchPitch"    "0.04 -0.2"
    "PunchYaw"    "0.0 0.0"
            "EnableSnap"    "0"
            "SnapPitch"    "-0.0 0.0"
            "SnapYaw"        "-0.0 0.0"
            "Crouch"        "0.5"
            "Amp"        "1.0"
            "PunchLimit"    "1.0"
        }
        "Spread"
        {
            "Default"    "0.5"
            "MaxSpread"    "1.0"
            "Run"    "1.5"
            "RunSpeed"    "100"
            "Crouch"    "0.6"
            "Fire"        "1.0"
        }
        "Bullet"
        {
            "AmmoType"    "Pistol"
            "Damage"        "8"
            "ShotCount"    "1"
            "Tracer"        ""
            "Force"        "0.5"
            "Penetrate"    "8"
            "TraceLength"    "2000"
            "Attenuate"    "200"
        }
        "ShootPos"   
        {
            "UpperPitch"    "15 4.7 -.7"
            "LowerPitch"    "15 -.2 -4.5"
            "IronSight"        "15  0  -3"
        }
        "Npc"   
        {
            "AnimType"    "pistol"
            "FireRagdoll"    "0"
            "UseLaserPointer"    "0"
            "RifleAnim"    "1"
            "BurstMax"        "12"
            "BurstMin"        "10"
            "FireRate"        "0.25"
            "Range"        "2096"
            "MuzzleFire"    "1"
            "UseGL"        "0"
        }
    }
}

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: NPC(S) not holding/using weapons properly
« Reply #1 on: October 06, 2013, 09:06:00 PM »
hey welcome.

take a look here - http://bsnooch.com/forums/index.php?topic=19.0

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: NPC(S) not holding/using weapons properly
« Reply #2 on: October 07, 2013, 07:35:41 AM »
Unfortunately, you have to edit the model in order for the world model to work. Check out what BIZ posted, it works.
There is no other way.
(well, you may try to find some precompiled world models that work here in the release archive or somewhere else, that's how I do it because I'm lazy)

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: NPC(S) not holding/using weapons properly
« Reply #3 on: October 07, 2013, 08:35:27 AM »
Welcome to BSNOOCH!

If you need any help with the worldmodels, then feel free to add me on Steam. I can fix them.

Offline Vedad1944

  • *
  • +2% chance to make useful post
  • Vedad1944 has no influence.
Re: NPC(S) not holding/using weapons properly
« Reply #4 on: October 07, 2013, 05:18:18 PM »
hey welcome.

take a look here - http://bsnooch.com/forums/index.php?topic=19.0

Thanks I look forward to trying that :D

Welcome to BSNOOCH!

If you need any help with the worldmodels, then feel free to add me on Steam. I can fix them.
Appreciate the help, I will try it myself though but if I find any problems I will add you, thanks!

Offline Vedad1944

  • *
  • +2% chance to make useful post
  • Vedad1944 has no influence.
Re: NPC(S) not holding/using weapons properly
« Reply #5 on: October 07, 2013, 07:03:34 PM »
So I've been busy with fixin' the models and stuff and i got it working! But, but, BUT the compiler is not generating the .phy file for the model, I ended up using the old one and the model sank trough the ground but was affected by physics (I could throw it around and stuff), any help here? :-\

EDIT: nevermind :D i just added $collisionmodel to the qc and works fine!
« Last Edit: October 07, 2013, 07:13:37 PM by Vedad1944 »

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: NPC(S) not holding/using weapons properly
« Reply #6 on: October 07, 2013, 11:05:03 PM »
you can use the reference model as the collisionmodel and the compiler will auto generate a physbox. the decompiled ones are fucked.

Offline Vedad1944

  • *
  • +2% chance to make useful post
  • Vedad1944 has no influence.
Re: NPC(S) not holding/using weapons properly
« Reply #7 on: October 08, 2013, 11:14:26 AM »
Thanks everyone, I fixed it myself!  :D

Another thing, do the mods close threads or do I do it somehow?

Offline FreeKill

  • *
  • *
  • +7% chance to make useful post
  • FreeKill is working their way up.FreeKill is working their way up.FreeKill is working their way up.
    • Youtube Channel
Re: NPC(S) not holding/using weapons properly
« Reply #8 on: October 08, 2013, 03:32:02 PM »
Locked because problem solved.