Jump to content
  • 0

Is there any way to ADJUST mouse looking limits?


Question

Hi there!
Need to make a half limits on "mouse looking"
(QUESTION IN THEME NAME) 
I tried to google, looking on ZDoomWiki. etc.. 
and as I understand there is no way to do this..  
Is it right? :|
THANKS!🙂

Share this post


Link to post

9 answers to this question

Recommended Posts

  • 0

What do you mean? Do you mean half movement sensitivity? If so, it's not great to mess with the user's control preferences. If you mean limiting the angle, that isn't a thing which makes sense.

 

I suggest reworking whatever you had in mind which required limiting the angle.

Share this post


Link to post
  • 0
16 hours ago, Stabbey said:

What do you mean? Do you mean half movement sensitivity? If so, it's not great to mess with the user's control preferences. If you mean limiting the angle, that isn't a thing which makes sense.

 

I suggest reworking whatever you had in mind which required limiting the angle.

Sure I mean limiting the angle of "mouse looking" (*by half - if we talking about my specific target). 
"that isn't a thing which makes sense" - No sense? I Need it, if possible. 
It`s main part of GAMEPLAY design.

Share this post


Link to post
  • 0
Posted (edited)

If I’m interpreting your question correctly, then yes it’s possible. We did something like this via ACS in Doom Returns for a mechanic in which you are firing a tank gun. The player’s view when controlling the tank gun has limited angles since it wouldn’t make sense for the gun to point all the way up/down or rotate 360 degrees. Is that similar to what you mean?

 

 

Andarch

The DANDY Company

Edited by The DANDY Company

Share this post


Link to post
  • 0
On 3/4/2024 at 1:34 PM, The DANDY Company said:

If I’m interpreting your question correctly, then yes it’s possible. We did something like this via ACS in Doom Returns for a mechanic in which you are firing a tank gun. The player’s view when controlling the tank gun has limited angles since it wouldn’t make sense for the gun to point all the way up/down or rotate 360 degrees. Is that similar to what you mean?

 

 

Andarch

The DANDY Company

"yes it’s possible" — WOW!NICE! :D 
Thank You for answer :)
Yes, idea with the "tank gun" is absolutely close to my case. 
Are There / Somewhere any Examples of ACS code about this? 
(*cuz. I much more designer than programer .without ACS High skills). 
Anyway — Thank You Again :D

Share this post


Link to post
  • 0

 

55 minutes ago, Dangerous Keen 4 said:

Are There / Somewhere any Examples of ACS code about this?

 

Not sure, but I can provide an example based on what we did for the tank, and maybe it will be helpful. I'll try to do this today.

 

Andarch

The DANDY Company

Share this post


Link to post
  • 0
On 3/5/2024 at 7:35 PM, The DANDY Company said:

Not sure, but I can provide an example based on what we did for the tank, and maybe it will be helpful. I'll try to do this today.

Hello. so, can You give me some sample / any ACS example on this theme? Please. 
I really need it, cuz make project "Classic Doom3" with Classic limits (gameplay). 
Thanks and Best regards.

Share this post


Link to post
  • 0
6 hours ago, Dangerous Keen 4 said:

Hello. so, can You give me some sample / any ACS example on this theme? Please. 
I really need it, cuz make project "Classic Doom3" with Classic limits (gameplay). 
Thanks and Best regards.

Yes sorry I didn’t get to this yet. I’ll try to cook up something later today. 
 

Andarch

The DANDY Company

Share this post


Link to post
  • 0
On 5/31/2024 at 10:46 PM, The DANDY Company said:

Yes sorry I didn’t get to this yet. I’ll try to cook up something later today. 
 

Andarch

The DANDY Company

Thanks :)

Share this post


Link to post
  • 0
Posted (edited)
On 6/17/2024 at 12:57 PM, Dangerous Keen 4 said:

Thanks :)

So sorry for the delay. Here's a small example. Note that this method only works if you set the player property frozen to TRUE, or else the view will jerk back and forth when reaching the angle limit. Not 100% why, but maybe you or someone can figure out how to get it to work while not frozen.

 

You can download the example wad from our Google Drive here: https://drive.google.com/open?id=1AOOzgX7NPXynWY-4lZEvNo6dfcwpKeY1&usp=drive_fs

 

Here is the ACS code used in the example:

#include "zcommon.acs"

#define PLAYER_ANGLE_MIN 0.65
#define PLAYER_ANGLE_MAX 0.85
#define PLAYER_PITCH_MIN -8.0
#define PLAYER_PITCH_MAX 22.0

Script "ConstrainPlayerAngle" ENTER
{
	SetPlayerProperty(0, 1, PROP_FROZEN);

	while(TRUE)
	{
		int playerAngle = GetActorAngle(0);
		int playerPitch = GetActorPitch(0);

		//Constrain player angle to bounds
		if(playerAngle < PLAYER_ANGLE_MIN)
			SetActorAngle(0, PLAYER_ANGLE_MIN);
		else if(playerAngle > PLAYER_ANGLE_MAX)
			SetActorAngle(0, PLAYER_ANGLE_MAX);

		//Constrain player pitch to bounds
		if((playerPitch << 8) < PLAYER_PITCH_MIN)
			SetActorPitch(0, PLAYER_PITCH_MIN >> 8);
		else if((playerPitch << 8) > PLAYER_PITCH_MAX)
			SetActorPitch(0, PLAYER_PITCH_MAX >> 8);

		Delay(1);
	}
}

 

Andarch

The DANDY Company

Edited by The DANDY Company

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...