Log In  


Just wondering if there was a method of creating save files, obviously to keep players data like progress in a cartridge, I mainly want to add a scoreboard system in my game that saves data through multiple sessions.
any help appreciated :)

2


see dset/dget in manual - these are the functions to save game state/scores.


It's called persistent cart data or cartridge data - there's a section in the manual about it that talks about the basics.


thanks guys! :D


Why does no game use that? Haven't found one yet at least. :(


Many games use it! That’s how puzzle games keep track of the levels you have unlocked (example: Cake Monsters), or other games keep track of inventory (Mai Chan's Sweet Buns).

Other games are meant to be played in one session (X-Zero), so they don’t save anything.


I tried ESC (ingame in Celeste)
save progress.p8 (Enter)

... but I don't think it works.


2

@Tarik My game uses it. It's called Orbital, and has a save system that saves all kinds of data for reload. It even contains some functions for saving up to 32 booleans to a single number value. Since dset can save up to, I think, 64 values, this function can allow you to save up to 2048 on-off switches (true-false values).

@dfilskov That's how you save a Pico-8 file you are working on, not your game progress. In order to save game progress, the creator of the game, or you if you have access to the code, has to create a function that uses dset() and dget() to save certain values to the cart, then reload them in-game. I'm not sure if Celeste has that feature.


@UnitVector - Thanks! - that's what I
"feared". I thought that all carts came
open source with the code freely
accessible (by tapping ESC).

I've tried Orbital now on the web but I
couldn't find a save-state/game option.
It makes sense, though, if it's only
available in a normal Pico-8 engine :)


@dfilskov
I don't think you understood me. All carts do come with open source code. The method you described is how to save the code. We are talking about saving in-game progress, like saving that you are on level 3 and have 1000 points so you can continue from there next time you play.

My game does have that. While playing it, press "Z", then go to option and press "save game". There's also a "continue" button on the main menu, and it also auto-saves, with a pop-up saying "game saved", as soon as you finish watching the intro. I don't understand how you could have missed all that.

If you are trying to save the cart to your computer, click the tiny image of a cartridge at the bottom left of the game window, then save the png image that pops up. Then open this in your Pico-8 program.


Thanks! - That's cool. Where is the progess
saved?

I'm quite new to pico-8 and have only tried
connecting a keyboard once to tap Esc. But
I didn't see any code. Just a prompt. And
the saved .p8 file didn't show code when I
opened it in a text editor I think so I
figured it was binary.

I didn't go into Options the first time
around and was looking at the "main" menu
for save game:


@dfilskov It's saved in pico8>cdata, the cartdata("string") will create a string.p8d.txt file.
reminder you can use folder in the command line to bring up your application support folder or whereever if you don't know where it is.


Escape goes from game to command prompt, press Escape again to go from prompt to editor!

Games from the BBS are saved as PNG. From pico-8 itself you can load one and save as P8, which is a text file.



[Please log in to post a comment]