Loony Lips Lesson 20 Error

I’m getting an “Invalid index set” error in the Loony Lips Lesson 20 (3.1 Godot) when i try to run the program. I’ve been following along and making the changes up to 11:58 in the course video. Retracing my steps hasn’t turned up any errors that I can find.

My program keeps complaining that current_story is Null and won’t run past line 32 in debug mode

(and yes, that “prompt” is “prompts”; I did not adjust the window over enough to show the s on the end)

Any ideas what could be causing it? I’ve also tried deleting and recreating the StoryBook node and its children, however making new ones Godot seems to remember the deleted scripts and naming schema…

Hi Diana,

I apologise for the delay in a response to your question.
Did you find a solution to this in the end?

@Yann_Burrett Any ideas so i can close this for completeness?

give me till tomorrow, and ill reach that lecture and see what i can come up with,
wondering why im seeing PoolStringArray there, rather than a plain array.

@Diana_Hart have you got a copy of your whole script please.

ok ive managed to recreate the error, hopefully this will sort it @Marc_Carlyon Marc
what it looks like is when the current_story variable is declared, its just declared as a var and so when it comes round to setting it, its not sure what type it is.

to resolve this error, the current story variable declaration at the top of the main script will need to be changed from its current

var current_story

to either using this to initialise an empty dictionary type

var current_story = {}

or a statically typed declaration, which is more a preference thing

var current_story: Dictionary

just so we explicitly tell it what its meant to be, rather than it having to guess.

let us know if that sorts it for you please, as when i made these changes, the errors went away and my code is almost the same with only naming convention differences


1 Like