Zombie Panic! Source

Zombie Panic! Source

Not enough ratings
Managing Multiple Builds of the Game
By NeoAssassin
This guide explains how to manage multiple builds of the game through Steam and SteamCMD.
   
Award
Favorite
Favorited
Unfavorite
How It Works
Managing multiple builds of a game can be time-consuming and very inconvenient - but it doesn't have to be that way.

You can remove the need to switch branches and re-download things every time you want to play a different version of the game by having several copies of the game and managing them with Steam and SteamCMD. This comes at the cost of disk space, but it saves you time and bandwidth - so you decide which methods best suite you.

You'll have one build of the game that will be installed via the Steam client, which is the one that's visible in your Steam Games Library, and is the one that the Steam client will automatically update. We'll refer to this build of the game as the "main build". You can only have one "main build" installed, all other builds of the game must be managed by using SteamCMD.

For convenience, you'll likely want your main build to be the one that updates the most frequently (unstable branch gets the most updates the public build gets the most updates). However, if you want your screenshots to be connected to the Zombie Panic! Source Community Hub Screenshots (so they're uploaded and viewable by users browsing there) - then you'll want your "main build" to be the build in which you're taking screenshots you want to upload there. You can still take and upload screenshots to Steam for the other builds of the game managed by SteamCMD, but I don't think these pictures will show up in the Zombie Panic! Source Community Hub Screenshots, they will be tagged as the name of the game in your Steam Library. However, you can also manually upload your screenshots to the Zombie Panic! Source Community Hub under the Artwork section, there is a button that says "Upload Your Artwork" toward the top of the page.

You can adapt this guide to any branch of the game that is available to you. At the time of creating this guide, I used the unstable branch as an example which is no longer available. So just replace unstable with whatever version of the game you're downloading.
SteamCMD
For the sake of keeping this guide short, I'm not going to go too in-depth about what SteamCMD is, how it works, or how to install it. Because this information is already available online, and you should be able learn how it works from Vavle's Dev Wiki - SteamCMD page.

SteamCMD is a program typically used to install and update dedicated servers, but we can also utilize it for the purpose of updating our extra builds of the game. We have to use SteamCMD to update these builds, because there is no direct link from the Steam client to these extra builds in order to enable the auto-update feature normally available to games installed through the Steam client. Only our main build, installed through the Steam client, will have the auto-update feature.


Follow the instructions on Downloading SteamCMD to install, and Running SteamCMD to update it.
Logging In
In order to use SteamCMD to download the ZPS files, you will have to be logged in with your Steam account. When you go to do this for the first time, it will give you an error saying;

This computer has not been authenticated for your account using Steam Guard.
Please check your email for the message from Steam and use the command 'set_steam_guard_code` to enter code here.
FAILED (Account Logon Denied)

You might not get to read this error when using the scripts we create below, because the command prompt window for SteamCMD will close before you get the chance to read it (due to some parts in the script). So if the download isn't working for you and you can't figure out why, this is probably the reason. Or you can always remove the "quit" and "@ShutdownOnFailedCommand 1" lines from the script so that you can read what the error is that's occurring.

So first start up steamcmd.exe and let it install its required files, then try logging in using the login command;
login username password

This will give you the error and Steam will send the authentication code to your email. Go check your email and get the code, then set the code using this command;
set_steam_guard_code CODEHERE

Then when you go to login again, it should work this time as long as you entered the Steam Guard Code and your password correctly.
Installing & Updating An Extra Build
After you've installed and updated SteamCMD and properly logged into your account on SteamCMD (set your authentication code), you're ready to download the extra build(s). Which we will semi-automate with scripts to make it easier to update whenever necessary.

For this, you'll navigate to your SteamCMD folder and create a new text document named appropriately for the build you're installing/updating (eg; "zps_public_update", or "zps_unstable_update"). Copy and paste the following code into the text document (and make the necessary adjustments explained below);


zps_unstable_update.txt
@ShutdownOnFailedCommand 1 @NoPromptForPassword 1 login username password force_install_dir "C:\Program Files (x86)\Steam\SteamApps\common\Zombie Panic Source Unstable" app_update 17500 -beta unstable quit

Command:
Explanation:
login
For the login, you'll need to change the username and password to the login details of your own account.

