Help with custom binds!


(Kirstµ) #1

I was big into scripting my own keybinds in TF2, however Unreal scripting seems too tough for me to learn efficiently.
That’s why I’m asking all of you lovely people on how to make custom keybinds using the console or the .ini files.

I’m looking to binding a key to switch my primary and melee easily (basically to cycle between), while also having it so that if I have my secondary equipped, it will always equip my melee, not my primary.

Here’s an excerpt, not the full script that I used in TF2, as it is far too long, don’t mind the aliases:
alias MB1 “bind q secondary;bind MOUSE4 melee”
alias MB2 “bind q primary;bind MOUSE4 melee”
alias MB3 “bind q primary;bind MOUSE4 primary”

It also features the cycling between primary and secondary, but I do believe that is already in the game.

So if anyone is willing to show me the ropes of scripting my own keybinds in Unreal, I’d be really grateful!

Thanks!


(Nail) #2

use mouse wheel and set it in game


(Kirstµ) #3

I currently have my primary and secondary bound to mouse wheel up and down respectively and equip melee to mouse4, but It doesn’t really cater to me as well as my old setup.


(Snark) #4

If I were intent on making that bind work, I’d have all my switch weapon keys rebind other keys. Here’s an example of a bind that rebinds other keys that you could work off of, if you chose. Too lazy to actually try to map out what you describe.

Bindings=(Name="NormBinds",Command="SelectWeaponSlot WS_Item3 | setbind Q WeaponSlotFour 0 | setbind G WeaponSlotFive 0 | setbind X MediBinds 0")
Bindings=(Name="MediBinds",Command="SelectWeaponSlot WS_Item3 | setbind G WeaponSlotFour 0 | setbind Q WeaponSlotFive 0 | setbind X NormBinds 0")
Bindings=(Name="X",Command="MediBinds")

Setting a bind such that Name=“not_an_actual_key_name” creates an alias, so NormBinds and MediBinds are aliases that are switched between by pressing the last line of the above set of binds. The rest may be obvious since you’re experienced with this sort of stuff. Here’s some additional info on binding with the engine.


(Snark) #5

Actually, fk it, here’s my try at the bind you want. Completely untested.

under [ShooterGame.SGPlayerInputPawn], ctrl+f for the lines,

Bindings=(Name="WeaponSlotOne",Command="SelectWeaponSlot WS_Melee",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)
Bindings=(Name="WeaponSlotTwo",Command="SelectWeaponSlot WS_Secondary",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)
Bindings=(Name="WeaponSlotThree",Command="SelectWeaponSlot WS_Primary",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)

and change them to,

Bindings=(Name="WeaponSlotOne",Command="SelectWeaponSlot WS_Melee | setbind Q EqPrimary 0",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)
Bindings=(Name="WeaponSlotTwo",Command="SelectWeaponSlot WS_Secondary | setbind Q EqMelee 0",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)
Bindings=(Name="WeaponSlotThree",Command="SelectWeaponSlot WS_Primary | setbind Q EqMelee 0",Control=False,Shift=False,Alt=False,bIgnoreCtrl=False,bIgnoreShift=False,bIgnoreAlt=False)

and, also under [ShooterGame.SGPlayerInputPawn], add lines,

Bindings=(Name="EqMelee",Command="WeaponSlotOne")
Bindings=(Name="EqPrimary",Command="WeaponSlotThree")
Bindings=(Name="Q",Command="EqMelee")

No guarantee of success, but it should, “switch my primary and melee easily (basically to cycle between), while also having it so that if I have my secondary equipped, it will always equip my melee, not my primary.” If that doesn’t work, maybe it’ll help you to have it to work off.

The configuration file is ShooterInput.ini which is in %USERPROFILE%\Documents\my games\UnrealEngine3\ShooterGame\Config

You will want to back up your changes as these config files sometimes get partially or entirely reset during game updates that make changes to their contents.


(N8o) #6

Oh my god who poured lemonade on my screen?


(SteelMailbox) #7

I though the same when I saw it


(modernBlast) #8

Does your mouse have a rocker switch on the scroll wheel (scroll left right), most do these days. I use that and its pretty much instant switch and you hardly need to move you fingers at all. Oddly enough some so called high end gaming mice don’t have it, which seems ridiculous as you’re missing out on 2 very convenient buttons.


(Kirstµ) #9

[quote=“Snark;83087”][/quote]

Seems interesting, I’ll give it a go today and see if I can modify it if there’s a need.

I have a Razer Deathadder, which doesn’t unfortunately have them, however this was not really the topic of the post. I’m looking for scripting help, not alternative way to bind my keys. Thanks for the comment anyways!


(Kirstµ) #10

[quote=“Snark;83087”][/quote]

Seems interesting, I’ll give it a go today and see if I can modify it if there’s a need.

I have a Razer Deathadder, which doesn’t unfortunately have them, however this was not really the topic of the post. I’m looking for scripting help, not alternative way to bind my keys. Thanks for the comment anyways!


(Kirstµ) #11

UPDATE: I only got around to my computer today, and unfortunately @Snark 's script didn’t work, I tried making some changes, but to no avail.
Thanks for the help anyway, guys! I’ll leave this open, maybe I’ll be able to crack the code myself at some point. I’m still open for help, though.

P.S. Weird double comment, meh.


(qjack) #12

take a look here:
https://udn.epicgames.com/Three/KeyBinds.html


(Kirstµ) #13

[quote=“qjack;83783”]take a look here:
https://udn.epicgames.com/Three/KeyBinds.html
[/quote]

Oh, man, this looks useful. Thanks alot! I’ll keep you all updated on whether I succeed or not.


(Kirstµ) #14

Okay, so no matter what I do, the game keeps unbinding seemingly random stuff as I bind new stuff. I guess I’m giving up on this subject, I’ll do with my current binds.
A sincere thanks for all the help!