CoD2 is really sensitive with waittillframeend; when it comes to spawnplayer() function. Try adding waittillframeend; or just a plain wait .05 before doing anything with your bot (that includes setting the .pers["team"])
CoD2 is really sensitive with waittillframeend; when it comes to spawnplayer() function. Try adding waittillframeend; or just a plain wait .05 before doing anything with your bot (that includes setting the .pers["team"])
RobsoN (15th October 2013)
Thanks for the quick reply, I tried your ideas, but nothing has changed.
"Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right
Wow, really respect dude. It's working well now. Thank you so much!
"Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right
What about on map change?
I tried adding test clients using addTestClient() (which, I think, is a stock function). The bot connects, gets to the spectators team, has a 999 ping, no problem there, since I have the rest of the functions to spawn it and make it play the game.
On map change, they just have the connecting status (with -1 ping). I can kick them, but they won't join, and I can't access them (they are not included in the list of players anymore). Can I do something here to access them? I'm thinking about kicking and re-adding them on every map start if there's no better solution.
set logfile 2
Map change is done (in bot-mods without libcod) tis way:
- kick all player, but let them /reconnect automatically after a few seconds (execClientCommand()-hack)
- kill the server (removes the bots)
- retsart the server with your new map
- now the players start to reconnect
you can have a peek on cod2/cod4 bot mods for this
iirc here is likely a thread abut this already
guiismiti (21st March 2017)
Or use the kickbot libcod function?
Appending to serthys answer, write logPrint("QUIT"); and let B3 register this and send "quit" via rcon, while the server.sh start script is in an infinite loop.
But I don't know if that is what you want, guiismiti, since two years ago we had same topic (even started by you ).
http://killtube.org/showthread.php?1...Command-Adding!
http://killtube.org/showthread.php?1...ot-%28CoD-2%29
timescale 0.01
Yea, the kill method worked well.
Without libcod, I had to give a player rcon access to execute the kill.cfg (doesn't look exploitable).
Now I'm thinking about
- writing a file with the number of the name of the bots;
- changing the map without killing;
- kicking the spectator bots.
The advantage is, players won't need to reconnect.
set logfile 2
Kick bots before you change map so you still know which players are the bots.
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
I don't know what I missed last time I dealed with bots....
I just used the kick command while they were connected, and they got kicked successfully... I remember having a lot of trouble last time (over a year ago).
set logfile 2