![]() |
Need some help with pickup pistols
I try many thinks and I can't get the bots to pickup weapons correctly.
On my last test if there is a pistol on the ground and bot have primary weapon, he don't switch to pistol and drop his primary weapon and after that he drop the pistol and else. So can I do the pickup funciton to be a other task like PICKUP_PISTOL and if this is possibly how can I do it. Sorry for stuped question but you knows that I'm new C++ coder(I now learning C++) and I'm new bot coder.Many thinks!!! But I realy wont to continue this bot and I hope that all guys in this forums who can help me will help me :) But for now don't tell me all that I must do, tell me only some thinks becorse I wont to do it with my ideas.I just wont some help for start and I hope that I will do the other thinks alone. |
Re: Need some help with pickup pistols
you have to switch to the secondary weapon already some time in advance, because switching weapons is done via messages, therefore it needs time, and the animations maybe, too.
|
Re: Need some help with pickup pistols
But yes I use SelectWeaponbyNumber(pBot, iWeaponNum); to switch to pistol but is not working.
I try only with pistol pickup code and the bots pickup pistols correctly and don't drop his primary weapon. But when I use pistol pickup code and primary pickup code togeder is not working. I don't know what is the reason. |
Re: Need some help with pickup pistols
What Aspirin meant is that there needs to be a delay (at least one frame time) between weapon switching and weapon dropping. If you make your bot issue the "drop" client command right after your SelectWeaponByNumber() function, the bot will not drop the right weapon. You must make your bot select the right weapon, WAIT a few frames, and only then drop it.
Some client commands are not processed by the engine right at the time you issue them, but are buffered so that they are processed at the end of the frame, or at the beginning of the next frame. I suspect that is what's happening with the weapon selection client command. What you can do, is not allow the bot to send the "drop" client command unless you are CERTAIN that it's holding the right weapon in its hands (by continuously checking its current weapon, for example, or else by catching the weaponselect network message). |
Re: Need some help with pickup pistols
OK I try with wait time but again is not working.
I think that the two codes for Secndary and Primari weapon pickup are meset up are togeder. So I post the code here but I post it clean with no wait times becose maybe there is a mistake in the code.Wait time is not working. Code:
// Near to Weapon ? |
Re: Need some help with pickup pistols
is this really supposed to be this way :
PHP Code:
|
Re: Need some help with pickup pistols
What do you mean ???:(
If I do it like this PHP Code:
</font></font> |
Re: Need some help with pickup pistols
aspirin is right, this code can't work :)
if you want to understand why, indent your code better and look at how the bot decides whether it's a primary or a secondary weapon... |
Re: Need some help with pickup pistols
Hmm is there way to make the bots to pickup pistols with other task like PICKUP_PISTOL or something else.
And I can't understand where I wrong in the code. |
Re: Need some help with pickup pistols
don't despair, some bugs take month to be found, if ever. and I guess noone can really help you here, just based on a few lines of code.
for my post above, what I meant : I meant that the decision if it's a secondary or primary weapon doesnt have anything to do with distance, therefore I asked if that was right |
All times are GMT +2. The time now is 04:25. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.