Skip to content

Instantly share code, notes, and snippets.

@exp111
Last active May 18, 2023 13:56
Show Gist options
  • Save exp111/c10003cf63d1aa349ad6e4222cc5db49 to your computer and use it in GitHub Desktop.
Save exp111/c10003cf63d1aa349ad6e4222cc5db49 to your computer and use it in GitHub Desktop.
IW4x + Plutonium on Deck
//////////////////////////////////////////////////
// GENERAL CONFIGURATION //
//////////////////////////////////////////////////
//g_password "" // Require a password to join your server. (Use "password <yourpassword>" to set it on the client before connecting)
//sv_maxclients 18 // How many players can join your server. (1-18)
//scr_showperksonspawn 1 // Display currently equipped perks on HUD when spawning (1 = On, 0 = Off)
//scr_deleteexplosivesonspawn 1 // Remove thrown lethal explosives when killed (1 = On, 0 = Off)
//sv_minPing 0 // Minimum ping needed to the server? (NOT recommended to edit, terribly broken and inaccurate since ages!)
//sv_maxPing 400 // Maximum ping allowed to the server? (NOT recommended to edit, terribly broken and inaccurate since ages!)
//scr_disable_cac 1 // Disable Custom Classes?
//scr_max_rank 0 // Block every player with a level up this value
//scr_min_prestige 0 // Block every player with a prestige below this value
//sv_restrictionList "restricted.cfg" // Sets the file name for our restriction system.
//sv_enableItemRestriction 1 // Enables our custom restriction system.
//g_customteamnames "allies,Team 1|axis,Team 2" // Set custom team names on scoreboard.
sv_voice "2" // Allow Voice Chat (0 = Disable 1 = Everyone hears you. 2 = Teams only)
sv_voicequality "3" // Voice Chat Quality. (0-9) Default is 3 (= Steam/Console quality). Use 9 for the best quality.
sv_allowAimAssist 1 // Allow Aim Assist on gamepads. (0 = Will lock the option on gamepad controls menu.)
sv_allowDof 0 // Disallows the clients from having DoF to prevent a few DoF related glitches + gains a few frames. (0 = force off DoF on the clients, 1 = let the client decide)
demo_enabled 0 // Record matches as demo files? 1 = Enabled, 0 = Disabled (Very efficient <5MB per match for a full server)
sv_sayname "Console" // name server-side 'say' commands show up as
sv_patch_dsr50 true // Apply DSR-50 patches on this server? (true = stock game, false = pre-patch DSR-50)
//////////////////////////////////////////////////
//////////////////////////////////////////////////
// B3, IW4MADMIN, GAME LOG & RCON SETTINGS //
//////////////////////////////////////////////////
g_logSync 2 // 0 only flush on game end, 1 flush when buffer full, 2 always flush after a write, 3 append to old logs. (Keep this at 2 if you plan on using a 3rd party admin tool)
g_log "logs\games_mp.log" // IMPORTANT! Make sure the filename is unique for each server you clone!
rcon_password "" // RemoteCONtrol password. !!Do NOT skip if you plan on using a 3rd party admin tool such as B3 or IW4m-Admin!!
//////////////////////////////////////////////////
//Bots//
set bots_main "1"
set bots_manage_fill "10"
set bots_manage_fill_kick "1"
set bots_team_force "1"
set mv_enable 1 // Enable/Disable the mapvote
set mv_maps "" // Lits of maps that can be voted on the mapvote, leave empty for all maps
set mv_excludedmaps "" // Lis of maps you dont want to show in the mapvote
set mv_time 20 // Time to vote
set mv_credits 0 // Enable/Disable credits of the mod creator
set mv_socialname "" // Name of the server social such as Discord, Twitter, Website, etc
set mv_sentence "Thanks for playing" // Thankfull sentence
set mv_votecolor "5" // Color of the Vote Number
set mv_arrowcolor "white" // RGB Color of the arrows
set mv_selectcolor "lighgreen" // RGB Color when map get voted
set mv_backgroundcolor "grey" // RGB Color of map background
set mv_blur "3" // Blur effect power
set mv_gametypes "" // This dvar can be used to have multiple gametypes with different maps, with this dvar you can load gamemode
set mv_extramaps 1 // Enable 6 maps mapvote when set to 1
sv_maprotation "exec oic.cfg map mp_nuketown_2020"
// Congratulations. You reached the end of this file. Leave map_rotate down below or else the server will not start after launch...
map_rotate

IW4x

MW2

