![]() |
Re: Buytable SCREWED.
would something like this work?
bot_buycode.cpp:270 Code:
if (UTIL_GiveWeaponType (wapen_tabel[i].iId) == SHIELD) Code:
if (pBot->iPrimaryWeapon > -1) { // bot has a weapon |
Re: Buytable SCREWED.
i think your code should work...
|
Re: Buytable SCREWED.
the first code set should work, the second code set won't because iId != wapen_tabel index. a simple function to create a static array should be easy, ie
Code:
int UTIL_GetWapenIndex (int iId) HTH. testing the shield code now... |
Re: Buytable SCREWED.
There already is code to revert the real ID and the wapen_tabel id ... in the buycode.cpp function afaik.
|
Re: Buytable SCREWED.
yea, there is, thanks.
bot_buycode.cpp: 210 Code:
if (pBot->iPrimaryWeapon > -1) { Code:
if (pBot->iSecondaryWeapon > -1) { bot_buycode.cpp line 254 Code:
// Buy favorite weapon |
Re: Buytable SCREWED.
In the code util.cpp, there are question marks around the weapon name used internally by CS 1.6 for shields, can someone check in reallog.txt if there are lines like:
UTIL_GiveWeaponId: Unknown weapon name xyz where xyz should be weapon_shield (then the question marks should be removed), else the code should be modified 9_9 You need to use build 3056 which has just been committed on 18th of July... Thanks -evy PS: I have no access to a CS 1.6... |
Re: Buytable SCREWED.
i have no Unknown weapon name in my reallog.txt, though they don't run 24/7. bots have bought all the weapons though. HTH
|
Re: Buytable SCREWED.
i made the changes to my bot_buycode described below and it has drastically reduced/eliminated the buying multiple primaries each round.
it also reduces the buying of a shield if they have a primary weapon no Unknown weapons yet evy, done aprrox 30 rounds on mindmaze and none yet. |
Re: Buytable SCREWED.
sorry for all the double posting
bot_buycode.cpp: line 179 why isn't it Code:
pBot->buy_primary = false; also, for the actual buy'ing section, I don't know if the compiler will optimize it as much as converting it to a switch statement because that's all it basically is. I remember from my compilers class that a switch statement converts to quicker code than if statements :) HTH :) I have such conversion implemented :) you have line 444 = line 436 perhaps we could put into the personality a buy only pistols option? perhaps it could be a mode ;) i've been trying to debug the buycode, it doesn't seem to update the iPrimaryWeapon before going into the buycode sometimes it is updated after the swat teams are created though :/ any idea why that is????:(:'( |
Re: Buytable SCREWED.
The original code was meant to buy every round a new primary weapon; or better said, to let the bot rethink about it so it could buy a BETTER weapon when it has the money and such. When the favorite weapon ip is set, the 'thinking' will be stopped automaticly there.
a pistol mode is cool ;) iPrimaryWeapon is updated every frame in UpdateStatus() of the bot. |
All times are GMT +2. The time now is 17:57. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.