ineedbots / iw5_bot_warfare

The Bot Warfare mod for MW3
https://www.moddb.com/mods/bot-warfare
107 stars 29 forks source link

Is there a way to save settings? #68

Closed GhendraNova closed 10 months ago

GhendraNova commented 2 years ago

Hi,

Inputting commands in all the times i launch the game can be quite irritating. I was wondering if there was a simpler way to save stuff and make them auto-load when we boot it up.

phase19 commented 2 years ago

To auto-add bots every time you start a private match after launching the game open your C:\Users\<username>\AppData\Local\Plutonium\storage\iw5\mods\bots\z_svr_bots.iwd file using 7-zip and open the \maps\mp\bots\_bot.gsc file inside the archive and edit the following code as desired. I would highly recommend to install Notepad++ to edit the file although not necessary. Don't forget to 'Save' after editing the file.

    if ( getDvar( "bots_manage_add" ) == "" )
        setDvar( "bots_manage_add", 11 ); //amount of bots to add to the game

This would add 6 bots to the enemy team and 5 to your team to make a total of 12 including you, 6 per side.

I have created startgame.bat file inside my Plutonium IW5x folder with the following to auto-login into Plutonium.

@echo off

set gamepath=%cd%

cd /D %LOCALAPPDATA%\Plutonium

start /wait /abovenormal bin\plutonium-bootstrapper-win32.exe iw5mp %gamepath% -lan +name <username>

Replace with your own username on Plutonium.

GhendraNova commented 2 years ago

Thanks a lot for the answer and small thingy ! I'm sure it will come in handy and i'll keep it so i can test it out.

Unfortunately, this wasn't quite what i had in mind. I'm mostly just saving around settings like

"bots_loadout_rank 0

bots_loadout_prestige -2"

Or other kind of settings which are not all purely visual, and i was wondering if that could be saved and auto-loaded every time i launch the game.

Resxt commented 2 years ago

@GhendraNova I'm late to this but yes you can do that, just like with any script/mod that uses dvars you can simply create a script that sets dvars on launch

Create a script in %localappdata%\Plutonium\storage\iw5\scripts called whatever you want, for example bot_warfare_dvars. Make sure it's saved with the .gsc extension and is actually a GSC file. Then open it with the notepad or any text editor and paste this. You can then copy/paste this line and edit it to your liking. First param is the dvar name, second is the value.

Init()
{
    SetDvar("bots_main_chat", 0);
}
GhendraNova commented 2 years ago

@Resxt Thank you tons, now i only have to run the "set fs_game mods/bots" command as everything else is set by default, it really helps me by taking much less time to set it up !

Resxt commented 1 year ago

@Resxt Thank you tons, now i only have to run the "set fs_game mods/bots" command as everything else is set by default, it really helps me by taking much less time to set it up !

I'm late again but I'm pretty sure you can do the same for mods. SetDvar("fs_game", "mods/bots"); Also Bot Warfare works as a .iwd file too which can be placed at the root of the iw5 storage folder, it doesn't need to be loaded as a mod. Loading it this way would always load it when you start your game, without needing to do any extra action and would also allow you to use another mod on top of Bot Warfare

EricTurner3 commented 1 year ago

If you are running a dedicated server, you can also put the commands inside your server.cfg file. I have it near the end of the file, before the set sv_maprotation:

set bots_manage_add "14" set bots_manage_fill "14" set bots_manage_fill_kick "1" set bots_manage_fill_spec "0" set bots_manage_fill_mode "1" set bots_team_force "1" set bots_team_mode "0" set bots_team "autoassign" set bots_main_waitforhosttime "10" set bots_loadout_allow_op "0" set bots_main_menu "1" set bots_main_chat 1.0 set bots_main_debug "true" set bots_main_GUIDs "" set bots_loadout_prestige "-2" set bots_skill "8" set bots_skill_axis_med "3"