Angle offset bug
I think this is an aged old error but I still cant figured out how to fix it
we assume we define a vector "vec" Code:
Vector look_vec = UTIL_VecToAngles( vec ); |
Re: Angle offset bug
This ain't making the bot aim to the right side. The only thing that could cause the effect you're witnessing may be the weapon recoil. Especially if you use the bots in realistic mods such as Counter-Strike (which I bet that's what you're trying to do).
This behaviour is not a bug in the HPB_bot, but rather a lack of a functionality, which is recoil compensation. To compensate for the recoil, most bot authors compute their aiming vector by taking in account the "punchangle" variable in the bot's entvars structure. |
Re: Angle offset bug
thats not the problem , because that happen although in freezetime , but when I change the code to
Code:
pEdict->v.v_angle = UTIL_VecToAngles( vec ); |
Re: Angle offset bug
It IS the problem. If you make your bot lock on the target immediately, absolutely each frame, the punch angle has no effect, neither has the weapon recoil. But since bots feature random offset variations to simulate human-like aim, this variation gets multiplied by the punch angle. Simple as that.
|
Re: Angle offset bug
no , I just force the bot to aim at the enemy head
Code:
Vector v_enemy = v_enemy = (pBot->pBotEnemy->v.origin + pBot->pBotEnemy->v.view_ofs) - |
Re: Angle offset bug
yes, this is just what I'm saying. So what ?
|
Re: Angle offset bug
lol , I missed the word "punch angle" :)
And why , it only happen sometimes and always to the yaw angle ? It never happen at "x" and "z" , I dont think it is because of the punch angle |
Re: Angle offset bug
It depends on how the mod DLL implements it.
|
Re: Angle offset bug
finally I figured it out , it is caused by the function BotFixIdealYaw()
The HPB_Bot template one is : Code:
void BotFixIdealYaw(edict_t *pEdict) Code:
void BotFixIdealYaw(edict_t *pEdict) |
Re: Angle offset bug
No, this is NOT the cause. Are you listening to what we tell you ?????
By doing this you introduced a new bug that will make the engine crash if ever an angle greater than 540 is passed to it through BotFixIdealYaw. |
All times are GMT +2. The time now is 07:21. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.