Jump to content
  • How to Setup Unrealscript Environment(UE3)

    Obtain IDE (Sublime Text 3)

    • Sublime Text 3
      • Install UnrealScript IDE plugin
        1. Open Sublime Text 3
        2. Press Ctrl + Shift + P
        3. Type "install" (this should select "Package Controll: Install Package"), hit enter
        4. Search for "UnrealScriptIDE", hit enter.
    • Other choices

    Install SDK

    1. Open Steam 
    2. Click Library 
    3. Click Tools - See Figure 2.1
    4. Install the Killing Floor 2 - SDK / Rising Storm 2 - SDK
      • Keep in mind where this is installed to, we will be including the Scripts from this install

    Figure 2.1

    Figure 2.1


    Creating New Sublime Project

    1.  Click Project>Add Folder to Project
      • See Figure 3.1
    2. Add Killing Floor 2 source Scripts
      • Located in <Steam Install Location from previous step>\steamapps\common\killingfloor2\Development\Src
    3. Create a folder for your Mod
      1. Make a new directory called "Src" in <drive:>\Users\<user>\Documents\My Games\KillingFloor2\KFGame. This is specified in KFEditor.ini, [ModPackages], ModPackagesInPath
      2.  Make a new directory for your mod in Src directory (e.g. KFGame\Src\MyMod)
      3. Make a "Classes" directory in your new mod directory (e.g. KFGame\Src\MyMod\Classes)
      4. Put your mod source files in Classes directory (e.g. KFGame\Src\MyMod\Classes\MyMod.uc)
    4. Add Folder To your project
      1. Once this step is done, your folder structure should look something like this:

      • See Figure 3.2

    5. Save your Project - Do not forget this step other wise you will have to start over 
      1. Tip - Save all of your Sublime projects together in a SublimeProjects folder in My Documents

    Figure 3.1

    Figure 3.1

    image2017-4-17_17-25-58.png

    Figure 3.2


    Include Your Package In KFEditor.ini / ROEditor.ini (adjust as needed for RS2V)

    This step is very important, especially, if you are going to be using custom UDK files and/or other content.

    NOTE: User must have at least ran and closed the Editor to generate the KFEditor.ini / ROEditor.ini file.

    KFEditor.ini is located at <Drive>:\Users\<User>\Documents\My Games\KillingFloor2\KFGame\Config
    ROEditor.ini is located at <Drive>:\Users\<User>\Documents\My Games\Rising Storm 2\ROGame\Config

    In KFEditor.ini:

    [ModPackages]
    ModPackagesInPath=..\..\KFGame\Src
    ModOutputDir=..\..\KFGame\Unpublished\BrewedPC\Script
    ModPackages=MyMod

    For ROEditor.ini

    [ModPackages]
    ModPackagesInPath=..\..\ROGame\Src
    ModOutputDir=..\..\ROGame\Unpublished\BrewedPC\Script
    ModPackages=MyMod

    Creating an Example Mutator

    This file will be for testing your compiler.

    1. Start a new script in Sublime with Ctrl-N
    2. Insert the Script from the Example 
    3. 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.

    KFMuatator_Example.uc
    
    //=============================================================================
    // KFMutator
    //=============================================================================
    // Example mutator class for KF2
    //=============================================================================
    class KFMutator_Example extends KFMutator;
    /**
    * This function can be used to parse the command line parameters when a server
    * starts up
    */
    function InitMutator(string Options, out string ErrorMessage)
    {
    super.InitMutator( Options, ErrorMessage );
    `log("This is my Example Mutator");
    }
    

    Compiling via Command Console

    1. Open the command prompt and navigate to your Steam Killing Floor 2 binaries directory (<drive:>\Steam\SteamApps\common\killingfloor2\Binaries\Win64)
      1. - or, navigate to that directory in Windows Explorer, shift+right-click and select "open command window here"
    2. 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)

    Code.png

    Figure 6.1

    Compile via Workshop Upload Tool

    1. Launch the Workshop Upload tool by double clicking the Killing Floor 2 - SDK in Steam.  See Figure 7.1
    2. Click on the Maps/Mods tab
    3. Create new workshop item if you do not have an existing one for your current project
    4. Give the Item a name then click OK. See Figure 7.2
    5. Make sure that your item is selected in the left pane.
    6. Add your Script Source to compile See Figure 7.3
    7. If your mod is using custom packages Add them in the Packages to brew (in our case it is ExampleMeleeWeapon)
    8. Click the drop down on the Script button and click Compile scripts.  See Figure 7.4
    9. The compiler will run and output the results the in console at the bottom of the window.
    10. 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
    11. 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.
    Quote

    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)

    image2017-4-18_11-57-52.png

     

    Figure 7.1

    image2017-4-18_12-0-25.png

    Figure 7.2

    image2017-4-18_12-56-46.png

    Figure 7.3

    image2017-4-18_13-2-21.png

    Figure 7.4

    image2017-4-18_13-9-57.png

    Figure 7.4


    Test To Verify The Mutator is Working

    1. Open the command prompt and navigate to your Steam Killing Floor 2 binaries directory (<drive:>\Steam\SteamApps\common\killingfloor2\Binaries\Win64)
    2. run the following command KFGame.exe KF-BioticsLab?mutator=MyMod.KFMutator_Example -log
      1. If your have not brewed your mod, remember to add the command  -useunpublished 
      2. This command can also be run through the console in game by pressing F3 or ` to open the console 
    3. When the game launches, a window will appear containing your log. 
      1. (An output of this log can be found in the folder: <drive:>\Users\<User>Documents\My Games\KillingFloor2\KFGame\Logs)
    4. In the log we should see the line This is my Example Mutator and Mutators MyMod.KFMutator_Example See Figure 8.1

    image2017-4-19_11-25-26.png

    Figure 8.1


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy | Terms of Use