.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Releases, Installers, Docs & Coding (http://forums.bots-united.com/forumdisplay.php?f=48)
-   -   pb2.6mm + CZ (http://forums.bots-united.com/showthread.php?t=1901)

Aragon 07-06-2004 17:33

pb2.6mm + CZ
 
Hi!
Ive got a funny problem! Im getting killed by my team(bots)mates ;)
I am running podbot under CZ there are same waypointed maps I like to play.
But there is a small problem.. If I choose the spetsnatz-class for CT. My team thinks im an T and tries to kill me... And T thinks im one of them and dont bother me. Perfect..... :) But still.
The code for to add another class will I find that function in bot.cpp? Can someone plz give a hint?

Could it be on line 279 and 518 in bot.cpp
<code>
if ((bot_class < 1)|| (bot_class >5))
bot_class =5;
</code>
<code>
if((pBot->bot_class < 1) || (pBot->bot_class > 4))
pBot->bot_class = RANDOM_LONG (1,4);
</code>
Just guessing...

[+Duracell-] 07-06-2004 18:13

Re: pb2.6mm + CZ
 
Those apparantly just determine what skin the particular bot uses.

Look in bot_combat.cpp probably

sPlOrYgOn 08-06-2004 01:11

Re: pb2.6mm + CZ
 
no.. it's not those..
the problem is the team checking function in podbot checks for what skin they have..
and since it doesn't check for cz skins it cannot tell what team that player is..
[edit]
Code:

int UTIL_GetTeam (edict_t *pEntity)
{
  // return team number 0 through 3 based what MOD uses for team numbers

  char model_name[32];

  strncpy (model_name, (INFOKEY_VALUE (GET_INFOKEYBUFFER (pEntity), "model")), 32);

  if ((model_name[2] == 'b') // urBan
      || (model_name[2] == 'g') // gsG9, giGn
      || (model_name[2] == 's') // saS
      || (model_name[2] == 'p')) // viP
      return (TEAM_CS_COUNTER);

  return (TEAM_CS_TERRORIST); // teRror, leEt, guErilla, arCtic
}

[/edit]

Aragon 08-06-2004 01:52

Re: pb2.6mm + CZ
 
Funny The same moment you posted here I found it!
would it be enough if I added a line like this


|| (model_name[2] == 'e')) //Spetsnatz
return (TEAM_CS_COUNTER);
and then compile it?

THX!! It did work..
And my team of bots dont try to kill me no more..

sPlOrYgOn 08-06-2004 05:17

Re: pb2.6mm + CZ
 
uhh Aragon..
that conflicts with leet...

[edit]
I suggest you use this instead:
Code:

int UTIL_GetTeam (edict_t *pEntity)
{
  // return team number 0 through 3 based what MOD uses for team numbers

  char model_name[32];

  strncpy (model_name, (INFOKEY_VALUE (GET_INFOKEYBUFFER (pEntity), "model")), 32);

  if ((model_name[2] == 'b') // urBan
      || (model_name[2] == 'g') // gsG9, giGn
      || (model_name[0] == 's') // Sas, Spetsnatz
      || (model_name[2] == 'p')) // viP
      return (TEAM_CS_COUNTER);

  return (TEAM_CS_TERRORIST); // teRror, leEt, guErilla, arCtic
}

[/edit]

Aragon 08-06-2004 07:37

Re: pb2.6mm + CZ
 
Ofcourse! We dont like/needs conflicts.. It was midnight yesterday so.. Thank You.

>BKA< T Wrecks 08-06-2004 10:10

Re: pb2.6mm + CZ
 
Well, if it's that easy, then I think it ought to be officially included! I mean, PB 2.6mm for CS and CZ, that's a good point to appeal to potential bot users, isn't it?

MusicMan 08-06-2004 11:13

Re: pb2.6mm + CZ
 
don't forget to add the Militia terrorist too Aragon;)

dead bwoy 08-06-2004 13:22

Re: pb2.6mm + CZ
 
i think it would be smarter to detect the team rather than the skin. CZ is highly customizable so you can use different skins for every bot on the server. Maybe somehow hook into the player id that pops up when your x-heir points at a player, red for T, blue for CT.

Aragon 08-06-2004 16:22

Re: pb2.6mm + CZ
 
Sure! you are making fun of me :)
Quote:

Originally Posted by MusicMan
don't forget to add the Militia terrorist too Aragon;)

if model=ct


if ((model_name[2] == 'b') // urBan
|| (model_name[2] == 'g')
// gsG9, giGn
|| (model_name[0] == 's')
// Sas, Spetsnatz
|| (model_name[2] == 'p'))
// viP
return
(TEAM_CS_COUNTER);

return (TEAM_CS_TERRORIST);
// teRror, leEt, guErilla, arCtic
}


All times are GMT +2. The time now is 01:09.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.