-
Notifications
You must be signed in to change notification settings - Fork 1
Achievement
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
This module offers a collection of structs, which serve as custom data models for organizing and structuring data. Explore the provided structs to better understand the relationships between data elements and simplify your data manipulation tasks.
This function requests the Apple GameCenter API to update the completion percentage of the given achievement. The function will not return any value but it will create a request that will trigger a Social Async Event callback upon completion.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GameCenter_Achievement_Report(identifier, percent, showcompletionbanner)
Argument | Type | Description |
---|---|---|
identifier | String | The identifier for the achievement. |
percent | Real | The new completion percentage. |
showcompletionbanner | Boolean | Whether to show the completion banner. |
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GameCenter_Achievement_Report" |
success | Boolean | Whether or not the task succeeded. |
achievement_id | String | The unique name of the achievement. |
Example:
GameCenter_Achievement_Report("YYAchievement2", 100, true);
This function resets all previously earned/reported achievements. This function is for debug purposes only and should not be used in production, unless specifically required.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GameCenter_Achievement_ResetAll()
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GameCenter_Achievement_ResetAll" |
success | Boolean | Whether or not the task succeeded. |
Example:
GameCenter_Achievement_ResetAll();
This function will load data from all the achievements the player has progressed on.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
GameCenter_Achievement_Load()
Returns:
N/A
Triggers:
Key | Type | Description |
---|---|---|
type | String | "GameCenter_Achievement_Load" |
success | Boolean | Whether or not the task succeeded. |
A | String | JSON formatted string containing an array of AchievementJSON information (can be parsed into a struct using json_parse) |
Example:
GameCenter_Achievement_Load();
This struct is referenced by the following structs:
Member | Type | Description |
---|---|---|
alias | String | A string the player chooses to identify themself to other players. |
displayName | String | A string to display for the player. |
playerID | String | A unique identifier for a player of the game. |
Member | Type | Description |
---|---|---|
identifier | String | A string that identifies the current achievement. |
percentComplete | Real | The complete percentage of the achievement. |
isComplete | Boolean | Whether or not the achievement was completed. |
showsCompletionBanner | Boolean | Whether or not the achievement shows a completion banner. |
player | PlayerJSON | A struct containing info on a player |
lastReportedDate | Date | A GameMaker compliant date from when the last report occurred. |
GameMaker 2024