#Important plz help

110 messages · Page 1 of 1 (latest)

white anvil
#

I have created a level transition system in my game and I made it an autoload so I can access the script from anywhere. Although when I call the function I have inside there to smooth change from a scene to another at the start it works fine but then the looping part doesn't and brings an error. E.g. I am calling the function from the main menu to options menu and the backwards and it works fine. But when then I press the options button again to go to options menu second time it brings error. Plz someone help me I need to finish this part today. I can send more pictures if anyone wants.

onyx cosmos
#

Hello 😊
After run your game from the editor, on the left in the inspector, you have a button "remote" to see the state of your tree in real time.

left thorn
#

@white anvil Also, it would be good to see more detail like what happens inside SceneTransition.change_scene(), as well as what the setup of your options Scene is.

#

The reason I ask is that the errors at the bottom of the screen seem to indicate that one of your packed scenes is not being found and/or a method in it can't be found.

white anvil
#

Ok one moment

#

I will send more

#

Now it says my main is is corrupted wtf wait

#

Ok fixed that one

#

Options menu

#

And scene transition as an autoload

#

I got this method from a yt video btw

#

The video was a bit older and it was using yeald instead of await so I changed it a bit

#

Also it was using only change_scene not change_scene_to_packed

#

And the target was String

#

So I modified those

#

Idk I might messed up

white anvil
#

@left thorn if you can plz help me

#

Basically the menu scene doesn't work right after going back there from the options scene

onyx cosmos
white anvil
#

It just shows that from menu we go to options and then menu again

#

What am I suppose to see there

left thorn
#

@white anvil Does the menu scene have code in the _ready() function? If yes, note that the _ready() function only automatically runs the first time the node is added to the scene tree. Normally when re-adding a node to the tree you call Node.request_ready(), but I'm not sure how to do that when using get_tree().change_scene_to_packed().

white anvil
#

So no the menu scene has a ready func but I am only changing the background colour there

#

Also I don't need it anymore since I have a picture behind

#

Wanna send that too?

onyx cosmos
white anvil
#

Main scene

white anvil
#

Not the first time

#

The second time

left thorn
#

@white anvil In that case it is probably caused by something else. Let me think about what that could be.

white anvil
#

Basically going from main scene to options and then back works fine

#

But after that

#

If we click again options

#

Or play

#

It gets f up or something idk

white anvil
#

Also quit button doesn't work either

#

The second time of course

left thorn
#

@white anvil So if I understand correctly, you can use the main menu scene one time, but when you go back to it a second time none of the buttons in it work?

white anvil
white anvil
#

First two errors are there tho idk if that's a problem

#

I searched a bit I don't think the first two errors matter

#

Anyway

left thorn
#

@white anvil So the quit button doesn't involve a scene change at all, and it is also broken. This makes me think that the signals between your buttons and the menu script are broken once it is reloaded. But I don't know why that would happen.

white anvil
#

Yea true

#

The code seems fine but

#

Maybe something interapts them idk

#

Quit button also gives same error

#

I can show if you want

#

Here

#

All buttons

#

All three

#

The rest of the game works fine I think but let me check really quick

#

Yea

#

It works

#

But

#

Basically when I go to end menu

#

And I go back to main Manu then still doesn't work

#

Going back and forth to control scenes messes it up

#

Idk

#

Maybe

#

I could do change scene to file and not packed?

#

Should I try that?

left thorn
#

@white anvil I'm honestly not sure. It might be worth a try. It almost looks as though the script attached to your main menu scene goes missing the second time you load it. But I don't know why that would happen, or if that is the true cause of the problem.

white anvil
#

Ok wait

#

I will try that really quick

#

Tried it

#

Still same problem

#

What does it mean calling from signal to callable

#

What is callable

#

It doesn't recognise the signal or something

left thorn
#

@white anvil As far as I know a callable is basically a function/method, and it looks like it doesn't recognize the method not the signal.

white anvil
#

The method here in my code is?

left thorn
#

"_on_play_pressed()", "_on_quit_pressed()", etc.

white anvil
#

Hmm

#

I tried recreating the buttons still doesn't work

#

Could I do the level transition with an another way maybe idk

left thorn
#

Perhaps try this. While the game is running, go to the scene tree on the left-hand side of the editor and click "Remote". This should show you what nodes are present in your scene at the current moment. While the menu is open, click on the "Menu" scene in the scene tree and see (on the properties editor on the right) if it has a script attached. Then close and reopen the menu and check again. At least then we will know whether or not it is a problem with the script not being loaded.

white anvil
#

Alright wait

#

Wdym on the menu scene in the scene tree?

#

Ohhhh

#

Nvm

#

Ok good

left thorn
#

I have to do something, but I will try to think about this problem more in a little while.

white anvil
#

Oh true it doesn't have

#

Wtf

#

Ok

#

I also have to do exercise a bit

#

How do I add script there tho?

#

Anyway cya when you can

#

Also thanks for helping

#

Also I found this idk if it helps

left thorn
#

So the question you found has to do with pausing the game. The idea is that when you pause the game, make sure you don't also "pause" the menus themselves or you won't be able to do anything. However I don't think that is your problem, especially since you said earlier that the script for your main menu scene doesn't show up when the game is running (I think). I'm still not sure how to fix it though.

white anvil
#

Yea I just sended it

#

But yea thats what happens

#

Do you know where I could ask for more help abou this ?

left thorn
#

You could try looking on the Godot subReddit.

white anvil
#

Which is?

left thorn
#

Pretty sure it is r/godot

white anvil
#

Oh to reddit

#

Ok

#

Thanks for your time man