Killing Floor

Killing Floor

58 ratings
How to setup a custom weapon layout
By dkanus and 1 collaborators
In this guide I'd like to describe a way to setup a custom weapon layout, that involves modification of User.ini (Steam - Library - RMB - Properties - Local files - Browse local files - System - User.ini). By a weapon layout I mean keyboard and mouse bindings to weapons.
This setup will function somewhat differently from a default weapon selection system. For example, it can't provide you with a proper cycling through groups of weapons and won't let you choose weapons without ammo. But there's a way to switch back to the default layout on the fly.
   
Award
Favorite
Favorited
Unfavorite
Choosing weapon with a hotkey
The most basic thing we can do is to use GetWeapon command. It makes player wield a weapon, given to it as a parameter (only if there's ammo for it). With that you can assign certain weapons to the keyboard keys. To do so you need to find [Engine.Input] section in User.ini. It contains lines like these:
E=Use F=ToggleFlashlight G=ThrowNade
General form of each line is <key>=<command>. So if you want to set a certain command to a certain key you must find key's name and enter command after equals sign '=' to it's right.
For example,
6=GetWeapon PipeBombExplosive
will assign pipe bombs to the keyboard key '6'. You can view list of all in-game weapon' names in 'KillingFloor\System\KFMod.ucl' or in tables I prepared at the end of this guide
Binding several weapons to a hotkey
Described method allows us to bind any weapon to any key, but, for obvious reasons, you can assign hotkeys only to a very limited amount of weapons that way. We can improve on that through command chaining.
You can assign to a hotkey a series of commands that will be executed one after another. If you do it like that: <key>=<command1> | <command2> | ... | <commandN>, then <command1> will be executed first, <command2> next and then process will continue in order until <commandN>, that will be executed at the very end.
How can we use this? Suppose that when you play as a support you want to have AA12 on the button '3' and when you play as a demo you'd like to have there a harpoon. Then you do the following:
3=GetWeapon AA12AutoShotgun | GetWeapon SealSquealHarpoonBomber
If you happen to play as demo with harpoon, then last executed command GetWeapon SealSquealHarpoonBomber will make your character wield harpoon. But, if you're playing as a support, you probably won't have a harpoon in your loadout and last command will do nothing. Therefore only first command will take effect and your character will wield AA12.
Basically, pressing hotkey will choose the latest weapon in the chain, that you also have in your inventory and that still got ammo. Clever usage of that may allow you to assign different weapon to a key for each loadout. These are chains I use for support, firebug, demo and sharpshooter:
3=GetWeapon NailGun | GetWeapon SPAutoShotgun | GetWeapon Shotgun | GetWeapon CamoShotgun | GetWeapon KSGShotgun | GetWeapon BenelliShotgun | GetWeapon GoldenBenelliShotgun | GetWeapon AA12AutoShotgun | GetWeapon GoldenAA12AutoShotgun | GetWeapon Winchester | GetWeapon MAC10MP | GetWeapon SealSquealHarpoonBomber 4=GetWeapon BoomStick | GetWeapon SPSniperRifle | GetWeapon FlameThrower | GetWeapon GoldenFlamethrower | GetWeapon TrenchGun | GetWeapon Huskgun | GetWeapon M32GrenadeLauncher | GetWeapon CamoM32GrenadeLauncher
For demo it moves harpoon to key '3', making it much more convenient to use with M32 and pipes (pipes bound to '6'). For sharpshooter it allows to have LAR and musket on different keys, should I choose to use both of them. For support it allows to always have key '4' reserved for hunting shotgun and '3' for any another shotgun. And if you change '6' binding to
6=GetWeapon M79GrenadeLauncher | GetWeapon GoldenM79GrenadeLauncher | GetWeapon SPGrenadeLauncher | GetWeapon PipeBombExplosive
you can also easily switch to a grenade launcher and avoid situations where you choose it instead of a shotgun.
Switching layouts on the fly
You can just assign these chain on keys like '6', '7', '8', etc. But, once again, we can do better. I, personally, want them on standard keys '1', '2', '3', '4'. And for that we will now learn how to change what chain bound to what key and how to return default behavior during the game.
For that we will need to use aliases. Aliases allow us to give names to our chains of commands and invoke them by using that name. Syntax to define one is
(Command="<series of commands>",Alias="<name>")
To use alias you must assign it to one of the slots in User.ini file. There's a bunch of them that look like that:
Aliases[<alias_number>]=<alias>
And that's where the problems begin. You can't just add a new slot with new number, game only seems to notice first 40 of them, starting from number 0. And they're all used for something. So we must free them. How do you do that? Have a look at the very first alias definition:
Aliases[ 0]=(Command="Button bFire | Fire",Alias="Fire")
After that, whenever command Fire is used, a chain "Button bFire | Fire" is invoked (looks like Fire in the chain doesn't invoke alias, but some other command). So, if we want to change this alias, we must replace word Fire with "Button bFire | Fire" everywhere in the User.ini.
Now be warned. If you do this, then assigning primary fire to keyboard or mouse keys through the means of game input configuration won't do what it should. Because it would assign to these keys alias Fire, which no longer exists. Therefore if, after that change, you decide to assing primary fire to some key, you'd have to do this manually and assign "Button bFire | Fire". If you removed another alias and forgot what chain of command did it represent you can check it at defuser.ini (BUT DO NOT CHANGE THAT FILE).
If you don't want to mess with game too much, there's a bunch of aliases you probably won't need:
Aliases[15]=(Command="Axis aLookUp Speed=+25.0",Alias="LookUp") Aliases[16]=(Command="Axis aLookUp Speed=-25.0",Alias="LookDown") Aliases[17]=(Command="Button bSnapLevel",Alias="CenterView") Aliases[21]=(Command="Button bFreeLook",Alias="FreeLook") Aliases[22]=(Command="ViewClass Pawn",Alias="ViewTeam") Aliases[23]=(Command="Button bTurnToNearest",Alias="TurnToNearest") Aliases[26]=(Command="InGameChat",Alias="InGameChat") Aliases[27]=(Command="ServerInfo",Alias="ServerInfo") Aliases[29]=(Command="Speak Team|Button bVoiceTalk|OnRelease SpeakLast",Alias="ToggleTeamChat") Aliases[30]=(Command="Speak Local|Button bVoiceTalk|OnRelease SpeakLast",Alias="ToggleLocalChat") Aliases[31]=(Command="Speak Public|Button bVoiceTalk|OnRelease SpeakLast",Alias="TogglePublicChat") Aliases[32]=(Command="Axis aBaseX SpeedBase=100.0 DeadZone=0.1",Alias="SpaceFighter_JoyX") Aliases[33]=(Command="Axis aLookUp SpeedBase=100.0 DeadZone=0.1",Alias="SpaceFighter_JoyY") Aliases[34]=(Command="Axis aUp Speed=+300.0 | Axis aStrafe SpeedBase=300.0 DeadZone=0.1",Alias="SpaceFighter_JoyV") Aliases[35]=(Command="Axis aBaseY SpeedBase=300.0 DeadZone=0.1 Invert=-1",Alias="SpaceFighter_JoySlider1")
Now, if you wanna mess with it all the way, you can use this file[pastebin.com] I prepared, where I wiped every alias from 0 to 39, so that you can easily use them.
To put aliases to use we first need to assign them to our chains:
Aliases[ 0]=(Command="GetWeapon NailGun | GetWeapon SPAutoShotgun | GetWeapon Shotgun | GetWeapon CamoShotgun | GetWeapon KSGShotgun | GetWeapon BenelliShotgun | GetWeapon GoldenBenelliShotgun | GetWeapon AA12AutoShotgun | GetWeapon GoldenAA12AutoShotgun | GetWeapon Winchester | GetWeapon MAC10MP | GetWeapon SealSquealHarpoonBomber",Alias="guns") Aliases[1]=(Command="GetWeapon BoomStick | GetWeapon SPSniperRifle | GetWeapon FlameThrower | GetWeapon GoldenFlamethrower | GetWeapon TrenchGun | GetWeapon Huskgun | GetWeapon M32GrenadeLauncher | GetWeapon CamoM32GrenadeLauncher",Alias="bigguns") Aliases[2]=(Command="Set Input 3 SwitchWeapon 3 | Set Input 4 SwitchWeapon 4",Alias="defaultLayout")
Aliases with indices 0 and 1 are just chains from previous section. Alias with index 2 restores default behavior of the modified buttons. Now, to allow in-game layout switching we just need to bind a couple of hotkeys. I like them bound on the numpad:
NumPad5=Set Input 3 guns | Set Input 4 bigguns NumPad4=defaultLayout
And that's it. I usually don't need anything you can't get with methods described here. But we still can go deeper.
Using mouse wheel and inversed chains
No additional explanation should be necessary about how to put mouse wheel to use, but I still would like to describe it on an example as it'll simplify next section and will allow me to introduce another idea. For that we'll create layout for some of my medic loadouts. I assume that player carries two medic guns and something else (like Blower Thrower Bile Launcher, Lever Action Rifle, Single Piston Longmusket or one of the zed guns).
First, we need to add following aliases:
Aliases[3]=(Command="GetWeapon BlowerThrower | GetWeapon ZEDGun | GetWeapon ZEDMKIIWeapon | GetWeapon Winchester | GetWeapon SPSniperRifle",Alias="medicmode") Aliases[4]=(Command="GetWeapon MP7MMedicGun | GetWeapon M7A3MMedicGun | GetWeapon MP5MMedicGun | GetWeapon CamoMP5MMedicGun | GetWeapon KFMod.KrissMMedicGun",Alias="medicwheelup") Aliases[5]=(Command="GetWeapon KFMod.KrissMMedicGun | GetWeapon MP5MMedicGun | GetWeapon CamoMP5MMedicGun | GetWeapon M7A3MMedicGun | GetWeapon MP7MMedicGun",Alias="medicwheeldown")
Notice that chains for aliases with indices 4 and 5 are inverses of each other.
Also we will need to modify defaultLayout:
Aliases[3]=(Command="Set Input 1 SwitchWeapon 1 | Set Input 2 SwitchWeapon 2 | Set Input 3 SwitchWeapon 3 | Set Input 4 SwitchWeapon 4 | Set Input 5 SwitchWeapon 5 | Set Input MouseWheelDown PrevWeapon | Set Input MouseWheelUp NextWeapon",Alias="defaultLayout")
to allow it to restore default behavior of every button and the mouse wheel. You may, of course, change that behavior if you want.
Hotkeys now would look like this (our new medic layout is bind to 'NumPad6'):
NumPad6=defaultLayout | Set Input 3 medicmode | Set Input 4 medicmode | Set Input MouseWheelUp medicwheelup | Set Input MouseWheelDown medicwheeldown NumPad5=defaultLayout | Set Input 3 guns | Set Input 4 bigguns NumPad4=defaultLayout
Addition of defaultLayout at the beginning of every command chain here and it's modification allows us to assume that everything behaves as it should by default before we begin to change it into a desired layout.
Now let's see how our new layout works. Buttons '3' and '4' will select additional weapons of our choice. Rotating mouse wheel up will execute chain medicwheelup and choose some weapon from it. Rotating wheel down will execute medicwheeldown and, since chain medicwheeldown is an inverse of medicwheelup, will always choose a different weapon (provided that you have more than one weapon from the chain). Why? Assume you have two weapons A and B. If in first chain weapon A is placed after B, -- A will be selected. But then in the inverse chain weapon B will be placed after A, and thus B will be selected. So if you want ability to choose not one, but two different weapons from a given list then reversed chain is a way to go.
Scrolling weapons with mouse wheel
Methods described so far allowed us to bind key to one weapon per loadout. For different loadouts different weapons might be selected with the same key, but, unlike default behavior, you can't cycle through weapons by pressing the same button. And there's no good way to create a custom weapon cycle. But there is a bad way that you shouldn't have to use. If your needs weren't yet satisfied, have a look at this section.
We will setup mouse wheel to be able to scroll not through 2, but through 3 (one can go up to 40) weapons! As an example we will use gunslinger loadout. It is simple and consists of dual handcannons, dual 44 magnums and dual MK23.
We will need these aliases:
Aliases[6]=(Command="GetWeapon DualDeagle | GetWeapon GoldenDualDeagle | Set Input MouseWheelDown dualmed | Set Input MouseWheelUp dualheavy",Alias="dualheavy") Aliases[7]=(Command="GetWeapon Dual44Magnum | Set Input MouseWheelDown duallight | Set Input MouseWheelUp dualheavy",Alias="dualmed") Aliases[8]=(Command="GetWeapon DualMK23Pistol | Set Input MouseWheelDown duallight | Set Input MouseWheelUp dualmed",Alias="duallight")
And that hotkey to choose our layout:
NumPadPeriod=defaultLayout | Set Input MouseWheelUp dualheavy | Set Input MouseWheelDown duallight
What does all this do? After selecting this weapon layout rotating wheel up will choose dual handcannons and rotating it down will choose dual MK23. Let's assume you rotated it up once. Now, while rotating wheel up would still select dual handcannons, rotating it down will select dual 44 magnums. Or, if you first rotated wheel down, then rotating it up will choose dual 44 magnums, while rotating it down will still choose dual MK23. Basically, you now have 3 states
  • Dual Handcannons
  • Dual 44 Magnums
  • Dual MK23
You can be in one of them at a time and are initially in the middle one Dual 44 Magnums. Rotating mouse wheel up forces you to go up the list of states and rotating it down moves you down the list. Each rotation also causes player to choose corresponding weapon.
This concept of states is what allows us to cycle through 3 weapons with mouse wheel and also what would allow us to cycle through several weapons by pressing a single key.
Each state is defined by what is bound to mouse rotations:
  • Dual Handcannons: Up - do dualheavy, Down - do dualmed
  • Dual 44 Magnums: Up - do dualheavy, Down - do duallight
  • Dual MK23: Up - do dualmed, Down - do duallight
And to change state we just need to rebind MouseWheelUp and MouseWheelDown to new values. Chains dualheavy, dualmed, duallight are designed to do that. For example, if we are in lower state "Dual MK23", then rotating mouse wheel up would invoke:
"GetWeapon Dual44Magnum | Set Input MouseWheelDown duallight | Set Input MouseWheelUp dualheavy"
which would select dual 44 magnums as a weapon and rebind keys so that new state is "Dual 44 Magnums".
One can also make it cycle from lowest state to the top when mouse wheel rotates down and from the top to the lowest when wheel rotates up.
Binding several weapons to a hotkey #2
Finally we'll do what's promised in the previous section. I didn't have to use this yet, so example will be a bit stretched.
Imagine that you're berserker who wants to roll with katana for small stuff and claymore sword for something bigger. The problem is, you need katana more often than claymore, but claymore got the priority over katana, so it takes more time to get to it. Therefore we want to change that priority by creating a new loadout for berserker in which katana would came out before claymore. For simplicity I will assume that the only melee weapons that player will carry will be katana, claymore and a knife.
States will be like this:
  • Katana: 1 is bind to zerkClaymore
  • Claymore: 1 is bind to zerkKnife
  • Knife: 1 is bind to zerkKatana
where aliases are like this:
Aliases[9]=(Command="GetWeapon Katana | GetWeapon GoldenKatana | Set Input 1 zerkClaymore",Alias="zerkKatana") Aliases[10]=(Command="GetWeapon ClaymoreSword | Set Input 1 zerkKnife",Alias="zerkClaymore") Aliases[11]=(Command="GetWeapon knife | Set Input 1 zerkKatana",Alias="zerkKnife")
As should be clear after reading previous section pressing 1 repeatedly cycles through states like this: Katana -> Claymore -> Knife -> Katana -> ...
To make use of this layout, as usual, make a hotkey:
NumPad0=defaultLayout | Set Input 1 zerkKatana
By changing and adding more states you can create any weapon cycle you want. But I have found little use for that as methods described before seem to fix every problem with default weapon selection system in a much easier way to both implement and use. Also, compared to how regular in-game system works, such cycling has certain flaws:
  • Amount of weapons you can put in such cycles is limited by amount of available aliases.
  • There's no way to change behavior depending on whether player has or hasn't certain weapons. Therefore you must have all the weapons in the cycle or it will work incorrectly.
  • It remembers which weapon player used last and always selects next in cycle, not first. In our example, when you press 1 you get a katana, but if you later switch to Syringe and then press 1 again it will select a claymore sword.
Last issue breaks our solution. This problem can be mitigated if you add
Set Input 1 zerkKatana
to every other key that changes weapon, but such changes will create a mess and still won't help in cases when game changes your weapon automatically. So I advise to avoid using method described in this section. Unless you're fine with all three issues.
Tables of weapons' in-game names
  • Medic
    Name
    In-game name
    MP7P Medic Gun
    MP7MMedicGun
    Blower Thrower Bile Launcher
    BlowerThrower
    MP5M Medic Gun
    MP5MMedicGun
    Camo MP5M Medic Gun
    CamoMP5MMedicGun
    M7A3 Medic Gun
    M7A3MMedicGun
    Schneidzekk Medic Gun
    KrissMMedicGun
    Neon Schneidzekk Medic Gun
    NeonKrissMMedicGun
  • Support
    Name
    In-game name
    Shotgun
    Shotgun
    Camo shotgun
    CamoShotgun
    Hunting shotgun
    BoomStick
    HSG-1 Shotgun
    KSGShotgun
    Neon HSG-1 Shotgun
    NeonKSGShotgun
    Vlad the Impaler
    NailGun
    Multichamber ZED Thrower
    SPAutoShotgun
    Combat Shotgun
    BenelliShotgun
    Golden Combat Shotgun
    GoldenBenelliShotgun
    AA12 Shotgun
    AA12AutoShotgun
    Golden AA12 Shotgun
    GoldenAA12AutoShotgun
  • Sharpshooter
    Name
    In-game name
    9mm Pistol
    Single
    Dual 9mms
    Dualies
    Lever Action Rifle
    Winchester
    44 Magnum
    Magnum44Pistol
    Handcannon
    Deagle
    Golden Handcannon
    GoldenDeagle
    MK23
    MK23Pistol
    Crossbow
    Crossbow
    Dual 44 Magnums
    Dual44Magnum
    Dual MK23
    DualMK23Pistol
    Dual Handcannons
    DualDeagle
    Dual Golden Handcannons
    GoldenDualDeagle
    Single Piston Longmusket
    SPSniperRifle
    M14EBR
    M14EBRBattleRifle
    M99 AMR
    M99SniperRifle
  • Commando
    Name
    In-game name
    Bullpup
    Bullpup
    Tommy Gun
    ThompsonSMG
    Dr. T's Lead Delivery System
    SPThompsonSMG
    Rising Storm Tommy Gun
    ThompsonDrumSMG
    AK47
    AK47AssaultRifle
    Golden AK47
    GoldenAK47AssaultRifle
    Neon AK47
    NeonAK47AssaultRifle
    M4
    M4AssaultRifle
    Camo M4
    CamoM4AssaultRifle
    MKb42
    MKb42AssaultRifle
    SCARMK17
    SCARMK17AssaultRifle
    Neon SCARMK17
    NeonSCARMK17AssaultRifle
    FNFAL ACOG
    FNFAL_ACOG_AssaultRifle
  • Berserker
    Name
    In-game name
    Knife
    knife
    Machete
    Machete
    Axe
    Axe
    Katana
    Katana
    Golden Katana
    GoldenKatana
    Scythe
    Scythe
    Chainsaw
    Chainsaw
    Golden Chainsaw
    GoldenChainsaw
    Dwarfs!? Axe
    DwarfAxe
    Claymore Sword
    ClaymoreSword
    Buzzsaw Bow
    Crossbuzzsaw
  • Firebug
    Name
    In-game name
    MAC-10
    MAC10MP
    Flare Revolver
    FlareRevolver
    FlameThrower
    FlameThrower
    Golden FlameThrower
    GoldenFlamethrower
    Dual Flare Revolvers
    DualFlareRevolver
    Trenchgun
    TrenchGun
    Husk Fireball Launcher
    Huskgun
  • Demolitions
    Name
    In-game name
    M79 Grenade Launcher
    M79GrenadeLauncher
    Golden M79 Grenade Launcher
    GoldenM79GrenadeLauncher
    The Orca Bomb Propeller
    SPGrenadeLauncher
    Pipe Bomb
    PipeBombExplosive
    SealSqueal Harpoon Bomber
    SealSquealHarpoonBomber
    SeekerSix Rocket Launcher
    SeekerSixRocketLauncher
    M4 203
    M4203AssaultRifle
    L.A.W
    LAW
    M32 Grenade Launcher
    M32GrenadeLauncher
    Camo M32 Grenade Launcher
    CamoM32GrenadeLauncher
  • Non-perk
    Name
    In-game name
    Zed Eradication Device
    ZEDGun
    Zed Eradication Device MK2
    ZEDMKIIWeapon
    Welder
    Welder
    Syringe
    Syringe
15 Comments
Yolatska 18 Dec, 2015 @ 6:21am 
anyway i can use this for ammo and armor refill only? sorry if you mentioned it I didnt read the whole guide
sev 11 Sep, 2014 @ 2:20pm 
okay
so
I changed the functionality a bit to work as a toggle for a single key, and decided to move it over from the numpad to the N key
suddenly it works

I also realize that, despite not showing an error, it doesn't work at all from the console, and will only work if bound to a key not on the numpad for some stupid fuck reason
sev 11 Sep, 2014 @ 1:16pm 
various keys; I would also try running them directly in the console.
in both cases I don't get any "Unrecognzed command." or whatever prompts, so I know the aliases exist , but they still don't do anything.
dkanus  [author] 11 Sep, 2014 @ 4:37am 
Ok, that's weird. I have no idea what's happening. To what keys did you bind these commands?
sev 11 Sep, 2014 @ 4:13am 
still doesn't work for me
http://pastebin.com/tfyqKraQ
sev 11 Sep, 2014 @ 4:05am 
I deleted them recently and re-typed them for this conversation so I might as well test them myself again.
dkanus  [author] 11 Sep, 2014 @ 4:03am 
I tried your aliases and they work just fine. At which alias slots do you place them? Remember that you can't add new ones and must replace old aliases. And how exactly do you use them? Can you copy here all relevant lines from your config file? Or even better, - can you share your entire config file through something like pastebin.com?
sev 11 Sep, 2014 @ 3:25am 
pretty much the same, minus the junk
(Command="Set Input MouseWheelDown TossCash 1 | Set Input MouseWheelUp TossCash 1",Alias="DoshOn")
(Command="Set Input MouseWheelDown NextWeapon | Set Input PrevWeapon",Alias="DoshOff")

also attempted with another alias set to TossCash 1 , i.e. Set Input MouseWheelDown AliasName
also attempted padded with various amounts of Say / TeamSay and other commands

I wish there was a Source-esque wait command in Unreal (or, rather, KF's version)
(Command="TossCash 1 | Wait 1 | MONEYMONEYMONEY",Alias="MONEYMONEYMONEY")

also oh god I just realized those typos in my first post
I shame my ancestors
dkanus  [author] 11 Sep, 2014 @ 2:32am 
Not sure. Can you provide me with more info? How exactly are you defining your alias and how are you using it?
In case this'll help, - I like to throw a bit more dosh, so I use these aliases (so they should work):
(Command="TossCash 1 | TossCash 1",Alias="loadsomoney")
(Command="Set Input 1 SwitchWeapon 1 | Set Input 2 SwitchWeapon 2 | Set Input 3 SwitchWeapon 3 | Set Input 4 SwitchWeapon 4 | Set Input 5 SwitchWeapon 5 | Set Input MouseWheelDown loadsomoney | Set Input MouseWheelUp loadsomoney",Alias="defaultLayout")
'Set Input # SwitchWeapon #' commmands are, of course, irrelevant and can be removed.
sev 10 Sep, 2014 @ 6:09pm 
Say, why won't my alias command containing Set Input MouseWheelDown TossCash 1 not running at all?
I placed a Say in front of it to see if it worked, but it didn't.