• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Requesting starting help on making mutators

xmrmeow

Grizzled Veteran
  • Mar 23, 2015
    1,009
    11
    I don't think there are any tools for making this by tripwire yet right? I'd like to make a rebalance mutator while waiting for tripwire to balance the game since they don't seem to want to make very many changes very often due to having to update like 200 servers for every time something changes. All I wanna do is change a couple numbers around and maybe modify some perk code, but I'm not sure where I would be able to do that.

    Stuff I'd like to change includes explosive resistance of FP and hans, reduce/increase damage and knockdown chance on a couple weapons, remove damage reduction on consecutive explosives, nerf medic and buff syringe to reduce team reliance on constant hp and armor heals, make all scrakes attacks cancelable by parry but increase his damage to force berserker to rely on parrying but still be balanced if you're good, replace armor healing perks on medic with temp damage resist instead, let support weld armor (you wont have time to do it in combat most of the time anyway) and add a right click function to the welder for support that lets him weld himself.

    But unless I can access code for the perks, zed classes, weapon classes, etc, i dont think these changes would be very easy/possible.
     
    Upvote 0
    ok so ive been sifting through the code for quite some time now; can't find where FP damage calculation is yet(damage that the fleshpound takes that is) but I found how to reduce the consecutive c4 damage. When I change one of these files is there a simple way of getting this to override it like putting it in a mutators folder? or do i need to swap out the files because i dont see any of these files in my KF folder, just the dev folder which i assume isnt the code thats run; its just there for editing purposes right?
     
    Upvote 0
    found the damage type vulnerability for fleshpound(should apply to other classes if other people want to make certain zeds vulnerable to certain weapons such as flame weaps doing more damage to small zeds or something idk whatever you want)

    These are found in KFPawn_ZedName.uc (example KFPawn_ZedFleshpound.uc)

    stilll need to know how to apply these to a game :/
     
    Upvote 0
    You can't override the files, you have to make a mutator for things like that.

    So you have to make a new class that extends from KFMutator.
    There are some functions that can be used to change how things should behave.

    like PostBeginPlay, CheckReplacement, ModifyPlayer...

    For you something like that could work.
    Code:
    class MyMutator extends KFMutator;
    
    function ModifyAI(Pawn AIPawn) {
      if(KFPawn_ZedFleshpound(AIPawn)!=None) {
        KFPawn_Monster(AIPawn).VulnerableDamageTypes.Add((DamageType=class'KFDT_Fire',DamageScale=1.5));
      }
    }
    after writing your mutator you have to compile and brew it
     
    Upvote 0
    cant I just make one line of code saying KFPawn_ZedFleshpound.VulnerableDamageTypes.Add(DamageType=class'KFDT_Explosive',DamageScale=2.5)
    instead of making a specific function. I feel like yours would check each pawn for being a fleshpound and modify them individually instead of just modifying the fleshpound pawn class to have all of them have the vulnerability by default.
     
    Upvote 0
    Ok so extending multiple classes at once isn't gunna work for UnrealScript. Anyone know how I can make my mutator be able to access variables from a variety of different classes?

    Also I noticed VulnerableDamageType is the only thing that changes how much damage a zed takes from a specific weapon type. Is there any way I can make a zed take bonus damage from a specific weapon type in only specific spots?

    Examples:
    say I want to make the husk take bonus explosive to direct hits to the backpack.
    say I want to make scrake take bonus headshot damage from assault rifles
     
    Last edited:
    Upvote 0
    Ok so extending multiple classes at once isn't gunna work for UnrealScript. Anyone know how I can make my mutator be able to access variables from a variety of different classes?

    Not sure what you are trying to do? You can access var classes using class'classname'.default.var

    As for damages, likely have to make a new zed and modify how it takes damage
     
    Last edited:
    Upvote 0
    ok i figured out how to change whatever you want;

    https://tripwireinteractive.atlassian.net/wiki/display/KF2SW/KF2+Code+Modding+How-to refer to this along the way

    (these steps assume you have the updated KF2 SDK)

    Step 1:
    Find any .uc file in the Killingfloor2/Development/Src folder and change it to your liking (most things you'd want to change are in KFGameContent; files for weapons are named KFWeap_Anyweapon and their damage is marked by the variable InstantHitDamage)

    Step 2:
    a. go to your "Documents/My Games/KillingFloor2/KFGame" folder and make a folder in that called Src
    b. in that src folder, make a folder named the SAME NAME as the folder that you got the existing KF2 class out of(KFGameContent if you used a file from that)
    c. in that KFGameContent folder or other, make a folder called Classes
    d. put your edited .uc file there

    Step 3:
    In the Documents/My Games/KillingFloor2/KFGame folder, there is a folder called Config; go in that and open KFEditor.ini with notepad or whatever other text editor you want.
    Near the bottom you should see [ModPackages] and some stuff below it. anywhere under [ModPackages] but before the next thing in square brackets, add ModPackages=KFGameContent on a new line (or whatever other package you're editing of course).

    Step 4:
    go into your steam/steamapps/common/killingfloor2/binaries/win64 folder, shift-rightclick and select open command window here.
    type kfeditor make
    **For me it puts the new file it generates for that in the wrong folder so check your Documents/My Games/KillingFloor2/KFGame/Unpublished folder and if you see another unpublished folder in that, just keep opening it until you get to your KFGameContent.u file and copy it, the paste it into your Documents/My Games/KillingFloor2/KFGame/Unpublished/BrewedPC/Script folder (if you dont see the script folder make it yourself and paste it inside)

    Step 5: Assuming you did everything right, you shouldn't really need to test it so I'd just brew it. To do that type in the command prompt (reopen it the same way as before if you closed it)
    kfeditor brewcontent -platform=PC KFGameContent (or whatever else you changed)

    Step 6: run it in game. To do this you don't just run the game, you must either type this on the command prompt, or make a .bat file to do it for you (id recommend this because it's faster than typing this every time you want to launch the game with your mutators).

    kfeditor kf-burningparis?mutator=KFGameContent.Whatever .uc file you changed's name is

    example: kfeditor kf-burningparis?mutator=KFGameContent.KFWeap_Pistol_9mm

    to do this using a .bat file, make a text file in your steam/steamapps/common/killingfloor2/binaries/win64 folder, name it whatever you want, save it as a .bat file, then put the same text in that as you would type in the command prompt.

    Enjoy :)
     
    Upvote 0
    If you get an error "Error, BEGIN OBJECT: name Whatever redefined" rename the object name

    Example:

    Begin Object Class=Whatever Name=Whatever
    End Object

    FIX:

    Begin Object Class=Whatever Name=Whatever1
    End Object

    DO NOT CHANGE WHAT'S AFTER THE FIRST EQUALS SIGN, ONLY THE SECOND otherwise it will also prob cause an error.
     
    Upvote 0
    ok uh
    NOTE if you make a mod by using the method i listed and use it, you will not be able to join any servers that do not have the mutator. You must move the file out of your MyGames/KillingFloor2/KFGame/Published folder to turn it off, and back into that folder to turn it back on, then you should be able to join servers normally. As long as your mod is in the published folder it should be active in game regardless of whether you boot using a .bat to launch the game through kfeditor or if you just open it from your steam library.
     
    Last edited:
    Upvote 0