Page 1 of 1

ut2004 exec command for keybinds/config

Posted: Sun 01 Apr , 2018 9:40 pm
by darkelf
Tutorial on how to use exec command

Description: The exec command in a nutshell allows you to run/start a script or file from the ut2004 console.
Why would I care: This command can allow you to run many set input/set file.extention commands via just one click of a button. This is usefull if you want to have mutliple keyboard layouts and or user.ini/ut2004.ini config changes at different times during your gaming experience in ut2004. Had a few people ask about how or if this was possible, so here it is.

Example idea 1: Hitting the letter "j" on your keyboard will trigger the letters "u" ,"i", "o" and "p" to be binded to multiple different chat messages. Note: This example is a one time config change. See below example 2 for multiple configs.

Step 1: Open notepad and save a .txt document as config1

Step 2: Type the set input commands for each of these keys(example below) and save the file. Each set input or command should be on its own line(ie press enter after each command).

Code: Select all

set input u say I like penguins!
set input i say I really like penguins!
set input o say I really really like penguins!
set input p say I really really really like penguins!
Step 3: Place config1.txt into your ut2004/systems folder.

Step 4: Start ut2004 and open console and type in the following:

Code: Select all

set input j exec config1.txt
Step 5: Press J. You should now be able to press "u" ,"i", "o" and "p" and get the chat messages that we wrote above.

Example idea 2: Hitting the letter "j" on your keyboard will trigger the letters "u" ,"i", "o" and "p" to be binded to multiple different chat messages. Hitting "j" again will reset "u" ,"i", "o" and "p" back to weapon slots.

Step 1: Open notepad and save a .txt document as config1

Step 2: Type the set input commands for each of these keys(example below) and save the file. Each set input or command should be on its own line(ie press enter after each command).

Code: Select all

set input u say I like penguins!
set input i say I really like penguins!
set input o say I really really like penguins!
set input p say I really really really like penguins!
set input j exec config2.txt
Step 1: Open another .txt document and save it as config2

Step 3: Type the set input commands for each of these keys(example below) and save the file. Each set input or command should be on its own line(ie press enter after each command).

Code: Select all

set input u SwitchWeapon 1
set input i SwitchWeapon 2
set input o SwitchWeapon 3
set input p SwitchWeapon 4
set input j exec config1.txt
Step 3: Place config1.txt and config2.txt into your ut2004/systems folder.

Step 4: Start ut2004 and open console and type in the following:

Code: Select all

set input j exec config1.txt
Step 5: Press "j", you should now be able to press "u" ,"i", "o" and "p" and get the chat messages that we wrote above. Press "j" again and "u" ,"i", "o" and "p" should be bound to weapon slots.


Any commands you can do via ut2004 console ingame you can put into the txt file and be able to exec it via the "exec" command. Let me know if you have any questions or need further explanation.

Re: ut2004 exec command for keybinds/config

Posted: Mon 02 Apr , 2018 10:55 am
by Satin
Thanks elfy, that's really useful :)