View Single Post
Re: Need some help with pickup pistols
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Need some help with pickup pistols - 21-11-2004

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).



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote