Godot tutorial help

Godot Version

4.6.2

Question

Hello again!

I am following this (https://www.youtube.com/watch?v=8U9BVvvhEhw) and anytime I try to fix an error, 5 more appear. I am new to Godot so I have no clue what is going on here. Can anyone point out what did I do wrong and how do I fix it?

Current errors are:

Line 26:Identifier “item” not declared in the current scope.

Line 27:Identifier “item” not declared in the current scope.

Line 28:Identifier “item” not declared in the current scope.

Line 44:Identifier “File” not declared in the current scope.

Line 47:Function “parse_json()” not found in base self.

Line 53:Identifier “item” not declared in the current scope.

for refrence, and this is nothing personal because your new, but putting code in format (using the </> at the top of the screen) would make it way better to read :slight_smile: because right now its really hard, and if you would like faster help that would be your best bet. Yet again absolutely not targetted towards you<3

although, these errors seem to be easy.

‘item’ not being declared means you didnt use an:

@onready var item = (whatever)

at the, preferably because it just makes better sense to put variables there, top of your script. same with ‘file’ (although, im assuming youre trying to call a scene with this. that means you would have to do something like so:

@onready var file = load(#string name here, dragged into the paratheses, should show up looking like a file name, with the paths to the file)

The not found in base self error is because you need to declare a new function like so

func _ready():
pass #whatever it is here

func custom_function():
pass
#whatever you want this to do here and then you need to call it somewhere

I would also provide the name of the video as well so i can help you better.

and, if this is your first project, I would recommend doing a simpler project/tutorial than the one you’re doing right now. Don’t just jump straight into it, i made that mistake and it doesn’t help.

One tutorial that really helped me was How to make a Video Game - Godot Beginner Tutorial by Brackeys (https://youtu.be/LOhfqjmasi0?si=i8rd_q9u-M3WAfqX should be it). Its pretty simple and leads you through all the basics for a 2d game. And its way more beginner friendly than what I see you trying to do right now. Plus, he explains WHY things work, and you need that for all this hard stuff. Obviously there could be better tutorials for your learning style, this is just the one i learned before fully diving into godot.

Hope that helped :smiley:

You have some typos. Like your variable “item” is spelled “tiem”. Give it a proper read through.

Thank you so much for your help! The name of the video is “How to Create a Simple Quiz Game With Godot | PART 2 (END)” by LightDevs.

Okay yeah, that seems like a second or third type of project for when you understand the basics of godot (i just clicked around though :D). I wouldnt be dealing with json files first time, although im not sure what more experienced devs would say about that just because im def not up to that level yet. There’s also plugins that are easier to work with for a beginner if you want to make a puzzle game like that (I would say dialogue manager because I know you can do some sort of karma system with it, which is used in some puzzle games, although its not built for a full fledged puzzle game like that. Im sure theres ones specifically built for that).

But yeah no problem<3!!

This video is for Godot 3.5, so some symbols have been renamed, like File is now FileAccess, and how to call it may behave differently, for example instead you should prefer var file := FileAccess.open(filename, FileAccess.READ).

Others have mentioned that you seem to have mispelled var item as var tien.


Make sure to paste script instead of screenshots