Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

i get this error when trying to raise the children 

SCRIPT ERROR: babyage: Invalid set index 'name' (on base: 'Nil') with value of type 'String'.
          At: res://files/scripts/Mansion.gd:2614

seems to relate to this line of code

baby.name = get_node("birthpanel/raise/childpanel/LineEdit").get_text()

not sure what or if anything is wrong with the code as i'm a dumb noob but hope this helps

(1 edit)

Every detailed report helps when tracking down problems. If you could share the save file with this error, either here or on Discord it would help with understanding how it happened.

I can give a quick breakdown what the error message means, though it seems you figured out parts of it. "babyage" is the function where the error occured. "Invalid set index 'name'" means that it tried to find the contents of a variable named 'name' but that variable did not exist. "(on base: 'Nil')" means that the object that it tried to search for the variable didn't exist. "with value of type 'String'." means that it tried to replace the contents of the variable with text.

To sum it up, it failed for the same core reason as above. The function assumed that it would be given a baby's data, but when it tried to use that data it found out that it didn't actually exist. It's a bit like a student going to school, but not bringing the assignment to turn in. Now we are trying to figure out whether that student did the assignment but forgot to bring it to class, did the assignment but the dog ate it, or never did the assignment.
Edit: minor inclusions