Tutorial: Setting up a Mod: Part 3 - Game Strings (Steam) Last edited 9 months ago2023-06-28 04:46:16 UTC

This tutorial is intended to be the counterpart of the tutorial written for the WON version.

Customizing game strings

In the Steam version of GoldSrc as well as Source, game strings live in several files inside the game/mod folder: These files are considerably easier to customize compared to its WON predecessor, and supports internationalization into different languages.

To customize them, make a copy from valve/resource folder into your mod's equivalent, and change as necessary. Be sure to preserve all the curly braces in the files or else it'll fail to parse!

See also: titles.txt for modifying in-game strings.

Where these strings are used

One instance is in the list of available keybinds, as it appears in the Keyboard tab of the Options dialog, available in gfx/shell/kb_act.lst. Opening the one from valve folder, you'll see something like this:
"blank"            "=========================="
"blank"            "#Valve_Movement_Title"
"blank"            "=========================="
"+forward"        "#Valve_Move_Forward"
"+back"            "#Valve_Move_Back"
"+left"            "#Valve_Turn_Left"
"+right"        "#Valve_Turn_Right"
"+moveleft"        "#Valve_Move_Left"
"+moveright"    "#Valve_Move_Right"
The first string on each line is the console command that would be associated with a key, and the second is the string displayed in the UI list. Here you can see the Steam UI string system at work; instead of a literal string, the value is instead a "#" sign followed by a string token ID. This token ID would be the same one found in the files covered in the previous section. In-game, the appropriate strings from the resource files will be filled in (except when the token is missing, of course.)
To add a new key bind entry to the UI list, simply add them where you want it to appear. For example:
"+commandmenu" "Open command menu"
You can choose whether to use the Steam UI string system or not, in which case you type in the string literally. If you're planning on distributing your mod to a wide audience, it is advisable to stick to the tokens, and add the corresponding entries to your resource/<modfoldername>_*.txt file.
Other places where you can use UI tokens instead of literal strings include:

Notes

End of tutorial series

Comments

You must log in to post a comment. You can login or register a new account.