.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Slight problem with uber simple bot.
Old
  (#1)
voogru
Guest
 
Status:
Posts: n/a
Default Slight problem with uber simple bot. - 10-03-2004

Hello,

Im currently just writing a small bot, which just needs to be a player on a team (In natural-selection the game doesnt start unless both teams have at least one play, so I just need a bot to be on the other team while I test whatever I need to test), I've used some code from HPB_Bot, which spawns the bot and makes him connect.

Well, I'm happy to say, the bot spawns, joins a team that I want it to, but, it does not show up on the scoreboard, it shows up on status/rcon users however.

Is there something I'm missing here?

Any help would be great.

Thanks

- voogru.
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Slight problem with uber simple bot. - 10-03-2004

That does sound odd, are you calling the player function of the mod? ie: CALL_GAME_ENTITY ( I'm assuming this is for metamod ).
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#3)
voogru
Guest
 
Status:
Posts: n/a
Default Re: Slight problem with uber simple bot. - 10-03-2004

Auctually I'm not using metamod, but I am calling the game entity.

Code:
  
 
extern "C" void* player(entvars_t* pev);
 
 if(FStrEq(Cmd_Argv(0), "addbot"))
 {
  char szName[] = {"Badger"};
  char szRejectMessage[128];
  edict_t* pEdict = (*g_engfuncs.pfnCreateFakeClient)(szName);
  if (pEdict != NULL) 
  {   
   player(&pEdict->v);
   
   
   ClientConnect(pEdict, szName, "127.0.0.1", szRejectMessage);
   ClientPutInServer(pEdict);
   
   pEdict->v.flags |= FL_FAKECLIENT;
   edict_t *pInfoTeam = NULL;
   while(pInfoTeam = UTIL_FindEntityByClassname(pInfoTeam, "info_join_team"))
   {
	if(pInfoTeam->v.team == atoi(Cmd_Argv(1)))
	{
	 DispatchTouch(pInfoTeam, pEdict);
	 break;
	}
   }
  }
 }
As you can see, its simple as pie.
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#4)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Slight problem with uber simple bot. - 10-03-2004

I don't know why this works, it just does though. Change where necissary...

Code:
   const char* pszName = "Badger";
   char szRejectMsg[ 128 ];
   edict_t* pSpot = NULL;   
   edict_t* pBot = NULL;
   pBot = ( *g_engfuncs.pfnCreateFakeClient ) ( pszName );
   if ( ! FNullEnt( pBot ) )
   {
	  CALL_GAME_ENTITY( PLID, "player", VARS( pBot ) );
	  pBot->v.flags |= FL_FAKECLIENT;
	  MDLL_ClientConnect( pBot, pszName, "127.0.0.1", szRejectMsg );
	  MDLL_ClientPutInServer( pBot );
	  while ( ( pSpot = FIND_ENTITY_BY_STRING( pSpot, "classname", "info_join_team" ) ) != NULL )
	  {
		 if ( pSpot->v.team == atoi( CMD_ARGV( 1 ) ) )
		 {
			MDLL_Touch( pSpot, pBot );
			break;
		 }
	  }
	  ( *g_engfuncs.pfnRunPlayerMove ) ( pBot, pBot->v.v_angle, 0, 0, 0, pBot->v.button, 0, 0 );
   }
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#5)
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: Slight problem with uber simple bot. - 10-03-2004

When you mean "doesn't show up in the scoreboard" do you mean the bot doesn't show up AT ALL, even in grey or with the spectators ?



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
Re: Slight problem with uber simple bot.
Old
  (#6)
voogru
Guest
 
Status:
Posts: n/a
Default Re: Slight problem with uber simple bot. - 10-03-2004

That worked.

Thanks!
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#7)
voogru
Guest
 
Status:
Posts: n/a
Default Re: Slight problem with uber simple bot. - 10-03-2004

And I meant that they didnt show up on the scoreboard at all, not even under spectators. As if they were not even there.
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#8)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Slight problem with uber simple bot. - 10-03-2004

I think its one of those wierd engine things, when I was working on a bot long ago it would also do wierd things unless RunPlayerMove was called.
  
Reply With Quote
Re: Slight problem with uber simple bot.
Old
  (#9)
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: Slight problem with uber simple bot. - 10-03-2004

now what I don't understand is that you said the code Lazy posted WORKS although the bot is not using metamod, WTF ??? how on earth can this be ????



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
Re: Slight problem with uber simple bot.
Old
  (#10)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Slight problem with uber simple bot. - 10-03-2004

I told him to modify the code as needed, all of the metamod stuff can be done in a standalone dll.

Unless I completely mis-understood what you were saying.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com