Skip to content
Sign upLog in
← Back to Community

How to implement a save/load system to a game?

Profile icon
mkhoi

I am making a game and want to have a save/load system because it is frustrating without the save/load system (its a long game and also it has permadeath but if i have the save/load system it won't have permadeath)

Check it out:
The Wacky Warrior, its on Challenge

Someone please help me!!!

Answered by ash15khng [earned 5 cycles]
View Answer
Voters
Profile icon
iamquinnzhao
Profile icon
LeoXu2
Profile icon
PXY
Profile icon
Zolicrafting
Profile icon
Animator282
Profile icon
PAULX
Profile icon
mkhoi
Comments
hotnewtop
Profile icon
ash15khng

You could let the users download a file, with their progress in it (to save), and add a load function (to load the text in the file).

Profile icon
mkhoi

@ash15khng
What is the specific instructions for that?

Profile icon
ash15khng

@mkhoi
You could create a JSON object or whatever you want, then write it into a file like this:

save = <whatever you need however you want to save it> with open("file.txt", "w") as f: f.write(save)
Profile icon
mkhoi

@ash15khng
I'll try it out

Profile icon
mkhoi

@ash15khng
What about the load function?

Profile icon
ash15khng

@mkhoi
You get it as an input, then save it to your variable(s).

Profile icon
mkhoi

@ash15khng
I dont understand that. How do you do that?

Profile icon
ash15khng

@mkhoi

load = input("Save string: ") load = <however you're saving your game data>
Profile icon
mkhoi

@ash15khng
ok...

Profile icon
kwambugu17

@ash15khng
what does the f do i dont really get it

Profile icon
ash15khng

@kwambugu17
f is just a name for the file object that we are using so later we can call it using f.

Profile icon
PAULX

at python you can make it with the modul "repl.it" i don't have use this module ever but i have see it in codes from other peoples. as fare as i know it asks you about your replt.it name and password.

Profile icon
mkhoi

@PAULX
I want to save a game character or whatever but interesting information though

Profile icon
TheDrone7

You will need to setup a database, if you're familiar with JSON format of data storage then use mongodb otherwise you can also use some or the other distribution of SQL. You won't be able to save data on files in repl.it

Profile icon
mkhoi

@TheDrone7
Guess i will need to learn that...

Profile icon
TheDrone7

@mkhoi
if you're going for mongodb then it's going to be very easy to learn how to use the DB, although it won't be that easy to connect your DB to your app but it's not very difficult either.

Profile icon
mkhoi

@TheDrone7
Thanks for the tips!

Profile icon
SergeiMomontov

One of India's #1 celebration games, Adolescent Patti is likewise accessible to play on the web. You can undoubtedly find numerous product suppliers making new variations of this fascinating game. Adolescent Patti is otherwise called flush or blaze in other gaming terms. Youngster Patti is a social game played during the family get-together. The game is played really during the celebration of lights, Diwali. The most charming Indian game is High schooler Patti right here https://spinsvilla.net/casino/4rabet-india-review/ . Prior, it was played by setting the cards, and presently the web-based adaptation has ingrained greater fervor inside the fans around the world.

Profile icon
mihailza

Professionaalne online kasiino meeskonna valik. Tulge sisse ja vaadake ise.

Pole ime, et iga päev ilmub uusi online-kasiinosid https://kiirkasiinod.net/casino/winnerz-kasiino/ , sest online-hasartmängutööstus on juba üle 10 aasta olnud üks kiiremini kasvavaid ettevõtteid maailmas.
Meie meeskond on testinud ja läbi vaadanud rohkem kui 100 suurimat Eesti online-kasiinot ning hinnanud neid nende mängude valiku, tervitusboonuste, pakkumiste ja regulaarsete kampaaniate, mobiilseadmete ühilduvuse ja live-teenindajate mängude järgi.
Kõik, mida näete meie ülevaadetes, on meie meeskonna raske töö tulemus. Kõik see selleks, et säästa oma aega! Meie hinnang aitab teil leida parima Eesti online-kasiino, mis sobib teile.

Profile icon
Masonwilso

Прикольный челендж, но еще прикольней live casino https://onlinecasinohub.com/au/live-casino/

Profile icon
BetVill

Very interesting challange and really gave it a try. I recommended it to my friends, too. I can tell you that https://casinowis.com/book-of-gates-slot Not inferior to your games. After all, this is the choice of Australians in 2022!!! Please note.

Profile icon
JackKok

Hey , everything relies upon what you need a video card for, if for games or work in complex editors the 8500 GT is great. However, it's not worth pursuing superior, in the event that you need a video card for simple web based games, incidentally, there are a great deal of audits of stages for internet games on this entryway http://newcasinos-au.com/, focus.