Page 1 of 1

Add a LookScale weapon variable for view sensitivity

Posted: Thu Mar 07, 2019 7: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 all

class PistolTest : Pistol {
	override void PostBeginPlay() {
		super.PostBeginPlay();
		LookScale = 0.1;    //10% look sensitivity
	}
}
8-)

Re: Add a LookScale weapon variable for view sensitivity

Posted: Mon Jul 22, 2019 3:26 am
by Blue Shadow

Re: Add a LookScale weapon variable for view sensitivity

Posted: Mon Jul 22, 2019 3:54 am
by Marisa the Magician
Oh, finally. This is going to be quite useful for scopes / aiming down sights.

Re: Add a LookScale weapon variable for view sensitivity

Posted: Mon Jul 22, 2019 3: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

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

Re: Add a LookScale weapon variable for view sensitivity

Posted: Tue Jul 23, 2019 4:21 am
by Marisa the Magician
Oh, I guess it was undocumented, because I never noticed it being a thing.

Re: Add a LookScale weapon variable for view sensitivity

Posted: Tue Jul 23, 2019 5:30 am
by Blue Shadow
[wiki=Weapon_properties#Weapon.LookScale]It is on the wiki[/wiki], but lacks the actual documentation.

Re: Add a LookScale weapon variable for view sensitivity

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

8-)