Question:

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

LT_Reno

Weapon Specialist
Jun 24, 2004
9
0
0
Yo.
I was told to repost this here, so i shall.

Alright, ive been working on a mod that has free aim. It, for the most part, works fine, except the fact that the camera skips when you move the gun across the screen.
This mod has free aim so i figured i could get some help on how to fix this problem.

Nice mod by the way guys. very nice indeed. :D
 

Beppo

Infiltration Lead-Programmer
Jul 29, 1999
2,290
5
38
52
Aachen, Germany
infiltration.sentrystudios.net
describe the skipping a bit more, plz
do you mean a view change at the time you move over the horizontal center of the screen? if so... check out how the pitch for the viewrotation works... center is 0 and looking up simply increases the value. But looking down then starts with 65535 and decreasing the more you look down.
Check out our INFc_sMaleBase class and its view functions if you need the exact thing like we do it.
 

LT_Reno

Weapon Specialist
Jun 24, 2004
9
0
0
Well looked through it, and tried out some stuff. But nothing has worked thus far :(
 

yurch

Swinging the clue-by-four
May 21, 2001
5,781
0
0
USA, Maryland.
Visit site
It's a matter of getting the numbers to work with your math. I suggest taking the pitch value before using it in your process and adding 65535 (which is a full rotation) if it is lower than 32768 (half a rotation).
Adding a full rotation won't effect anything, as you end up in the same place, and the code will reduce it to normal when it actually goes to use it.
 

LT_Reno

Weapon Specialist
Jun 24, 2004
9
0
0
Well that just makes me want to cry.

I tried so many different approaches and here it is, th e4 lines of code that made it happen.
if(TTR_Player(owner).FPVRot.pitch < 32768)
TTR_Player(owner).FPVRot.pitch = TTR_Player(owner).FPVRot.pitch +65535;
if(TTR_Player(owner).FPVRot.pitch > 32768)
TTR_Player(owner).FPVRot.pitch = TTR_Player(owner).FPVRot.pitch +65535;

and pow. It works.
Thank you Yurch and beppo very much. :D
 

LT_Reno

Weapon Specialist
Jun 24, 2004
9
0
0
Huh, weird, actually, that makes a small area where the free aim works, but only on the lower half of the screen :/
the rest is the normal UT pitch system.

And have only the:
if(TTR_Player(owner).FPVRot.pitch < 32768)
TTR_Player(owner).FPVRot.pitch = TTR_Player(owner).FPVRot.pitch +65535;
causes moving up to work, but moving down across the screen causes the skipping still :(

Ugh, why does this have to be so complicated :p

Any other ideas that may help the up to down motion?
 

yurch

Swinging the clue-by-four
May 21, 2001
5,781
0
0
USA, Maryland.
Visit site
This is similar to something I was playing around in ut2k3 with:
Code:
var(freeaim) float pitchMax;
var(freeaim) float pitchMin;
var(freeaim) float yawMax;
var(freeaim) float yawMin;
var(freeaim) float lagDist;
////////////////////////////////////

   tempPitch = rotation.Pitch;
   if(tempPitch < 32768)
	tempPitch += 65535;
    //to initially prepare 
   if((pitchMax == pitchMin) || (yawMax == yawMin))
   {
 	pitchMax = tempPitch + (lagDist/2);
 	pitchMin = tempPitch - (lagDist/2);
 	yawMax = rotation.Yaw + (lagDist/2);
 	yawMin = rotation.Yaw - (lagDist/2);
   }
	 
    if(tempPitch > pitchMax)
    {
 	pitchMax = tempPitch;
 	pitchMin = tempPitch - lagDist;
    }
    if(tempPitch < pitchMin)
    {
 	pitchMin = tempPitch;
 	pitchMax = tempPitch + lagDist;
    }
	 	
     if(rotation.Yaw > yawMax)
     {
 	yawMax = rotation.Yaw;
 	yawMin = rotation.Yaw - lagDist;
     }
     if(rotation.Yaw < yawMin)
     {
	yawMin = rotation.Yaw;
 	yawMax = rotation.Yaw + lagDist;
     }
	 	 
     tempRot.yaw = (yawMax + yawMin) / 2;
     tempRot.Pitch = (pitchMin + pitchMax) / 2;	
     tempRot.Roll = Rotation.Roll;

     //implement tempRot into your camera rotation here
     //lagdist is the maximum size of the distance the camera 'lags' behind, 3000 or so is a decent number.
Basically you keep track of the moving upper and lower boundries of the freeaim and point the camera in between both of them.
Edit: heh, those class float vars could probably be changed to integer...
 
Last edited: