EXPORT_MULTICART


export gamename.html file1.p8 file2.p8

or

export gamename.bin file1.p8 file2.p8

This command is used to export your game as a standalone .html or .bin file, with the data of up to 16 other .p8 files. Those multicart files must be locally stored and referenced correctly in the export command.

For example, if you have organized your multicart folders like this:

carts
   main.p8
   multicarts
     cart1.p8
     cart2.p8

Then you will need to export them with the folder names:

export main.html multicarts/cart1.p8 multicarts/cart2.p8

Or you can load the main cart, change directory to make your multicarts folder active, and then export without the need for the folder name.

load main.p8
cd multicarts
export main.html cart1.p8 cart2.p8

(The names of folders and files used here are purely for example and you are free to name them however you'd like.)


To change between carts, you can load one of the other carts in your game code with, for example:

LOAD("cart2.P8")

This also works for loading specific sprite sheets, maps, sfx, or music from other carts. See Reload.


Note: The exported multicart will not be able to load from the BBS using load("#bbs-game")


The multiple files are condensed within the usual standalone files, not as separately referenced files. For the HTML export, the JavaScript file will list each cart name in its first line:

var _cartname=[`main.p8`, `cart1.p8`, `cart2.p8`];


The main cart and multi-carts are all stored within the cartdat variable:

var _cartdat=[ ... ]


499

16 Jun 2023

Font