Post: Bots spawning & kicking problems
11-06-2015, 05:11 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I'm having trouble with spawning and kicking bots.

If playing with bots by default:
- If I spawn a bot, he gets kicked again automatically
- If I kick bots, replacement bots join the match

If not playing with bots by default:
- Only one bot can be spawned at a time
- Kicking works like expected

    spawnBot()
{
maps/mp/bots/_bot::spawn_bot("autoassign");
}

kickAllBots()
{
foreach(player in level.players)
{
if(isBot(player))
{
kick(player getEntityNumber());
}
}
}

isBot(player)
{
isBot = player.pers["isBot"];

return isDefined(isBot) && isBot;
}
Does somebody have a fix for this so that bots can freely be spawned and kicked anywhere without problems?
(adsbygoogle = window.adsbygoogle || []).push({});
01-05-2016, 05:52 PM #11
BullyWiiPlaza
Climbing up the ladder
Originally posted by theboss2202 View Post
this is how i have it in my menu hope i could help add me on skype if you need more help jamie_thebiff2

It's not like you wrote the code but like what everyone copy and pastes which is utterly retarded. Anyway, thanks for offering your help though.
01-05-2016, 05:55 PM #12
theboss2202
Save Point
Originally posted by BullyWiiPlaza View Post
It's not like you wrote the code but like what everyone copy and pastes which is utterly retarded. Anyway, thanks for offering your help though.


really well if you think its c&p belive it ive made my own menu with help of the internet so dont be like that XD
01-05-2016, 06:00 PM #13
BullyWiiPlaza
Climbing up the ladder
Originally posted by theboss2202 View Post
really well if you think its c&p belive it ive made my own menu with help of the internet so dont be like that XD

If you knew how to code you would use loops or something Winky Winky
01-05-2016, 06:02 PM #14
theboss2202
Save Point
well im an amature i just thougt this would be the only way XD
01-05-2016, 08:40 PM #15
anthonything
Space Ninja
It is a Dvar in the bots.gsc that you must change, and when you spawn a bot, auto-assign him. The only way to get rid of the auto-spawned bots is by forcing the game to think that another real player joined in his place, by reducing the dvar. I dont remember the dvar, but i had that problem as well and traced the code. Just look through bots.gsc source and when you see the dvar you will know what im talking about,.

The following user thanked anthonything for this useful post:

BullyWiiPlaza
01-05-2016, 09:40 PM #16
BullyWiiPlaza
Climbing up the ladder
Originally posted by anthonything View Post
It is a Dvar in the bots.gsc that you must change, and when you spawn a bot, auto-assign him. The only way to get rid of the auto-spawned bots is by forcing the game to think that another real player joined in his place, by reducing the dvar. I dont remember the dvar, but i had that problem as well and traced the code. Just look through bots.gsc source and when you see the dvar you will know what im talking about,.

Ah, I'm catching on. The dvar
    bot_enemies

is being used to decide whether to continue executing code in the following if statement:
    if (level.rankedMatch && bot_enemies && 0 == isDedicatedBotSoak)

However, it needs to evaluate to false so that the next condition can evaluate to true:
    else if (level.rankedMatch)
{
return;
}

If init() returns early, the initialization of the bot reconnect function is skipped:
    bot_kick_think()
{
for (;Winky Winky
{
level waittill("bot_kicked", team);
level thread bot_reconnect_bot(team);
}
}

We need to execute something like the following in our patch therefore:
    fixCombatTrainingBots()
{
setDvar("bot_enemies", false);
level.rankedMatch = true;
}

This could be found in the maps\mp\bots\bot.gsc file like you indicated.

The following user thanked BullyWiiPlaza for this useful post:

DoraTheKiller97

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo