# Achievements

**Support**

Use this to determine if you can implement achievements for your game on the current platform.

```javascript
playgama_bridge_achievements_is_supported()
```

Check if getting list of achievements is supported.

```javascript
playgama_bridge_achievements_is_get_list_supported()
```

Check if built-in popup is supported.

```javascript
playgama_bridge_achievements_is_native_popup_supported()
```

**Unlock achievement**

Unlocks achievement for a player.

```javascript
var options
switch playgama_bridge_platform_id() {
    case "y8":
        options = {
            "achievement": "ACHIEVEMENT_NAME",
            "achievementkey": "ACHIEVEMENT_KEY"
        }
        break
    case "lagged":
        options = {
            "achievement": "ACHIEVEMENT_ID"
        }
        break
}

playgama_bridge_achievements_unlock(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_achievements_unlock_callback" {
    if async_load[? "success"] {
        // your logic here
    }
}
```

**Get List**

Returns the achievements list

```javascript
playgama_bridge_achievements_get_list()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_achievements_get_list_callback" {
    if async_load[? "success"] {
        var achievements_list = json_parse(async_load[? "data"])
    }
}
```

**Show Native Popup**

Some platforms support built-in achievement list which is shown in overlay

```javascript
playgama_bridge_achievements_show_native_popup()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_achievements_show_native_popup_callback" {
    if async_load[? "success"] {
        // your logic here
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/engines/gamemaker/achievements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