Downloaded game through steam Downloaded dlcs through xlabs discord (https://xlabs.dev/; there has been a new dlc pack since ~2022/23, so old ddl links are outdated). Alternatively just use the torrents if you have a vpn or a isp that doesn't send you nice letters.

IW4x

Download iw4x.dll from https://github.com/XLabsProject/iw4x-client/releases/latest
Put it next to the iw4mp.exe in the root mw2 folder
Download files from https://github.com/XLabsProject/iw4x-rawfiles/releases/latest
Put all files next to the iw4x.dll

You can now add a shortcut to steam, activate proton in game compatibility (i use proton 7.0-6) and play the game.

Bots

Download zip from https://github.com/XLabsProject/iw4x_bot_warfare/releases/latest
Follow the installation instructions there (extract the bots folder into mods)

Automatically configure bots

If you want to automatically start the game with bots and configure it you can add commandline arguments to the shortcut. I used these: +set fs_game "mods/bots" +set intro "0" +set sv_maxclients "10" +set party_maxplayers "10" +set sv_lanonly "1" +set sv_randomMapRotation "1" +set bots_main_chat "0" +set bots_manage_add "9" +set bots_skill_max "5" +set sv_maprotation "map mp_highrise map mp_terminal map mp_firingrange map mp_trailerpark map mp_boneyard map mp_quarry map mp_killhouse map mp_rundown map mp_rust_long map mp_nightshift map mp_afghan map mp_abandon map mp_estate_tropical map mp_crash_tropical map mp_bloc_sh map mp_checkpoint map mp_invasion map mp_storm_spring map mp_fav_tropical map mp_rust map mp_nuked map mp_shipment map mp_strike map mp_cargoship_sh map co_hunted map mp_underpass map oilrig map mp_cross_fire map mp_brecourt map mp_crash map mp_fuel2 map mp_cargoship map mp_vacant map mp_subbase map mp_storm map mp_complex map mp_favela map mp_shipment map mp_derail map mp_compact map mp_overgrown map mp_estate map mp_derail map mp_shipment_long"

Which cause:

  • fs_game: load the bots mod
  • intro: skip the intro
  • sv_maxclients/party_maxplayers: limit server to 10 players
  • sv_lanonly: games you host are lan
  • sv_mapRandomRotation: maps are selected randomly from sv_maprotation
  • bots_main_chat: disable bots shittalking in chat
  • bots_manage_add: add 9 bots to the game, you could probably also use bots_manage_fill
  • bots_skill_max: set the max bot skill, from 0-7

Plutonium T6

BO2

Download the game from steam Download the dlc from the plutonium discord or http://dlc-store.rf.gd/T6M.html. Yeah its http, but it just links to mega links.

Plutonium

Use the plutonium launcher or plutonium_dl.py to download the files. I extracted the files into <bo2>/plutonium, so i will explain with that setup.
In my testing i found that you need all files, even iw5 and t4/t5 ones or else you will get ERROR5487.

You can now start the game by running plutonium-bootstrapper-win32.exe t6mp <bo2_path> +name "Exp". However you can not play with bots on a private server, as you dont gain xp. Therefore we need to run our own server.

I used a weird technique where I created a batch file (start.bat), used BatToExe (downloaded from the link here https://www.reddit.com/r/SteamDeck/comments/uq2gve/how_to_steam_deck_use_alternative_simultaneous/) and then ran the exe as a shortcut with proton (currently using Proton Experimental; my start.bat HAS TO BE in the plutonium folder, else it will not work). This opens the game in lan mode and a lan server in the background.

You can change the server settings in the plutonium/storage/t6/dedicated.cfg.

One problem is that we need to manually type connect localhost:4976 everytime we join into the console. So i added the clip.exe from my windows installation (C:\Windows\System32\clip.exe) into the plutonium folder and set the string in the start.bat.
Then i can use steam input to: open the console with tilde ~, strg+v (using multiple commands) and then press enter.

Bots

Download https://github.com/ineedbots/pt6_bot_warfare (Code > Download zip) and follow the instructions to install. Then you can add the bot settings to the config like this:

set bots_main "1"
set bots_manage_fill "10"
set bots_manage_fill_kick "1"
set bots_team_force "1"

Which enables bots, sets them to maintain 10 players, kicks bots if a player joins and forces them on teams (had problems where the teams were unbalanced).

Mapvote

Problem is that you don't have random map rotation so i use this script: https://github.com/DoktorSAS/PlutoniumT6Mapvote
Download it and put the mp/mapvote.gsc into your scripts folders (instructions in mp/readme.txt).

To configure it i used these settings in the config:

set mv_enable           1                     // Enable/Disable the mapvote
set mv_maps             ""                    // Lits of maps that can be voted on the mapvote, leave empty for all maps
set mv_excludedmaps     ""                    // Lis of maps you dont want to show in the mapvote
set mv_time             20                    // Time to vote
set mv_credits          0                     // Enable/Disable credits of the mod creator
set mv_socialname       ""          // Name of the server social such as Discord, Twitter, Website, etc
set mv_sentence         "Thanks for playing"  // Thankfull sentence
set mv_votecolor        "5"                   // Color of the Vote Number
set mv_arrowcolor       "white"               // RGB Color of the arrows
set mv_selectcolor      "lighgreen"           // RGB Color when map get voted
set mv_backgroundcolor  "grey"                // RGB Color of map background
set mv_blur             "3"                   // Blur effect power
set mv_gametypes        "" // This dvar can be used to have multiple gametypes with different maps, with this dvar you can load gamemode
set mv_extramaps        1                     // Enable 6 maps mapvote when set to 1 

Primarily i cleared the mv_gametypes (explained later) and enabled mv_extramaps.

This allows us to choose maps (and gamemodes) at the end of each game. As the game starts always with the map specified in the config, i chose one in the chamber on nuketown for a quick "warmup".

The mv_gametypes variable is bugged so if we want random gamemodes we need to change those in the mapvote.gsc:
Search for SetDvarIfNotInizialized("mv_gametypes" and change the line to something like mine: SetDvarIfNotInizialized("mv_gametypes", "dm;dm.cfg conf;conf.cfg gun;gun.cfg sd;sd.cfg tdm;tdm.cfg oic;oic.cfg");

That allows the gamemodes free for all, kill confirmed, gungame, search & destroy, team deathmatch and one in the chamber to be randomly selected

import requests, json, os
prodURL = "https://cdn.plutonium.pw/updater/prod.json"
prodResult = requests.get(prodURL)
prod = json.loads(prodResult.text)
manifests = prod["manifests"]
manifestURL = manifests[0]
manifestResult = requests.get(manifestURL)
manifest = json.loads(manifestResult.text)
out = str(manifest["revision"]) + "/"
url = manifest["baseUrl"]
for entry in manifest["files"]:
print(entry)
result = requests.get(url + entry["hash"])
path = out + entry["name"]
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "wb") as f:
f.write(result.content)
@echo off
::Paste the server key from https://platform.plutonium.pw/serverkeys here
set key=placeServerKeyHere
::Name of the config file the server should use. (default: dedicated.cfg)
set cfg=dedicated.cfg
::Name of the server shown in the title of the cmd window. This will NOT bet shown ingame.
set name=TDM 1
::Port used by the server (default: 4976)
set port=4976
::Only change this when you don't want to keep the bat files in the game folder. MOST WON'T NEED TO EDIT THIS!
set gamepath="E:\steamapps\common\Call of Duty Black Ops II"
echo connect localhost:%port%|clip
start bin\plutonium-bootstrapper-win32.exe t6mp %gamepath% -dedicated -lan +sv_config %cfg% +net_port %port%
start bin\plutonium-bootstrapper-win32.exe t6mp %gamepath% +name "Exp" -lan
#!/bin/bash
#TODO: get path dynamically?
path="/run/media/mmcblk0p1/steamapps/common/Call of Duty Modern Warfare 2"
# download iw4x.dll
echo "Downloading iw4x.dll"
wget -q --show-progress -O "$path/iw4x.dll" https://github.com/XLabsProject/iw4x-client/releases/latest/download/iw4x.dll
# download client files
echo "Downloading IW4x client files"
wget -q --show-progress -O "$path/release.zip" https://github.com/XLabsProject/iw4x-rawfiles/releases/latest/download/release.zip
echo "Extracting..."
unzip -o -d "$path" "$path/release.zip"
rm "$path/release.zip"
# download bot mods
echo "Download bots mod"
meta=$(curl -fSs "https://api.github.com/repos/XLabsProject/iw4x_bot_warfare/releases")
url=$(echo $meta | jq -r '.[0].assets[] | select(.name|test(".*.zip")).browser_download_url')
echo $url
wget -q --show-progress -O "$path/bots.zip" "$url"
# only extract files from folder
echo "Extracting..."
folder="Move files to root of IW4x folder"
unzip -o -d "$path" "$path/bots.zip" "$folder/*"
rsync -a "$path/$folder/" "$path"
rm -r "$path/$folder/" # delete folder
rm "$path/bots.zip" # delete zip
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment