Functions Reference
Godot 4 · GDScript · Achievements
list_achievements
Lists every active achievement with this player's unlock state, ordered by sort_order.
Asynchronous (result via signal)
Signature
list_achievements() -> voidWhat it does
POSTs /achievements/list (session-auth). Returns all ACTIVE achievements for the game with this player's unlock state, ordered by sort_order. Hidden achievements the player hasn't unlocked yet are omitted server-side. Each entry is a Dictionary: { achievement_key, name, description, icon_url, points, is_hidden, sort_order, unlocked, unlocked_at }. Emits an empty Array on failure or with no active session.
Parameters
This function takes no parameters.
How to call it
Connect achievements_loaded first, then call list_achievements().
Result signal: achievements_loaded(achievements: Array)
Example
Gamdato.achievements_loaded.connect(_on_achievements)
Gamdato.list_achievements()
func _on_achievements(list: Array) -> void:
for a in list:
var mark := "[x]" if a.unlocked else "[ ]"
print("%s %s (%d pts)" % [mark, a.name, a.points])Use cases
- Build an achievements screen showing locked and unlocked entries with points.
- Show overall completion progress by counting unlocked entries.