(GAME JAM, URGENT) New game/ Load buttons

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Anastasia

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

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

zen3001 | 2020-01-05 20:54

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

Xtremezero | 2020-01-05 21:44

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

Anastasia | 2020-01-06 10:15

:bust_in_silhouette: Reply From: GameVisitor

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 !

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!

Anastasia | 2020-01-06 10:13

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

dejo095 | 2020-01-06 13:04

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

dejo095 | 2020-01-06 13:04