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

Author Topic: IronSightPrimaryFire Problem  (Read 1152 times)

0 Members and 1 Guest are viewing this topic.

Offline 0per4t0r

  • *
  • +1% chance to make useful post
  • 0per4t0r has no influence.
    • My Youtube
IronSightPrimaryFire Problem
« on: August 16, 2011, 11:54:09 PM »
Hello, I'm trying to make it so my custom weapon only uses one fire animation when in ironsight mode. The weapon's viewmodel (it's a cs:s m4a1 skin) normally has 3 fire animations, with shoot1_unsil only kicking the weapon directly back, which makes it the most accurate in ironsight mode. shoot2_unsil and shoot3_unsil have the weapon kicking back and to the left or right, and aren't as accurate in ironsight mode. I tried copying shoot1_unsil and naming it shoot4_unsil, then adding this line under shoot3_unsil's line in the .qc:
Code: [Select]
$sequence shoot4_unsil "shoot4_unsil" ACT_VM_PRIMARYATTACK_IRONSIGHT 1 rotate -90 fps 30.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_556 2 150" }
}
But, after I compiled, added the IronSightPrimaryFire line and changed its value to ACT_VM_PRIMARYATTACK_IRONSIGHT, the weapon still used the other 2 animations in ironsight mode.


I also tried getting rid of the shoot4_unsil line, and copying shoot1_unsil and idle_unsil and renaming the end of them to "ads" instead of "unsil." Then I tried adding these lines to the end of the .qc, but it still didn't work.:
Code: [Select]
$sequence idle_ads "idle_ads" ACT_VM_IDLE_IRONSIGHT 1 rotate -90 fps 16.00
$sequence shoot1_ads "shoot1_ads" ACT_VM_PRIMARYATTACK_IRONSIGHT 1 rotate -90 fps 30.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_556 2 150" }
}

Does anyone know the proper way of doing this without having to make my own animations?

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: IronSightPrimaryFire Problem
« Reply #1 on: August 17, 2011, 01:16:10 AM »
the activity you are trying to assign the "shoot1_unsil" animation to is not recognized by the engine as far as i know.

STEP 1
you will need to assign the ironsight animation to one of these activities - http://developer.valvesoftware.com/wiki/Viewmodel#Basic_activities

example:
Code: [Select]
$sequence shoot1_unsil "shoot1_unsil" ACT_VM_RECOIL3 1 rotate -90 fps 30.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_556 2 150" }
}

pick any one you want, if you are not using ACT_VM_SECONDARYATTACK I would recommend that one (since I have personally confirmed it works).


STEP 2
In your custom weapon script you will need to add an 'activities' block, see here - http://www.bsnooch.com/forums/index.php?topic=92.0

you want to define "IronSightPrimaryFire" and use the activity you used in the QC!   8)

hope that helps