Add a LookScale weapon variable for view sensitivity

Moderator: GZDoom Developers

Post Reply
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Add a LookScale weapon variable for view sensitivity

Post 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-)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Add a LookScale weapon variable for view sensitivity

Post by Blue Shadow »

User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Add a LookScale weapon variable for view sensitivity

Post by Marisa the Magician »

Oh, finally. This is going to be quite useful for scopes / aiming down sights.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Add a LookScale weapon variable for view sensitivity

Post by Graf Zahl »

This was added some 4 months ago, but this thread was forgotten.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Add a LookScale weapon variable for view sensitivity

Post by Blue Shadow »

Yeah. It first made it into 4.0.0.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Add a LookScale weapon variable for view sensitivity

Post by Marisa the Magician »

Oh, I guess it was undocumented, because I never noticed it being a thing.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Add a LookScale weapon variable for view sensitivity

Post by Blue Shadow »

[wiki=Weapon_properties#Weapon.LookScale]It is on the wiki[/wiki], but lacks the actual documentation.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Add a LookScale weapon variable for view sensitivity

Post by Caligari87 »

Edited the wiki page, hopefully is clear enough.

8-)
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”