Reference des fonctions
Godot 4 · GDScript · Achievements
get_achievement_info
Fetches one achievement's full details plus this player's unlock state.
Asynchronous (result via signal)
Signature
get_achievement_info(achievement_key: String) -> voidWhat it does
POSTs /achievements/info (session-auth). Returns the full detail Dictionary (name, description, icon_url, points, unlocked, unlocked_at). A hidden achievement the player hasn't unlocked yet comes back masked: name "???", null description/icon, points 0. Emits {} on error, an empty key, or no active session.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| achievement_key | String | required | The achievement's key from the panel. |
How to call it
Connect achievement_info_loaded first, then call get_achievement_info().
Result signal: achievement_info_loaded(achievement_key: String, info: Dictionary)
Example
Gamdato.achievement_info_loaded.connect(_on_ach_info)
Gamdato.get_achievement_info("first_win")
func _on_ach_info(key: String, info: Dictionary) -> void:
if info.is_empty():
return
print("%s; %s (%d pts)" % [info.name, info.description, info.points])Use cases
- Show a single achievement's details and icon in a popup or tooltip.
- Render hidden achievements as masked entries until the player unlocks them.