#SilentWolf difficulities .

2 messages · Page 1 of 1 (latest)

minor zenith
#

Help please.. So [I'M PRETTY SURE I'M DOING SOMETHING TERRIBLY WRONG]
Anyways.
on my game, i want to make a Leaderboard.. which Works.. But only in Engine.. my code is kinda mess but it does work In Godot.
but once i export the game on html or windows it doesn't work..
i'm using SilentWolf database for it.

here's my set up for the er.. Leaderboards.. death_screen -> leaderboards -> leader_board.gd
here's the code:

extends Control

@onready var list: VBoxContainer = $List

var max_entries := 5

func _ready() -> void:
    call_deferred("_load_scores_deferred")

func _load_scores_deferred() -> void:
    await get_tree().process_frame
    await get_tree().create_timer(0.05).timeout  
    await load_scores()

func load_scores() -> void:
    var sw_result: Dictionary = await SilentWolf.Scores.get_scores().sw_get_scores_complete
    var scores: Array = sw_result["scores"]

    for child in list.get_children():
        child.queue_free()

    for i in range(min(5, scores.size())):
        var entry: Dictionary = scores[i]
        var entry_label := Label.new()
        entry_label.text = str(i + 1) + ". " + str(entry["player_name"]) + " - " + str(entry["score"])
        list.add_child(entry_label)

Also. i'm preloading SilentWolf and i have set everything there normall (or i think i did)

basically my code for leaderboards works on Level_1.tscn ..

pls help?..

here's the red carpet as well

timber jacinth
#

No idea, looks like the SilentWolf addon isn't there or the rest of your code isn't able to find it to load it in.