PDA

View Full Version : Problem with RealBot and CSBot:


dead bwoy
21-09-2004, 23:36
It seems that realbot still uses model detection to determine enemies...
This is a bad idea if realbot is to be compatible with czero. first off, there are 5 skins in czero. Support needs to be added for Spetsnaz and Militia models. As a temporary fix, for offline play only:
Alter your BotProfile.db to not allow any bots to choose the #5 skin.
For On-line play: no fix....
CZ TOD custom missions:
You CAN kick csbot and substitute realbot but if the mission pack uses 50+ custom skins, you'll have BIG problems!

Is there an easier way that could be used to detect enemies?

Whistler
22-09-2004, 10:12
int UTIL_GetTeam(edict_t *pEntity)
{
union
{
short s;
char c[2];
} t;

char *p = g_engfuncs.pfnInfoKeyValue(g_engfuncs.pfnGetInfoKe yBuffer(pEntity), "model");
t.c[0] = p[0];
t.c[1] = p[1];

if (t.s == (('e' << 8 ) + 't') || // TError
t.s == (('e' << 8 ) + 'l') || // LEet
t.s == (('r' << 8 ) + 'a') || // ARctic
t.s == (('u' << 8 ) + 'g') || // GUerilla
t.s == (('i' << 8 ) + 'm')) // MIlitia
return TEAM_TERRORIST;

return TEAM_CT; // URban, GSg9, SAs, GIgn, VIp, SPetsnaz
}

^-- very 1337 one :D

also this may be the only way to detect teams if you don't have the source code to the MOD

edit: [ code ] tag doesn't work correctly in this forum ??????

dead bwoy
22-09-2004, 11:25
Hopefully someone with some coding knowledge can apply this in a future release...

stefanhendriks
22-09-2004, 17:22
then this should be in the 'source' forum... ;)

dead bwoy
22-09-2004, 22:48
...also this may be the only way to detect teams if you don't have the source code to the MOD...I got to thinking about this some more and csbot, which originally was a hook.dll, detects teams by other means, no matter what the model names are that are being used. Maybe something to do with the spawn entities? I don't know, I don't code, I just know there's a better way to detect teams out there...

frashman
03-10-2004, 14:13
don't understand the choherences ...

Whistler
03-10-2004, 14:59
csbot is NOT a "hook dll". The warez version of "ZBot" is actually the cracked version of czero 1.0 mp.dll.
You can overwrite your original mp.dll with the warez "ZBot" and you'll find your CS will still work.

dead bwoy
05-10-2004, 02:34
I thought Z-Bot was the leaked beta version of the CSBot... which was tested on cstrike not czero... I just assumed that it would have been a hook dll, I never got to beta test the bot...
The current CSBot is embedded in the czero mp.dll
I guess the beta bot was embedded in a beta mp.dll?

sPlOrYgOn
05-10-2004, 08:30
also this may be the only way to detect teams if you don't have the source code to the MOD
well I know it cannot be the only way to detect teams because of chickenmod and some other mod which changes the players models..
more than likely the team data is stored in the private data...
if only someone had time to figure out all the offsets to all the saved stuff in the CS player private data...

Whistler
05-10-2004, 08:33
the offset is likely to change when CS is updated so that may be not a good idea

sPlOrYgOn
05-10-2004, 08:40
another way would be to catch "TeamInfo" messages..
except they are unreliable because the time they are sent is when someone joins but when that someone barely joins he has no team and it won't send another TeamInfo message until the next time someone joins..
each time someone joins it gets sent for all the players to refresh their team or something..
this is statsme's implementation of catching these messages.. from v2.7 but also used in v2.8
// team is changed then this msg is send
void Client_TeamInfo_CS(void* mValue)
{
if (mPlayer) return;

static int index;

switch (mState++) {
case 0:
index = *(int*)mValue;
break;
case 1:
const char* team = (char*)mValue;

int i;

for(i = 0; i < sm.team_num ; ++i)
if ( !strcmpi(sm.team_name[i],team) )
break;

//accept only new teams, max. 4 teams
if ( i == sm.team_num && i < 4 )
strcpy( sm.team_name[sm.team_num++], team);

player_t*pPlayer = GET_PLAYER_POINTER_I( index );

if ( !pPlayer->ingame ) {//this is bot...
edict_t* pEntity = INDEXENT(index);
PlayerConnect( pEntity , STRING(pEntity->v.netname), "127.0.0.1:27005" );
PlayerPutInServer( pPlayer );
}

strcpy(pPlayer->team_name, sm.team_name[i]); //save name of team
pPlayer->team_index = i;
sm.team_players[0] = 0;
sm.team_players[1] = 0;
sm.team_players[2] = 0;
sm.team_players[3] = 0;
for ( i = 1; i <= gpGlobals->maxClients; ++i )
{
pPlayer = GET_PLAYER_POINTER_I( i );
sm.team_players[pPlayer->team_index]++;
}
}
}