Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CVars to restore WON view rolling effects #452

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

jcb936
Copy link
Contributor

@jcb936 jcb936 commented Jul 30, 2023

See issue in the original HL SDK repo: ValveSoftware/halflife#1544

The viewroll effect was removed sometime when HL came to Steam. Since BunnymodXT can restore the weapon bob effect, I thought it would have been nice for it to also being able to restore the viewroll effect. The values are slightly different from the one in the issue above, and have been taken from the implementation used in halflife-updated (see: twhl-community/halflife-updated@dcd3e93 ) which gives a nicer effect.
This PR adds cvars to restore the viewroll effect (defaults to false) and set the rollspeed and rollangle values.

@SmileyAG
Copy link
Collaborator

SmileyAG commented Jul 30, 2023

I suppose it doesn't override viewangles at the end and can be toggled to enable/disable in the demo? Otherwise, I would restrict it up to sv_cheats 1 or banning for RTA runs (see #341 (comment))

Because, the known implementations viewroll that I seen before was been overriding viewangles, that also saved up to the demos without possibilities for removing

The weapon bob effect is been to safe for implementing, since it doesn't overriding angles while recording the demo, but as the same time it couldn't be enabled at the demo (basically, it's only works while running itself)

@SmileyAG
Copy link
Collaborator

I suppose it doesn't override viewangles at the end and can be toggled to enable/disable in the demo? Otherwise, I would restrict it up to sv_cheats 1 or banning for RTA runs (see #341 (comment))

Because, the known implementations viewroll that I seen before was been overriding viewangles, that also saved up to the demos without possibilities for removing

Tested in-game and as I expected, that's still overrides view angles at the end, so it saves to the demo without a possibilities for toggling it
@YaLTeR Might be restrict it to sv_cheats 1 then, what do you think?

@YaLTeR
Copy link
Owner

YaLTeR commented Jul 30, 2023

Sure

@jcb936
Copy link
Contributor Author

jcb936 commented Jul 30, 2023

Sadly it overrides the viewangles, yes! I can restrict it to sv_cheats 1 for now and in the meantime see if there's a more clever solution to not override the values for demo, would be nice to have.

@khanghugo
Copy link
Contributor

The mechanism to avoid writing overriden viewangles values and such into the demo migth be a bit complicated but shouldn't be impossible. I hypothesise you must have a static variable holding the current viewangles, then after something like V_RenderView() and between any calls with cls.demorecording == true condition, you can restore it. From a quick glance, I think it should be before ClientDLL_UpdateClientData.

@jcb936
Copy link
Contributor Author

jcb936 commented Jul 31, 2023

Apologies was a bit busy, changed it to be available only with sv_cheats 1! Still looking into making it safe for demos and such.

@khanghugo
Copy link
Contributor

Is it necessary to add it? I mean it's nice if you figure that out because it involves demo and stuffs. Anyway, since it is only available under sv_cheats 1 now, maybe if you want you can go extra for that (which makes good foundation for other related functionalities to work with demo as well!).

@YaLTeR YaLTeR merged commit 684eb15 into YaLTeR:master Aug 1, 2023
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 1, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants