Install Killing Floor 2 SDK
- Open Steam
- Click Library
- Click Tools - See Figure 2.1
- Install the Killing Floor 2 - SDK
- Keep in mind where this is installed to, we will be including the Scripts from this install
Creating New Sublime Project
- Click Project>Add Folder to Project
- See Figure 3.1
- Add Killing Floor 2 source Scripts
- Located in <Steam Install Location from previous step>\steamapps\common\killingfloor2\Development\Src
- Create a folder for your Mod
- Make a new directory called "Src" in <drive:>\Users\<user>\Documents\My Games\KillingFloor2\KFGame. This is specified in KFEditor.ini, [ModPackages], ModPackagesInPath
- Make a new directory for your mod in Src directory (e.g. KFGame\Src\MyMod)
- Make a "Classes" directory in your new mod directory (e.g. KFGame\Src\MyMod\Classes)
- Put your mod source files in Classes directory (e.g. KFGame\Src\MyMod\Classes\MyMod.uc)
- Add Folder To your project
Once this step is done, your folder structure should look something like this:
See Figure 3.2
- Save your Project - Do not forget this step other wise you will have to start over
Tip - Save all of your Sublime projects together in a SublimeProjects folder in My Documents
Include Your Package In KFEditor.ini
This step is very important, especially, if you are going to be using custom UDK files and/or other content.
KFEditor.ini is located at <Drive>:\Users\<User>\Documents\My Games\KillingFloor2\KFGame\Config
NOTE: User must have at least ran and closed the Editor to generate the KFEditor.ini file.
Creating an Example Mutator
This file will be for testing your compiler.
- Start a new script in Sublime with Ctrl-N
- Insert the Script from the Example
- Save the Script as KFMutator_Example.uc in - <Drive>:\Users\<User>\Documents\My Games\KillingFloor2\KFGame\Src\MyMod\Classes
NOTE: The Name of the file must match the name of the class.
Compiling via Command Console
a. Open the command prompt and navigate to your Steam Killing Floor 2 binaries directory (<drive:>\Steam\SteamApps\common\killingfloor2\Binaries\Win64)
- or, navigate to that directory in Windows Explorer, shift+right-click and select "open command window here"
b. Type "kfeditor make" and hit enter. The compiled .u file (e.g. MyMod.u) can then be found in your My Games directory (My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script)
Compile via Workshop Upload Tool
- Launch the Workshop Upload tool by double clicking the Killing Floor 2 - SDK in Steam. See Figure 7.1
- Click on the Maps/Mods tab
- Create new workshop item if you do not have an existing one for your current project
- Give the Item a name then click OK. See Figure 7.2
- Make sure that your item is selected in the left pane.
- Add your Script Source to compile See Figure 7.3
- If your mod is using custom packages Add them in the Packages to brew (in our case it is ExampleMeleeWeapon)
- Click the drop down on the Script button and click Compile scripts. See Figure 7.4
- The compiler will run and output the results the in console at the bottom of the window.
- This will create an "Unpublished" version of your mutator.
- This can be used for testing the mutator with the launch command line arguement -useunpublished. This will come later on in the tutorial
- Click the drop down on Brew and select Brew Packages to create a published version of the mutator. See Figure 7.5
- No addition command line arguments are need to run this other than running the mutator.
How to Run a mod / mutator
- If running with a GameInfo mod, add "?game=<packagename.scriptname>" to the command line (e.g. kf-burningparis?game=mymod.mygameinfo)
- If running with a Mutator mod, add "?mutator=<packagename.scriptname>" to the command line (e.g. kf-burningparis?mutator=mymod.mymutator). You can run with multiple mutators by separating them with commas (e.g. kf-burningparis?mutator=mymod.mymutator1,mymod.mymutator2)
Test To Verify The Mutator is Working
- Open the command prompt and navigate to your Steam Killing Floor 2 binaries directory (<drive:>\Steam\SteamApps\common\killingfloor2\Binaries\Win64)
- run the following command KFGame.exe KF-BioticsLab?mutator=MyMod.KFMutator_Example -log
- If your have not brewed your mod, remember to add the command -useunpublished
- This command can also be run through the console in game by pressing F3 or ` to open the console
- When the game launches, a window will appear containing your log.
- (An output of this log can be found in the folder: <drive:>\Users\<User>Documents\My Games\KillingFloor2\KFGame\Logs)
- In the log we should see the line This is my Example Mutator and Mutators MyMod.KFMutator_Example See Figure 8.1