# Achievement Unlock (Report Progress)

## Goal

Report achievement progress and optionally show the native Achievements UI.

## Prerequisite

Make sure the player is authenticated first. Use `use-case-1-auth-bootstrap.md` for a safe startup flow (don’t rely on `GameServicesAuthenticate.successEvent` as “authenticated”).

## Actions used

* `GameServicesReportAchievementProgress`
* `GameServicesGetReportAchievementProgressError` (on failure)
* `GameServicesShowAchievementsUI` (optional)

## Variables

* `achievementId` (String) e.g. `"first_victory"`
* `percentComplete` (Float) 0–100

## Flow

1. When the achievement condition is met, go to `ReportAchievementProgress`.
2. State: `ReportAchievementProgress`
   * Action: `GameServicesReportAchievementProgress`
   * Inputs: `achievementId`, `percentComplete` (use `100` to unlock)
   * Events:
     * `successEvent` → (optional) `ShowAchievementsUI` or back to gameplay
     * `failureEvent` → `GetReportAchievementProgressError` (log/ignore)
3. State: `ShowAchievementsUI` (optional)
   * Action: `GameServicesShowAchievementsUI`

## Notes

* Incremental achievements: report `25`, `50`, … until `100`.
* If the player is not authenticated, `GameServicesReportAchievementProgress` fails immediately; decide whether to silently skip or prompt login via your auth bootstrap.


---

# 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://assetstore.essentialkit.voxelbusters.com/features/game-services/playmaker/use-cases/use-case-2-achievement-unlock.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.
