-
Notifications
You must be signed in to change notification settings - Fork 12
DLC
Steam supports both free and paid downloadable content (DLC), and in the Steam client, a game with downloadable content appears as a single application in the user's game list with the downloadable content viewable through the games properties dialog. Once owned, downloadable content is treated as an integral part of the game and Steam will automatically update the content when a patch is available and installs the content when the user installs the game.
Since this is all handled by the Steam servers and the configuration of any DLC is done through the Steamworks control panel, there are only a couple of functions necessary in GameMaker to check for this extra content:
If your game has DLC created for it, you can use this function to check whether the user has bought it before accessing any files associated with it. The function will return true
(1
) if the player owns the content, false
(0
) if they don't own it or the given DLC ID is invalid, or -1
if they're not logged into Steam.
Note
Even if the user owns the DLC it doesn't mean that they have it installed in their local account, so you should additionally use the function steam_user_installed_dlc to make sure that it is before using it.
Syntax:
steam_user_owns_dlc(dlc_id)
Argument | Type | Description |
---|---|---|
dlc_id | Int64 | The unique identifier for the DLC to be checked. |
Returns:
Example:
global.Level_Max = 100;
if steam_user_owns_dlc(10354)
{
if steam_user_installed_dlc(10354)
{
global.Level_max = 200;
}
}
The above code will check to see if the user has bought, and installed, the DLC with the ID 10354, and if so set a global variable to a different value.
If your game has DLC created for it, you can use this function to check and see whether the user has installed it before accessing any files associated with it. The function returns true
if the player has the content installed, and false
if the user does not, but note that the user must also own the DLC, so you should use the additional function of steam_user_owns_dlc to check that it is owned as well before using it.
Syntax:
steam_user_installed_dlc(dlc_id)
Argument | Type | Description |
---|---|---|
dlc_id | Int64 | The unique identifier for the DLC to be checked. |
Returns:
Example:
global.Level_Max = 100;
if (steam_user_owns_dlc(10354))
{
if (steam_user_installed_dlc(10354))
{
global.Level_max = 200;
}
}
The above code will check to see if the user has bought, and installed, the DLC with the ID 10354, and if so set a global variable to a different value.
GameMaker 2024