> For the complete documentation index, see [llms.txt](https://roza-gb.gitbook.io/mkxp-z/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roza-gb.gitbook.io/mkxp-z/extensions/steam-achievements.md).

# SteamLite

{% hint style="info" %}
The details about including Steam support here are only relevant to Meson. If you are building for macOS, details related to building with Steam are explained in the [Xcode](/mkxp-z/building-xcode/compilation-macos-xcode.md) section.
{% endhint %}

{% hint style="info" %}
For this module to be defined, `steamworks_path` must be set to the location of the [Steamworks API SDK](https://partner.steamgames.com/) when building.
{% endhint %}

At the moment, this is primarily just a built-in implementation of achievements, very similar to the [SteamUserStatsLite](https://github.com/GMMan/RGSS_SteamUserStatsLite) script. Because MKXP is GPL licensed (and therefore isn't actually allowed to directly link to Steamworks, probably even using the aforementioned script), this functionality is implemented through [Steamshim](https://github.com/inori-z/mkxp-z/tree/master/steamshim). &#x20;

When built with Steam support, two executables are created instead of one -- the first being Steamshim, and the second (the one ending in `_rt`) being the game itself. Remember to keep both.

If `steam_appid` not set when building, the application must be launched directly from Steam unless `steam_appid.txt` is placed in the same directory containing your App ID. If `steam_appid` is set, the game will automatically request for Steam to start it (using `SteamAPI_RestartAppIfNecessary`) if it was not already launched using it.

The only significant differences from SUSL should be:

* Functions are accessed through the `SteamLite` module
* `get_stat_float` and `get_stat_int` are now `get_stat_f` and `get_stat_i` respectively
* the `is_subscribed` , `is_dlc_present`,  `update_avg_rate_stat` , and `get_achievement_display_info` methods are not present  (yet)

It is a little simpler to use than SteamUserStatsLite due to initialization, shutdown, and updating being handled internally. Using it is as simple as:

```ruby
SteamLite.set_achievement 'YOUR_ACH_ID_HERE'

# Send changes to server and display achievement notifications
SteamLite.store_stats
```
