FANDOM


save [filename]

Saves the current cartridge to a file.

filename
The name of the cartridge file. If this is @clip, the cartridge data is copied to the system clipboard instead of saved to a file.

If the filename ends in .p8, the file will use the .p8 file format. This file includes the source code, sprites, map, sound effects, and music data.

If the filename ends in .p8.png, the file will use the .p8.png file format. The PNG image looks like a game cartridge, including a label with a screenshot and title.

If you use @clip as the filename, Pico-8 will save the contents of the cartridge to the system clipboard instead of to a file.

Setting the label Edit

When saving as a .p8.png file, Pico-8 generates a cartridge label. This label can include two lines of text and a screenshot image.

To set the text of the label, put two lines of comments at the top of the source code:

-- game title
-- by author name

To set the screenshot, run the game, then press F7 to take the current image. The label will use the most recent screenshot when you save the cartridge.

The compressed code size limit Edit

Pico-8 uses compression to reduce the size of the source code when saving as a .p8.png file. The compressed code size must be under a certain limit (15,360 bytes) for the save to succeed. Use the info command to see how the code size compares to this limit. If you save to a .p8.png file and the compressed size exceeds the limit, Pico-8 prints an error message.

You can save and load a cartridge whose compressed code size exceeds the limit using a .p8 file. This allows you to save your program in progress before reducing its code size for publishing as a .p8.png, if necessary.

Saving to the system clipboard Edit

You can save the contents of the cartridge to the system clipboard by specifying a filename of @clip:

save @clip

The format of this value is designed to be pasted into a Pico-8 BBS message. It is delimited with [code]...[/code] and contains a hexadecimal representation of the cartridge. (This is *not* the same format as a .p8 file.) When you paste this into a BBS message, it is replaced with the cartridge running in the web player when the message is viewed.

Examples Edit

At the Pico-8 prompt:

> save mygame.p8

> save mygame.p8.png

> save @clip

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.