Gun Disconectors and netcode

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Postal

I apear to have lost my pin.
Nov 14, 1999
1,388
0
0
WoD.BeyondUnreal.com
For those of you that dont know, in RL semi auto guns generaly have a small peice of metal called a disconector. This usaly engages the sear and prevents full auto firing.

Now in the early versons of C4(Im coding it BTW) I used Pawn(Owner).bFire = 0; to simulate a disconector(so you have it click for each shot) but to my dismay that does not work online. Well I have spent a hellacious amount of time getting the scope and reload to work online, so I have decided to ask for help here, should I use a global.Fire, or do I use a replication line to tell the server that bfire=0 or how should I do that?
 

usaar33

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
if you want to want to force the client to hit fire again, you should have simply rewritten the finish() function so it doesn't check fire keys (i.e. either puts down the weapon or simple idles it). client-side states shold be similar.
 

Postal

I apear to have lost my pin.
Nov 14, 1999
1,388
0
0
WoD.BeyondUnreal.com
As in didnt work at all, I removed the continue firing if bfire!=0 or what ever it is(cant think of the top of my head, hards day schooling) and tried that and it didnt work at all, even when finish was called, the guns keeped firing

Yea I am haivng the problem with the guns playing fire anims when reloading, but for the moment I am trying to fix other things, my 5 failed attempts to fix have kind of depressed me.
 

butto

Red Orchestra Coder
It's quite simple to make the semi-auto guns cease to fire once the button has been pressed once. You just have to make sure that your idle state and finish function don't try to refire if the button is still down and make sure that the NormalFire state has Fire in its "ignores". You might have to deal with some issues on the client side as well.
 

Postal

I apear to have lost my pin.
Nov 14, 1999
1,388
0
0
WoD.BeyondUnreal.com
I have tried what you are mentioning, and it did not work for me online, gun would still be full auto, anyways I now have a solution to the problem thanks to Mr. Self-Destruct, thanks for your suggestion.
 

butto

Red Orchestra Coder
What I said will work, you just have to take sure that a lot of the original states are overidden. I might be forgetting something though since the weapons code for my mod has just about everything rewritten from scratch and uses simulated states so that the client is smarter and can play almost all animations on its own without the server telling it to play them.