![]() |
Let's kill the bots
Yo Yo!
I was wondering what function/s should be called to make the bot drop dead?! P.S just killing them without kickin' them out of the server. |
Re: Let's kill the bots
pfnClientKill();
|
Re: Let's kill the bots
Negative!
Neither ClientKill() nor ClientDisconnect seem to work! any other ideas? P.S Do you think calling pfnPlayermove after ClientKill might solve the problem? |
Re: Let's kill the bots
If you know how to use ClientKill() there will be no problem. You must point the correct edict. Show me the code with that you try to kill the bots.
|
Re: Let's kill the bots
I'm afraid that I can't show you the code , but I'm sure that the code points to the right edict_t ..
btw when using ClientDisconnect() the server prints on the console that the bot has left the game , nevertheless the bot stays in the server ......also worth noting that other functions like ClientPutinServer work perfectly ! Damn , why won't this bot DIE :cursing: |
Re: Let's kill the bots
To kick bot from server you must use "kick" server command. And why you can't show me the code - is it top secret ? If you can't do it I can't help you.
|
Re: Let's kill the bots
The "kick" command doesn't work also!.....as far as I tried from the console..
I think that it's my right to decide whether to show the code or not.....(it's not Top Secret....but half Top Secret , LOL) anyways I'm just trying to ask why this is happening , since "YOU guys" are "expierenced" bot coders .. OnTopic - When should ClientKill() be called ? in StartFrame() ? What do I else need - other than the edict_t pointer- to call the funtion successfully? Should other fucntions be called after it? or before it? Any other possible reasons that would cause ClientKill() or ClientDisconnect() to fail? |
Re: Let's kill the bots
SERVER_COMMAND("kick %s", STRING(pev->netname)) - this will fully kick the bot.
You need to call ClientKill() only at the time that you want to kill the bot, when and where you will call it you must deside. So far all is right but if I can't see the loop code that you make to get the needed edicts so I can't really tell you where you wrong. Nobody will stole you code if you put it here so don't worry, I don't understand what secret can be a loop for player edicts huh ??? |
Re: Let's kill the bots
I didn't post any codes because I personally don't believe that the problem lies in the edict_t loop , but if you insist I easily can !
just Hold ON....be right back! |
Re: Let's kill the bots
The problem is on place that maybe less expect. So little check on the code after you post it wont be a problem. ;)
|
Re: Let's kill the bots
OK Fasten Seat Belts:
PHP Code:
Can you see something I've overseen? P.S also very important to note is that I'm having only one bot running at the same time (as you can see) the next bot gets called after the previous dies.... |
Re: Let's kill the bots
From where you got the data for the pointer current->pEdict ?
|
Re: Let's kill the bots
Initialized in ServerActivate()
|
Re: Let's kill the bots
Are you using array to get it in ClientConnect() ? Because if new bot join the pointer will be overwrited ?
|
Re: Let's kill the bots
Yep! I'm using an array of a struct called bot_t which holds pEdict.
also I omited ClientPutInServer() from BotCreate() so that they are spawned in StartFrame() |
Re: Let's kill the bots
ServerActivate() is not good to get bot edicts, you can't get the bots edicts at all from it, ClientPutInServer() is not usefull because you must call it for each bot, this function is not called auto when you create the bot with the engine. I suggest to do the edicts update and checks in start frame, and to spawn the bots in their own BotThink() function.
put that in the begining of start frame: Code:
for (int iPlayerIndex = 1; iPlayerIndex <= gpGlobals->maxClients; iPlayerIndex++) |
Re: Let's kill the bots
Hmmmmm , OK I'll re-check the rest of of my code ..
but how do you explain the fact that , when I replace ClienKill() with ClientPutInserver() in the above Code that the Bot gets successfully respawned ? |
Re: Let's kill the bots
Assuming that current->pEdict points to an invalid Entity or to another player , how is it possible that this same "invalid" pointer is fed to pfnPlayerMove() and results in the bot jumping , moving , shooting around successfully ?
|
Re: Let's kill the bots
ClientPutInServer() must be called only one time for each bot. Now you have all the bot edicts sotred in bots[32] loop this array and do the job.
|
Re: Let's kill the bots
You didn't answer my last question!
|
Re: Let's kill the bots
Ok if you are 100% sure that your pointer is correct try to kill the bot in BotThink() fucntion. Btw I don't understand why you have this line:
Code:
if(current->pEdict->v.deadflag != DEAD_NO){ |
Re: Let's kill the bots
for a very simple reason!
I'm deliberatly running only ONE bot at the same Time!......so when the bot dies the next gets spawned......it's as easy as that. and about the number of bots (why do you have only 8 bots?) because I'm trying to keep the error margin as low as possible untill the current bot-kill dilemna is resolved!......(there is nothing more easier that replacing 7 with gpGlobals->maxClients .......) but anyways , I think I have discovered the bug :) ......and it's in one of those least expected places! it's somewhere ,Where I don't have access at all.......it's in the MOD to be precise! Yes , Yes:) I'm talking about Ricochet , Ricochet is the Sinner ........and if you want a very very clear proof without making any coding .....then just load Ricochet and type the "kill" command! and you will see that it does nothing (at least that happend for me) while all other mods responded as needed! so the conclusion is that : It's not my codes fault (I knew from the start that my lines are clear!) but because the ClientKill() function is disabled in the mod somehow for some reason... So the troublesome Question remains : How can I kill the bots in Ricochet??? |
Re: Let's kill the bots
If so try to set pEdict->v.health = 0; :)
|
Re: Let's kill the bots
WOOWOOWOO:clown:
I think.....I think it's working.....Yes:) Thaaanks Maaan! :thumbsup: Now that's what I was talking about! but there is a little problem , which is that there is no default death animation for such a case in this mod , so what happens now is a "half-death" in other words: the bot dies but the model stays visible and the deadflag doesn't change too(I'm changing it manually)! but this doesn't effect the game since the model becomes hallow and after the next respawn everything gets as it should.... P.S so what remains is a graphical bug , which I think can be solved by playing pfnRunPlayerMove another step.....I'll try that now. but thanks again! |
Re: Let's kill the bots
You must run RunPlaerMove() even if the bot is dead but if the animation is wrong again then get the HLSDK, the Ricochet source code is released, check there what code you must execute to make normal dead. :)
|
Re: Let's kill the bots
Hmmmm , not a bad Idea!
but I think I'm set for now (I'll check ricochet's source another time), since the bots are "dying" , we can close this discussion:P P.S ah maybe it would be better to make the models just disappear in this case , instead of editing ricochet's code to add a suitable animation! |
All times are GMT +2. The time now is 00:22. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.