halflife
halflife copied to clipboard
Improve error message shown when SteamAPI_init call fails
When the game starts it calls SteamAPI_Init to set up Steamworks features. If this fails the following error is shown:
This error message doesn't explain why the call might have failed, often confusing people who aren't familiar with what it means.
This error message should be expanded on with more information. The possible reasons for this error are listed here: https://partner.steamgames.com/doc/api/steam_api#SteamAPI_Init
Adding this information, rewritten to use layman's terms should make it more obvious why this is happening.
Possible text:
Failed to initialize authentication interface. Exiting...
Possible reasons for this are:
* The Steam client isn't running.
* The file `steam_appid.txt` is missing or corrupted. Ensure the file exists and is not marked as read-only.
* The game and Steam are running with different user privileges (e.g. Steam is running as administrator and the game is not). Ensure both programs are running without administrator privileges.
I omitted information that isn't relevant in this game's case to avoid confusion. Strictly speaking the contents of steam_appid.txt don't matter since the game generates the file immediately prior to initializing Steamworks so as long as it's not read-only it'll be correct.
This should avoid the common case of users not running Steam or running either program with incorrect privileges. It's a common question in all modding communities.