0 votes

None of the tutorials I saw, or the documentation works! I've got 4 days to finsh the game and i'm stuck!

extends Control

func _on_new_game_pressed():

    get_tree().change_scene("res://main scene.tscn")


func _on_quit_pressed():
    get_tree().quit()

Ive got a load button too but it does nothing

in Projects by (63 points)

rip, you won't make it, better luck next time

Since you are in rush , I will suggest making a script for each button and put this script inside :

extends Button

func _pressed:
   #Whatever that button does

other wise you might need to check what @GameVisitor said in the answer below

hello! just as I said earlyer to @GameVision, my problem isnt acctivating the buttons. its the save system

1 Answer

0 votes

Did u make sure to properly connect the "_pressed" event virtual function of button class to your function _on_new_game_pressed so it gets called ?

Here is a signal introduction sample.

Good luck !

by (836 points)

hello! I know how signals work! That is not my problem right now! I cant actually make the save function. ok so let me put this into words.
So when the new game button is pressed it sends you to the first scene.
But what I want it to do is create a new file.
I want to make a save button that overwrites the information in the file. saves the level the player is on.
The load button will search for the file and restore it.
I know how it should work but not how to write it... if you know how i could do this i'd apreciate your help. if not, that's ok too!

theres a bunch of tuts on yt how to implement save & load system via json file, and they work. Check GDQuest channnel, it will be faster for you then to wait for explanation here

to little info on the problem, you should be more clear stating what the real issue is in future.

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 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 webmaster@godotengine.org with your username.

Categories