![]() |
f_move_speed = 0.0; and IN_ATTACK Problem
Code:
But if the bot can move forward only one little step, they can fire another shot. This also happen to breakable object, if the bot shoot at the window and if he can't break it in the first shoot, he just stand still before the window and do nothing, but if the bot can move forward a little step, then he can fire another shoot, please help. |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
thats because the if statement is only for
pBot->f_move_speed = 0.0; the other stuff will always run. instead have it Code:
if (pBot->f_duck_time > gpGlobals->time) |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
is it normal that with such a code the bot will keep ducking and firing forever ?
|
Re: f_move_speed = 0.0; and IN_ATTACK Problem
hehe yes, i see it too now. The code should not say:
pBot->f_duck_time = gpGlobals->time + 1.5; within the scope, it should just say: pBot->pEdict->v.button |= IN_DUCK; :D |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
Actually my code is like this:
Code:
If I remove the pBot->f_move_speed = 0.0; function and now the bot will duck but not duck and don't move, they will duck and move forward at the same time, but now they can keep shooting without problem until the enemy die. Or am I mis-understand how pBot->f_move_speed = 0.0; work? I think it only make the bot don't move but do you mean it will make the bot totally pause ? If yes which command can make the bot only stop move but not pause ? |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
Hmm no one know ? Or botman can you help please ?
|
Re: f_move_speed = 0.0; and IN_ATTACK Problem
Code:
if (pBot->f_duck_time < gpGlobals->time) they kept saying DUCKING because you made them say ducking 100% of the time.. |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
You need to toggle the IN_ATTACK button on and off. If you keep setting it to IN_ATTACK during EVERY frame, it's the same thing as holding the trigger down (which will only fire ONE shot unless you are firing an automatic weapon).
Try something like this... Code:
if (RANDOM_LONG(1, 100) <= 100) //now 100% because I want to test it botman |
Re: f_move_speed = 0.0; and IN_ATTACK Problem
OMG it work now ! Botman THANK YOU VERY MUCH ! :D
|
All times are GMT +2. The time now is 15:50. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.