.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Bug in botmans changepitch function (http://forums.bots-united.com/showthread.php?t=1384)

Rick 15-04-2004 22:14

Bug in botmans changepitch function
 
There is a bug in botmans changepitch function;
Code:

current = pEdict->v.v_angle.x;
should be
Code:

current = -pEdict->v.v_angle.x;
This is because the x angle is reverted...

stefanhendriks 15-04-2004 22:37

Re: Bug in botmans changepitch function
 
hmm, i think you are applying here the fix that later on Paulo-la-frite once did? (did i spell his name right?). AS the X axis gets 'fixed' later on :)

botman 16-04-2004 02:05

Re: Bug in botmans changepitch function
 
The pitch of your view angles (v.v_angle) is inverted from the angle of the vector from your origin to your enemies origin. The view pitch is also 1/3 of the angle between the enemies origin and your origin, thus...

Code:

Vector v = (enemy.origin - my.origin);
angle = VectorToAngles(v);
view_pitch = (-1 * angle.pitch) / 3;

botman

Pierre-Marie Baty 16-04-2004 02:35

Re: Bug in botmans changepitch function
 
I once had made a little sketch that described all this Half-Life angle stuff. Too bad it's gone during the last website tidy-up.

Basically you have to consider the body and the view angles on the X plane as by reference to two vectors that point backwards from each other.

Rick 16-04-2004 13:20

Re: Bug in botmans changepitch function
 
I guess you all mean this code?
Code:

        // set the body angles to aim correctly
        pEdict->v.angles.x = pEdict->v.v_angle.x / 3;
        pEdict->v.angles.y = pEdict->v.v_angle.y;
        pEdict->v.angles.z = 0;
 
        pEdict->v.v_angle.x = -pEdict->v.v_angle.x; // Aim bug-fix

(For me)This happens after the botchangepitch function.
And since the ideal angle isn't inverted I guess I had to do this, atleast for me it fixed the aiming code :|

Wei Mingzhi 22-04-2004 13:18

Re: Bug in botmans changepitch function
 
You can invert the pEdict->v.idealpitch and it will be OK.

Of course, the way you are doing seems to work too.


All times are GMT +2. The time now is 15:49.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.