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?
Last edited by BullyWiiPlaza ; 11-06-2015 at 05:31 PM.
11-06-2015, 06:28 PM #2
-Numb
You talkin to me?
Originally posted by BullyWiiPlaza View Post
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?


Its the same for me, don't really think its a fix for it.
Also, if you are playing online and not in the local game thing you are allowed to spawn more than one bot.
11-06-2015, 09:58 PM #3
Procyon
Gym leader
If your game is set to have three bots it will always make it so there are three bots, so if you kick one, one more will spawn.
11-06-2015, 10:14 PM #4
BullyWiiPlaza
Climbing up the ladder
Originally posted by Procyon View Post
If your game is set to have three bots it will always make it so there are three bots, so if you kick one, one more will spawn.

This needs to be overridden/changed :P

I found a function in
    maps\mp\bots\_bots.gsc
which is probably guilty of the bot reconnects:

    bot_kick_think()
{
for ( ;; )
{
level waittill( "bot_kicked", team );
level thread bot_reconnect_bot( team );
}
}

Is there a good way of disabling it instead of e.g. recompiling the entire file and injecting it?
Last edited by BullyWiiPlaza ; 11-06-2015 at 10:23 PM.
11-06-2015, 10:23 PM #5
Originally posted by Numb View Post
Its the same for me, don't really think its a fix for it.
Also, if you are playing online and not in the local game thing you are allowed to spawn more than one bot.


If you are in a private match, start the game with no bots then add them in the game when it starts. I used to have that problem.
11-06-2015, 10:27 PM #6
BullyWiiPlaza
Climbing up the ladder
Originally posted by akaCuzi View Post
If you are in a private match, start the game with no bots then add them in the game when it starts. I used to have that problem.

I can only add one and not more...
11-06-2015, 10:30 PM #7
-Numb
You talkin to me?
Originally posted by akaCuzi View Post
If you are in a private match, start the game with no bots then add them in the game when it starts. I used to have that problem.

I know that :p
Originally posted by BullyWiiPlaza View Post
I can only add one and not more...

You are playing on local right? If you play online you can add more bots
11-06-2015, 10:57 PM #8
BullyWiiPlaza
Climbing up the ladder
Originally posted by Numb View Post
I know that :p

You are playing on local right? If you play online you can add more bots

Yeah but it should work on local, too. :/
11-06-2015, 11:36 PM #9
-Numb
You talkin to me?
Originally posted by BullyWiiPlaza View Post
Yeah but it should work on local, too. :/


Yeah it shoud, but it doesnt.. I have no idea why
01-05-2016, 05:37 PM #10
theboss2202
Save Point
Originally posted by BullyWiiPlaza View Post
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?

this is how i have it in my menu hope i could help add me on skype if you need more help jamie_thebiff2

    //spawn 1 bot
spawn1()
{
self thread Spawnbot();
self iprintln("^2Bot Spawned");
}
//spawn 3 bots
spawn3()
{
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
self iprintln("^2Bots Spawned");
}
//spawn max bots
spawn18()
{
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
wait .1;
self thread Spawnbot();
wait .1;
self thread SpawnBot();
wait .1;
self thread SpawnBot();
self iprintln("^2Bots Spawned");
}
//spawns bot
SpawnBot(team)
{
maps/mp/bots/_bot::spawn_bot(team);
}


and now here to add it in a menu
        self add_menu("Sub Menu 13", "Main Menu", "Co-Host");
self add_option("Sub Menu 13", "^1Spawn 1 Bot", ::spawn1);
self add_option("Sub Menu 13", "^2Spawn 3 Bots", ::spawn3);
self add_option("Sub Menu 13", "^3Spawn Max Bots", ::spawn1Cool Man (aka Tustin);

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo