Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

3 years ago

Advertisement
June 05, 2020, 05:18:24 am

Author Topic: Issues with custom hit registration, possibly from newest update  (Read 3875 times)

Gaveroid

  • Donator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Issues with custom hit registration, possibly from newest update
« on: November 03, 2016, 03:28:42 am »
Since this new JC-MP update, our custom hit registration script is going funky. If you take a single fire weapon like a pistol and hold in the left mouse button, it will fire in the hitreg multiple times, though the actual weapon will only discharge once. Also, the left-handed weapon in dual-wielding will no longer register a hit. Again this has only seemed to happen since the latest update. Any ideas?

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #1 on: November 03, 2016, 03:53:02 am »
Adding to this issue. it seems to happen mostly when aiming down the sights "C", commonly called Fine Aim/Zoom. Where i have noticed while the player is in the state the weapon is never lowered when firing the Sniper Rifle or Shotgun for example, but when not in the state the weapon is lowered. Our hit reg script is not the cleanest but was working pretty well up until recently. it uses args.input == Action.FireLeft and args.input == Action.FireRight so it is happening with the mouse and gamepad.

Lord_Farquaad

  • Donator
  • Full Member
  • *****
  • Posts: 219
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #2 on: November 03, 2016, 04:46:33 am »
You could try experimenting with the new EntityBulletHit event.

SinisterRectus

  • JC2-MP Betatester
  • Sr. Member
  • *****
  • Posts: 452
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #3 on: November 03, 2016, 04:59:27 am »
You'll have to give more information about how you register hits.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #4 on: November 03, 2016, 05:14:08 am »
Lord_Farquaad, I tried the new EntityBulletHit event but it always returned nil for the entity.

Sinsiter, maybe i can send you my client file to take a peak at, it is very unclean :-[

How would one check to see if a player has the Fine Aim/Zoom enabled?
« Last Edit: November 03, 2016, 07:58:23 pm by Darwood37 »

LordNoob

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #5 on: November 03, 2016, 11:17:21 pm »

How would one check to see if a player has the Fine Aim/Zoom enabled?

I remember trying to do this. It's quite difficult. There's no truly unique AnimationState (it's shared with the state the player is in between firing shots) and tracking key input can become inconsistent because not only do you have zero ability to track what they may have changed it to, it can easily get out of sync.

Unless the API has been updated, which it might've been as this was a year ago at least.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #6 on: November 04, 2016, 12:53:20 am »
WooHoo i fixed it by checking for the amount of ammo a player has, simple but very effective. I cannot take credit for this idea, Thanks JasonMRC you are awesome.

Thanks Lord for your feedback. What you been up to lately, you active admin on any server?

I forgot to add, this issue has been around forever, shows how much i pay attention.
« Last Edit: November 04, 2016, 02:18:03 am by Darwood37 »

Urik

  • Donator
  • Full Member
  • *****
  • Posts: 119
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #7 on: November 05, 2016, 02:05:38 am »
JasonMRC seems to manage to help whole world, he helped me recently too.
So I went onto your server that day, tried aiming / shooting pistol/sniper, didn't notice any movement limitation. What I did notice though is that grenade throw seems to be assigned to RMB key, not action.fireright. So I kept throwing them each time I aim (I use RMB instead of C) until I ran out of them. Just a note.

Darwood37

  • Donator
  • Hero Member
  • *****
  • Posts: 690
    • View Profile
Re: Issues with custom hit registration, possibly from newest update
« Reply #8 on: November 05, 2016, 11:27:52 am »
OK, cheers Urik.  Have to work on that. As it wont happen unless you specifically select the dual-wield weapon, then grenade and fire both happen at once. When testing i forget half the features i have implemented  :)

If you switch back from dual-wield weapon they work as norm.
« Last Edit: November 05, 2016, 11:29:40 am by Darwood37 »