.:: 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 > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
Re: I don't like this!
Old
  (#21)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 30-12-2004

ah, in the VERC thread , where i posted about the bot document. Someone actually confirmed he got bots working (AND WALKING!) .. in his mod. So thats including mod source, but always nice to hear someone got it to work.

http://www.chatbear.com/board.plm?a=...4991&v=flatold


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#22)
cannonfodder
Member
 
Status: Offline
Posts: 8
Join Date: Dec 2004
Default Re: I don't like this! - 30-12-2004

That's one of the things I guess I don't understand. Assuming you somehow have access to the basentity (and EVERYTHING that goes with it), why can't you include your own code for the runcommand ?

On the other hand, can't you create usercmds's and call into the servers processusercmds (which appears to be what a normal client does).

BTW, I think in that thread he did it the same way botman did, by including code in the server.dll.

BTW2, botman mentioned that you can't get angles, but I'm not sure what he ment there. The client gets the angles through the engine->GetViewAngles. This should also be available to a fakeclient.

Last edited by cannonfodder; 30-12-2004 at 20:53..
  
Reply With Quote
Re: I don't like this!
Old
  (#23)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 30-12-2004

lemme search that link:
http://www.hl2coding.com/forums/viewtopic.php?t=74

its for server plugins...

i tried the processusercmds thingy before, but i ended up in some trouble. I thought the function itself also needed a cBasePlayer? Dunno what it was exactly.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#24)
cannonfodder
Member
 
Status: Offline
Posts: 8
Join Date: Dec 2004
Default Re: I don't like this! - 30-12-2004

Sorry, I meant theones posting on verc about getting bots working. I think he
is doing it in the server.dll.

processusercmds needs the edict which you got from createfakeclient and a buffer of commands. It then gets the cbaseentity from cbaseentity::instance(edict). The serverplugin can also do this by calling server->EdictToBasEntity, assuming it understands cbaseentity.
  
Reply With Quote
Re: I don't like this!
Old
  (#25)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 30-12-2004

i tried some more, and for a moment i thought i could get it working (compiling). But nope, it does not want to work:

Code:
	  CUserCmd cmd; // create command
	  bf_read *buf = NULL;	 // the buffer
	  bf_write *write_buf = NULL; // write buf?
	  cmd.Reset();
	  // Write it into buf
	  WriteUsercmd( write_buf, &cmd, &cmd ); // 
	  
	  // put cmd into buf somehow
	  
	  gameclients->ProcessUsercmds(clients[iClients].pEdict, buf, 1, 1, -1, false, false);
the WriteUserCmd cannot be compiled with the server plugin. So, in other words, i cannot seem to fill the buffer; unless i write some own magical function to compress it so HL2 understands it. This seems to be a tough one though.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#26)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: I don't like this! - 31-12-2004

WriteUsercmd is used on the client to send user key presses to the server so the server can process them.

Since bots don't have a network connection, they can't send packets to the server.

botman
  
Reply With Quote
Re: I don't like this!
Old
  (#27)
cannonfodder
Member
 
Status: Offline
Posts: 8
Join Date: Dec 2004
Default Re: I don't like this! - 31-12-2004

What does a network connection have to do with it ? The plugin code can call processusercmds directly through the interface. Isn't it just a matter of formatting it correctly ?
  
Reply With Quote
Re: I don't like this!
Old
  (#28)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: I don't like this! - 31-12-2004

The only place I see WriteUsercmd being used anywhere in the SDK source code is in...

cl_dll\in_main.cpp

All the 'cl_dll' code is stuff that runs on the client.

EDIT: Doooh! I didn't see that you were talking about ProcessUsercmds. Yes, that does seem to be available in the IServerGameClients interface and IServerGameClients is available to plugins. Hmmmmmm....

botman

Last edited by botman; 31-12-2004 at 01:55..
  
Reply With Quote
Re: I don't like this!
Old
  (#29)
cannonfodder
Member
 
Status: Offline
Posts: 8
Join Date: Dec 2004
Default Re: I don't like this! - 31-12-2004

I tooks botmans code and I was able to compile it into a plugin (by defining GAME_DLL). First I thought I need to use serverents->EdictToBaseEntity to get at the baseentity, but when I try to open an interface to serverents it won't let me.

So I tried cbaseentity::instance which does return an entity, but eveything is 0's. So I'm assuming that what it returned is not the real baseentity, but only what my code thinks is the real base entity (Since my code thinks it's the server.dll).

When I run it, it does create a bot, but I don't have the think code working yet so it doesn't move.

So.. Anyone have an idea how to get at the baseentity for the bot edict ????
  
Reply With Quote
Re: I don't like this!
Old
  (#30)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: I don't like this! - 31-12-2004

That's the problem. You CAN'T access CBaseEntity or CBasePlayer from a plugin.

botman
  
Reply With Quote
Reply


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

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 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com