Page 1 of 1

Add a LookScale weapon variable for view sensitivity

PostPosted: Thu Mar 07, 2019 8:42 am
by Caligari87
https://github.com/coelckers/gzdoom/pull/780

As it stands, adjusting the view sensitivity for a player can be done in a roundabout way by fiddling with a weapon's FOVScale and DesiredFOV to "trick" the engine into thinking the player has a higher or lower FOV than they actually do.

This pull request implements a canonical way to do the same without "hacks" by adding a simple multiplier LookScale to the weapon. For example, setting LookScale = 0.5 sets the player's look sensitivity to half.
Code: Select allExpand view
class PistolTest : Pistol {
   override void PostBeginPlay() {
      super.PostBeginPlay();
      LookScale = 0.1;    //10% look sensitivity
   }
}


8-)

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Mon Jul 22, 2019 4:26 am
by Blue Shadow

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Mon Jul 22, 2019 4:54 am
by Marisa Kirisame
Oh, finally. This is going to be quite useful for scopes / aiming down sights.

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Mon Jul 22, 2019 4:55 am
by Graf Zahl
This was added some 4 months ago, but this thread was forgotten.

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Mon Jul 22, 2019 5:02 am
by Blue Shadow
Yeah. It first made it into 4.0.0.

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Tue Jul 23, 2019 5:21 am
by Marisa Kirisame
Oh, I guess it was undocumented, because I never noticed it being a thing.

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Tue Jul 23, 2019 6:30 am
by Blue Shadow
It is on the wiki, but lacks the actual documentation.

Re: Add a LookScale weapon variable for view sensitivity

PostPosted: Tue Jul 23, 2019 8:23 am
by Caligari87
Edited the wiki page, hopefully is clear enough.

8-)