This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I'm getting a parser error and I don't know how to fix it

onready var names = SaveFiles.names

onready var current = SaveFiles.current

func ondone_pressed():

if current == "user://":
    names.1 = $TextEdit.text
elif current == "user://":
    names.2 = $TextEdit.text
elif current == "user://":
    names.3 = $TextEdit.text
elif current == "user://":
    names.4 = $TextEdit.text
elif current == "user://":
    names.5 = $TextEdit.text

'names' is a dictionary in an autoload and the names functions are for saving them but I think they are irrelivant.

the line with the error is 'names.1 = $TextEdit.text'

pls help

Godot version 3.44
in Engine by (24 points)

1 Answer

+1 vote
Best answer

I think those numeric dictonary keys are causing some confusion...

Try this syntax instead (for example):

names[1] = "..."

by (22,704 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.