Functions Reference
Godot 4 · GDScript · Downloadable content
get_game_content
Requests one on-demand content item by key.
Asynchronous (result via signal)
Signature
get_game_content(key: String) -> voidWhat it does
GETs /gamecontent/<key>. The data delivered by content_loaded is the server envelope Dictionary { "schema_version": int, "generated_at": String, "<key>": <your uploaded value> }, your uploaded value (Dictionary, Array, or primitive) lives at data[key], not at the top level. data is null on error.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| key | String | required | The content key you configured in the panel. |
How to call it
Connect content_loaded first, then call get_game_content(). Read your value with data[key].
Result signal: content_loaded(key: String, data: Variant)
Example
Gamdato.content_loaded.connect(_on_content)
Gamdato.get_game_content("levels")
func _on_content(key: String, data: Variant) -> void:
if key == "levels": _load_levels(data[key]) # your value lives at data[key]Use cases
- Fetch a level pack on demand.
- Pull event config that is not auto-downloaded.