[Added] Add a LookScale weapon variable for view sensitivity

Moderator: GZDoom Developers

Add a LookScale weapon variable for view sensitivity

Postby Caligari87 » Thu Mar 07, 2019 8:42 am

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-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Add a LookScale weapon variable for view sensitivity

Postby Blue Shadow » Mon Jul 22, 2019 4:26 am

User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Add a LookScale weapon variable for view sensitivity

Postby Marisa Kirisame » Mon Jul 22, 2019 4:54 am

Oh, finally. This is going to be quite useful for scopes / aiming down sights.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Add a LookScale weapon variable for view sensitivity

Postby Graf Zahl » Mon Jul 22, 2019 4:55 am

This was added some 4 months ago, but this thread was forgotten.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Add a LookScale weapon variable for view sensitivity

Postby Blue Shadow » Mon Jul 22, 2019 5:02 am

Yeah. It first made it into 4.0.0.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Add a LookScale weapon variable for view sensitivity

Postby Marisa Kirisame » Tue Jul 23, 2019 5:21 am

Oh, I guess it was undocumented, because I never noticed it being a thing.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Add a LookScale weapon variable for view sensitivity

Postby Blue Shadow » Tue Jul 23, 2019 6:30 am

It is on the wiki, but lacks the actual documentation.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Add a LookScale weapon variable for view sensitivity

Postby Caligari87 » Tue Jul 23, 2019 8:23 am

Edited the wiki page, hopefully is clear enough.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests