![]() |
Re: I don't like this!
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 |
Re: I don't like this!
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. |
Re: I don't like this!
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. |
Re: I don't like this!
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. |
Re: I don't like this!
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 |
Re: I don't like this!
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 |
Re: I don't like this!
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 ?
|
Re: I don't like this!
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 |
Re: I don't like this!
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 ???? |
Re: I don't like this!
That's the problem. You CAN'T access CBaseEntity or CBasePlayer from a plugin.
botman |
All times are GMT +2. The time now is 06:18. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.