ConfigFile.get_value() returns null every time

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lance Fusion
:warning: Old Version Published before Godot 3 was released.

Every time I try to use the ConfigFile.get_value()-function it returns null for no apparent reason. Code is like so:

    var loadgame = ConfigFile.new()
	loadgame.load("user://savegame.save")
	var player_name = loadgame.get_value("general","player name")

I also get a very weird error: Condition ' value[p_section].has(p_key) ' is true. returned: p_default

Isn’t that telling me that a value was found but for whatever reason the default value was returned anyway? It does in fact return the default value, I checked that by changing it.

Thanks in advance for the help.

Sorry for wasting your time. Answered it myself: a section key cannot have spaces, apparently (although I think I’ve seen that in examples).

But if anyone is up to it, what is that error telling me exactly? Just interested.

Lance Fusion | 2016-09-21 12:46