Hey, thanks for the reply. Sorry for the long post here (skip to end for the answer)...
If you edit aidefault.ai then dont touch bot settings in server setup screen or it will get overwritten. It works for me but if you want to have 64 bots on one side that will not work.
OK. I don't generally touch the in-game controls if I have overrideMenuSettings 1 set. I'd normally just select map, add it, then deploy, expecting the override in aidefault.ai to set the botcount/ratio/etc.
sv.maxPlayers and sv.CoopBotCount are not dependent on each other. You can set 16 slots for players and still have 64 bots in game.
Hmm, I didn't know that. But, on reading that, I tried setting...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\0002\ServerSettings.con
Code: Select all
GameServerSettings.setMaxPlayers 4
GameServerSettings.setCoopBotCount 64
and...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\Default\ServerSettings.con
Code: Select all
sv.maxPlayers 4
sv.coopBotCount 64
...and it gave me a total of 3 bots plus me in game. It also rewrote those two configs of its own accord to...
Code: Select all
GameServerSettings.setCoopBotCount 48
and...
...which just messes with my head.
So, I changed it to the following...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\0002\ServerSettings.con
Code: Select all
GameServerSettings.setMaxPlayers 4
GameServerSettings.setCoopBotCount 64
and...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\Default\ServerSettings.con
Code: Select all
sv.maxPlayers 128
sv.coopBotCount 64
...and again, it gave me 3 bots plus me. It also rewrote the configs as before to sv.coopBotCount 48 and GameServerSettings.setCoopBotCount 48.
...
So, let's try something else. If I set the following...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\0002\ServerSettings.con
Code: Select all
GameServerSettings.setMaxPlayers 128
GameServerSettings.setCoopBotCount 64
and...
%USERPROFILE%\My Documents\Battlefield 2\Profiles\Default\ServerSettings.con
Code: Select all
sv.maxPlayers 128
sv.coopBotCount 64
...it results in 32 players; me + 31 bots.
...
I just don't get it. Something seems broken somewhere, or I'm missing something. I don't understand why the in-game menu changes of its own accord between the slider indicating "32" max players set or "48" based on the various combinations of configuration (which seems to determine what the configs are rewrote to), though no matter what I do I'm not able to spawn more than 32 bots.
Note the lines with rem in front on the end of aidefault.ai file. Remove rem in front of them to activate override feature. Read the explanation in file its quite good explained.
Yeah, I've checked and double-checked that. It should be fine, but I'll post it verbatim...
Code: Select all
rem *** PRSP Ai v5 ***
echo **************************************************************************
echo ********************PROJECT****REALITY****AI****LOADED********************
echo **************************************************************************
aiSettings.setNSides 2
aiSettings.setAutoSpawnBots 1
rem aiSettings.setMaxNBots 64
rem aiSettings.maxBotsIncludeHumans 1
rem aiSettings.setBotSkill 0.4
rem To override the amount of bots used in PRSP, use the following lines instead of the three lines above.
rem This will render the ingame menu and serversettings.con bot settings not used, as the following lines
rem of code overrides those settings.
rem Just remove the "rem" in front of the lines to make it read by the game, then edit the numbers as needed.
aiSettings.overrideMenuSettings 1
aiSettings.setMaxNBots 64
aiSettings.maxBotsIncludeHumans 1
aiSettings.setBotSkill 1.0
run BotNames.ai
aiSettings.setInformationGridDimension 48
rem aiDebug.draw 1
run AIPathFinding.ai
Hmm, maybe if I try...
\mods\pr\ai\aidefault.ai
Code: Select all
aiSettings.overrideMenuSettings 1
aiSettings.setMaxNBots 64
aiSettings.maxBotsIncludeHumans 0 [color=red]<------------------- instead of 1[/color]
aiSettings.setBotSkill 0.9
%USERPROFILE%\My Documents\Battlefield 2\Profiles\0002\ServerSettings.con
Code: Select all
GameServerSettings.setMaxPlayers 128
GameServerSettings.setCoopBotCount 64
%USERPROFILE%\My Documents\Battlefield 2\Profiles\Default\ServerSettings.con
Code: Select all
sv.maxPlayers 128
sv.coopBotCount 64
OK! Now I've 64 bots + me. So it's looking like the problem was the maxBotsIncludeHumans value I'd set. When I originally edited the aidefault.ai file I changed it to "1" thinking that it'd result in me + 63 bots on a 64-player server config. I still don't understand how it arrived at the above "32" and "48" config rewrite business though, but oh well, at least things are working now.
Thanks for the prod, it got me there in the end.
