GameMaker Studio · GML
Functions Reference
Every function in the Gamdato GameMaker extension, grouped by area. Pick a function for its parameters, how to call it, and a practical example.
Setup & session
| Function | What it does | Parameters |
|---|---|---|
| gmda_setController | Sets your credentials and begins the session bootstrap. Call once in the controller Create event. | game_id, api_key |
| gmda_setLeaderboard | Declares the leaderboard table keys; argument order is each table's 1-based number. Up to 10. | key1, key2 |
| gmda_status | True once the session is active AND all tables have finished loading at least once. | none |
| gmda_isSessionActive | True while the session is alive, even during a table reload. | none |
| gmda_hasConnectivity | True if the last HTTP attempt reached the server. | none |
| gmda_Updatefunction | Drives the whole lifecycle. Call EVERY Step on the persistent controller. | none |
| gmda_HTTPfunction | Routes each HTTP response and pushes result structs onto the event queue. Call in the Async HTTP event. | none |
| gmda_pollEvent | Returns the next queued result struct, or undefined when the queue is empty. Drain it in a loop each Step. | none |
| gmda_getDate | Returns the last date/time string the client cached. | none |
| gmda_refreshDate | Recomputes and returns the current device date/time as a string. | none |
Leaderboards & scores
| Function | What it does | Parameters |
|---|---|---|
| gmda_submit | Sends a score to a table by index; refreshes that table afterwards. | table, score, custom_struct |
| gmda_submitWithRetry | Submits a score with automatic offline retry; the queue survives app closes and crashes. | table, score, custom_struct |
| gmda_getPending | Returns the queued (not-yet-sent) score for a table, or {} if none. | table |
| gmda_clearPending | Drops the queued (not-yet-sent) score for a table. | table |
| gmda_loadLeaderboardView | Loads a periodic / filtered leaderboard view; result arrives via the view_loaded event. | table, period, options_struct |
| gmda_searchPlayers | Searches players by name within a table; results arrive via the players_search_completed event. | table, query |
| gmda_getTabledata | Returns the cached top entries for a table as a ds_grid (6 columns x 10 rows). | table |
| gmda_getTableConfig | Returns a table's dashboard config: sort order and whether period scores are enabled. | table |
| gmda_getBestscore | Returns the player's cached best score on a table (0 if unknown). | table |
| gmda_getPlayerpos | Returns the player's cached global rank on a table (0 if unknown). | table |
| gmda_getExtrainfo | Returns the player's own custom_data struct on a table. | table |
| gmda_reloadinfo | Forces a reload of all leaderboard tables; finishes with the tables_loaded event. | none |
Players
| Function | What it does | Parameters |
|---|---|---|
| gmda_getPlayername | Returns the current player's display name (read from the local cache). | none |
| gmda_getPlayerid | Returns the current player's unique key. | none |
| gmda_loadPlayerInfo | Loads another player's public profile and their best scores by their player key. | player_key |
| gmda_setNewname | Changes the player's display name (server validates uniqueness and charset). | new_name |
| gmda_getInvitability | Reads whether other players are currently allowed to send this player friend invites. | none |
| gmda_setInvitability | Sets whether other players are allowed to send this player friend invites. | is_invitable |
Friends
| Function | What it does | Parameters |
|---|---|---|
| gmda_sendFriendInvite | Sends a friend invitation to a player by key, with an optional message. | player_key, message |
| gmda_listPendingInvitations | Lists pending friend invitations; the event fires twice, once for incoming and once for outgoing. | none |
| gmda_respondInvitation | Accepts or declines an incoming friend invitation by id. | invitation_id, accept_bool |
| gmda_cancelInvitation | Cancels an outgoing friend invitation you previously sent. | invitation_id |
| gmda_listFriends | Lists the player's accepted friends, newest friendship first, with optional name search. | limit, search |
| gmda_removeFriend | Removes an existing friendship by player key. | player_key |
Achievements
| Function | What it does | Parameters |
|---|---|---|
| gmda_listAchievements | Lists every active achievement with this player's unlock state, ordered by sort_order. | none |
| gmda_getAchievementInfo | Fetches one achievement's panel definition plus this player's unlock state. | key |
| gmda_checkAchievement | Checks whether this player has unlocked a given achievement. | key |
| gmda_unlockAchievement | Unlocks an achievement for the current player (idempotent). | key |
Cloud saves
| Function | What it does | Parameters |
|---|---|---|
| gmda_saveGame | Writes (upserts) a cloud save slot with a free-form data struct. | slot, data_struct |
| gmda_loadGame | Loads the full data struct stored in a single cloud save slot. | slot |
| gmda_listSaves | Lists this player's cloud save slots (metadata only, no data). | none |
| gmda_deleteSave | Deletes a single cloud save slot. | slot |
Currency & store
| Function | What it does | Parameters |
|---|---|---|
| gmda_getBalances | Fetches the player's currency balances plus the game's currency catalog. | none |
| gmda_getInventory | Fetches the player's permanent inventory (items owned in this game). | none |
| gmda_purchase | Spends in-game currency to buy a shop item by SKU (the server validates the balance). | sku, idempotency_key |
| gmda_buyPack | Starts a real-money top-up: opens Stripe Checkout in the browser to credit currency. | pack_sku, success_url, cancel_url, idempotency_key |
| gmda_getLedger | Fetches recent currency ledger entries for this player, newest first. | limit, offset |
| gmda_getCurrencyLeaderboard | Fetches the balance leaderboard for a currency (top balances ranked). | code, limit |
| gmda_grantCurrency | Applies a panel-defined currency grant by reason key (quest payout, level-up bonus). | reason_key, idempotency_key |
Rewards
| Function | What it does | Parameters |
|---|---|---|
| gmda_getRewardsStatus | Fetches this player's reward status (what's claimable now and when each unlocks next). | none |
| gmda_claimReward | Claims a reward by key (safe against double-claims). | key, idempotency_key |
Downloadable content
| Function | What it does | Parameters |
|---|---|---|
| gmda_listGameContent | Lists every content item configured for this game, with per-item metadata. | none |
| gmda_getGameContent | Requests one content item by key. | key |
| gmda_getBootstrap | Fetches all always_download content in a single envelope at startup. | none |
| gmda_syncAlwaysDownload | Fetches every always_download item: emits one content_loaded per item, then content_sync_complete. | none |
| gmda_syncContentKeys | Fetches an explicit set of content keys, emitting one content_loaded per key. | keys |
Groups & clans
| Function | What it does | Parameters |
|---|---|---|
| gmda_createGroup | Creates a group; the caller becomes its leader. | name, opts_struct |
| gmda_listGroups | Browses or searches public groups, ordered by member count (descending). | search, limit |
| gmda_getGroupInfo | Loads a group's details and its member list. | group_id |
| gmda_updateGroup | Edits the caller's group settings (leader/officer only). | fields_struct |
| gmda_leaveGroup | Leaves the caller's current group. | none |
| gmda_disbandGroup | Disbands the caller's group entirely (leader only). | none |
| gmda_joinGroup | Directly joins an OPEN group. | group_id |
| gmda_sendGroupInvite | Invites a player to the caller's group (leader/officer only). | player_key, message |
| gmda_listGroupInvitations | Lists group invitations, incoming or outgoing. | direction, status, limit |
| gmda_respondGroupInvitation | Accepts or declines a group invitation addressed to the caller. | invitation_id, accept_bool |
| gmda_cancelGroupInvitation | Withdraws a pending invitation the group sent (leader/officer only). | invitation_id |
| gmda_createGroupRequest | Requests to join a request-only group. | group_id, message |
| gmda_listGroupRequests | Lists join requests, incoming (to review) or outgoing (your own). | direction, status, limit |
| gmda_respondGroupRequest | Approves or rejects a pending join request (officer). | request_id, approve_bool |
| gmda_cancelGroupRequest | Withdraws the caller's own pending join request. | request_id |
| gmda_kickGroupMember | Removes a member from the caller's group (leader/officer). | player_key |
| gmda_assignGroupRole | Changes a member's role within the group. | player_key, role |
| gmda_transferGroupLeadership | Transfers leadership from the caller to another member (leader only). | player_key |