Log In  

When I tried to use the flag for exporting when calling pico8 from the command line :

pico8 usas.p8 -export usas.p8.html

I get ths error message

"please capture a label first"

Is it possible to export an image from the command line, it works if I press f7 in pico8, make a capture and manually export. But I would like to script this and export the html headless.

Second question, is it possible to use another HTML template or alter the default one, so I could add initial javascript ?

P#144821 2024-03-28 11:54

I could be wrong about this, but I don't think headless label capture is possible because it wouldn't know what to capture.

You can definitely edit the HTML & JS files though, they're just like any other HTML/JS. You could probably create your own, but honestly there's so much generated code in the HTML, you're better off just modifying the generated one.

P#144832 2024-03-28 12:29

you can capture a label with F7 or code (extcmd("label"))

the proper way is to have the label saved in your P8 cart, so that all versions have it
(there are also other techniques to import a label from an existing png – search this forum!)

to customize html exports: https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Web_Applications_
people use this to add networking (with the gpio memory that’s accessible from javascript code), add a CRT effect…

P#144844 2024-03-28 14:42 ( Edited 2024-03-28 14:44)

Thanks for the replies,
What I'm trying to do is indeed add debugging through gpio, so then I have to run pico8 as a js file. @merwok, this seems to work, I'll try that. I would have to lookup how to "label saved in your P8 cart"

P#144977 2024-03-29 13:48

run P8 cart, press F7 or use extcmd (or other harder techniques), save P8

then you can run headless export commands (modulo known bugs with headless mode…)

P#145247 2024-03-31 14:34

@merwok. Thanks that worked! Think I forgot to save..
/ now looking up extcmd.. :)

P#145371 2024-04-01 14:57

ah okay: this..
https://pico-8.fandom.com/wiki/Extcmd

Also trying this, same similar, but different
https://www.lexaloffle.com/bbs/?pid=81260#p

headless , I have this thing in my mind where I want to export the js file on run, and use the gpio pens to get debug information and print them in the console of the window ( instead of using printh )..
Second try would be an overlay on the canvas with debug info.. just because

P#145372 2024-04-01 15:00

[Please log in to post a comment]