This is necessary, you cannot login as anonymous to download these updates - because otherwise it will not allow you to download the required executable file (zps.exe). (You can only download dedicated server files anonymously.)

I've read that using the same account that you're currently logged into could cause you to be logged out or something. So they suggest you use an alternate account as the login for your SteamCMD updates.
force_install_dir
The force_install_dir is the directory that this build of ZPS will be located, name the directory appropriately to the version of the game.

This directory should be located within your Steam installation directory if you want workshop to work with your game. If the build is installed anywhere outside of your Steam installation directory, then your game will not be able to detect any workshop items.
app_update
The app_update is where you specify the version of the game you wish to download.

All versions of the game will use the base depot - "17500", this is the current public version of the game.

But you can specify a specific branch to download in this field as well. Here's the app_update commands for all the different branches that are available.

app_update 17500 -beta unstable app_update 17500 -beta legacy2.4 app_update 17500 -beta v3.0.9a


In order to run the script we created above, you'll need to create a bat file that executes SteamCMD to use the script. Create a new text document in the same folder (SteamCMD folder) and name it appropriately to the build it's for (ie: "!_ZPS_Unstable_Update.bat"). Then open it up with a notepad program and add the following code, then save and close it;


!_ZPS_Unstable_Update.bat
@echo off steamcmd.exe +runscript zps_unstable_update.txt

Now you can just run this bat file to execute the script and automatically update the build. You can also create a shortcut to this on your desktop by right-clicking it and selecting "Send to -> Desktop (Create Shortcut)".
Validating an Extra Build
For validating your files, you simply just add the word "validate" to the end of the app_update line.

Validating works the same way as verifying game files, this means that any "user-made" changes like configurations are going to be overwritten and you will lose them unless you have a backup. Validating should only be used during the first install, or if you suspect the build is corrupt, or if certain files aren't updating or downloading.


So create your new text document for the script in the SteamCMD folder, and name it appropriately to the build of the game (ie: zps_public_validate.txt, or zps_unstable_validate.txt). Then open it with a notepad program and copy/paste the following code into that text document (and make the necessary adjustments);

zps_unstable_validate.txt
@ShutdownOnFailedCommand 1 @NoPromptForPassword 1 login username password force_install_dir "C:\Program Files (x86)\Steam\SteamApps\common\Zombie Panic Source Unstable" app_update 17500 -beta unstable validate quit


Then create your bat file in order to execute the script - create a new text document and name it appropriately to the build it's for (ie: "!_ZPS_Unstable_Validate.bat", or "!_ZPS_Public_Validate.bat"). Then open it with a notepad program and copy/paste the following code in (make any necessary adjustments to match the file name you created);


!_ZPS_Unstable_Validate.bat
@echo off steamcmd.exe +runscript zps_unstable_validate.txt

Now you can run this bat file whenever you need to validate your files.
Creating A Shortcut
The easiest way to create a shortcut to your extra build is to manually add it to your Steam Library.

To do this - open Steam and press the "ADD A GAME" button in the bottom left and select "Add a Non-Steam Game..", or go to the Games drop-down menu at the top and go to "Games - > Add a Non-Steam Game to My Library..."

From there - press the Browse button and navigate to the root folder of your extra build (ie: "C:\Program Files (x86)\Steam\SteamApps\common\Zombie Panic Source Public") and select "zps.exe". Then zps.exe should be listed and selected (checked) in the list, and you can press the "Add Selected Programs" button to add it to your Library.

You should then see it in your list named as "zps". Right-click it and select Properties, then you can name it appropriately to tell what it is (ie: "Zombie Panic! Source [Unstable]").

In order for the game to launch and function properly, you'll also have to set the launch options manually. To do this - right-click the build in your Steam Library and select Properties, then click the "Set Launch Options.." button. In the text box, insert the following text and then press the OK button;

-game zps -secure -steam

You'll need those launch options in order for the game to function properly. You can also set any other launch options you want, as listed and explained on the Steam Support Page - Setting Game Launch Options.

You can also add it to your favorite games by right-clicking the game in your Library and selecting "Add to Favorites".

Now you can play the extra build by selecting it in your Library and pressing "PLAY". Or you can create a desktop shortcut to use by right-clicking the game in your Library and selecting "Create Desktop Shortcut".