i wanted to add a console interface similar to the source engine into my game so i can do some nifty stuff but it just tells me this:
and that basically means that it failed to compare the input value with 0 or 1 (boolean)
func _on_line_edit_text_submitted(new_text: String) -> void:
var command:String
var value:String
var totale = new_text.split(" ", false, 1)
command = totale[0]
if len(totale) > 1:
value = totale[1]
$Console/LineEdit.text = ""
if command not in cloptions.keys():
$Console/Label.text = $Console/Label.text + "\n" + "] " + new_text
$Console/Label.text = $Console/Label.text + "\nunrecognized cvar!"
else:
$Console/Label.text = $Console/Label.text + "\n" + "] " + new_text
if command == "cl_viewbob_amp":
vb_amp = int(value)
cloptions["cl_viewbob_amp"] = int(value)
$Console/Label.text = $Console/Label.text + "\ncvar " + "'" + command + "' has been set to: " + str(value)
else:
if int(value) != 0 or 1:
cloptions[command] = cloptionsdefault[command]
$Console/Label.text = $Console/Label.text + "\nfailed to allocate cvar into client options!"
else:
cloptions[command] = int(value)
$Console/Label.text = $Console/Label.text + "\ncvar " + "'" + command + "' has been set to: " + str(value)
feel free to call me an idiot and recommend improvements! thanks
