As the title states, is there a way for the CalcView function to be forced to update at a specific moment when I want it to via code? I'm currently in the process of making an alternative viewpunch function and a slight delay is noticeable every time I execute the function that would change some variables to be updated in CalcView, but it doesn't update quick enough and thus the delay is present [URL="https://youtu.be/dHZkl_JoxuI?t=15s"]as shown in this video of mine (clicky).[/URL] Thanks.
There are many ways to approach this.
You can have table with data for calcview outside of the function and modify it at will.
That's what I sort of went for, but I did it in a crappy, sloppy way by using networked variables set for both server and client (which I wanted clientside but couldn't figure out how): [url]http://pastebin.com/ySRQJPGV[/url]
Values set by SetRecoilOffset() don't immediately affect the CalcView function. Is there an alternative to the method I use in the code?
So you are setting the NWVars serverside? That would cause the delay. Set pure clientside variables instead.
If I do that, would it work when hosting a listen server and setting the NWVars clientside?
[QUOTE=SupahMarioX;50389518]If I do that, would it work when hosting a listen server and setting the NWVars clientside?[/QUOTE]
Why do you need NWVars clientside lol.
[QUOTE=Netheous;50389681]Why do you need NWVars clientside lol.[/QUOTE]
[QUOTE=SupahMarioX;50385360]I'm currently in the process of making an alternative viewpunch function,[/QUOTE]
Speaks for itself.
[QUOTE=SupahMarioX;50389744]Speaks for itself.[/QUOTE]
No it doesn't, because you don't need that.
[editline]25th May 2016[/editline]
You can do the calculation on both ends (via shared function) and leave bullet trajectory calculation serverside so it can't be cheated.
[QUOTE=Netheous;50389766]You can do the calculation on both ends (via shared function) and leave bullet trajectory calculation serverside so it can't be cheated.[/QUOTE]
Alright, I'm already doing calculations of the custom viewpunch by a NWAngle set shared both client and server (and as for bullet trajectory calculation, that's already taken care of by the SWEP base I'm using) Back to the root problem, CalcView is delayed in "displaying" the punched angle. I've already made a [URL="http://pastebin.com/ySRQJPGV"]paste on PasteBin[/URL] with code to reference from. Any suggestions/comments?
Why do you need to share this... again?
[editline]25th May 2016[/editline]
Also it's not delayed, I'm quite sure you are shooting twice simultaneously (add print("shooting now")) to your PrimaryFire
[QUOTE=Netheous;50390062]
Also it's not delayed, I'm quite sure you are shooting twice simultaneously (add print("shooting now")) to your PrimaryFire
[/QUOTE]
Nope, shooting once. The thing is, this delay is a split millisecond before CalcView gets updated. If showing code won't be enough to actually see how it's delayed, [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=536888463"]trying the addon with the code[/URL] and setting host_timescale to 0.1 on a listen server would evidently show.
[QUOTE=SupahMarioX;50390223]Nope, shooting once. The thing is, this delay is a split millisecond before CalcView gets updated. If showing code won't be enough to actually see how it's delayed, [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=536888463"]trying the addon with the code[/URL] and setting host_timescale to 0.1 on a listen server would evidently show.[/QUOTE]
Are you sure - have you checked with the print?
[QUOTE=Netheous;50390227]Are you sure - have you checked with the print?[/QUOTE]
Absolutely. I could get a paste of the PrimaryAttack function if you want, but I'm certain there is no duplicate of bullet firing.
[QUOTE=WeltEnSTurm;50388993]So you are setting the NWVars serverside? That would cause the delay. Set pure clientside variables instead.[/QUOTE]
Used that method and net library usage. Thread now solved.
Sorry, you need to Log In to post a reply to this thread.