Log In  

There's some great tips on these forums - One thing i haven't seen people mention is how to get Notepad++ to run a PICO8 cartridge from a button press.

This way, you can code your program in Notepad++, save it, and then run it, all with a few key presses.

  1. Open up a sample P8 file in Notepad plus plus.
    2.Click on the "Run" menu in the top menu bar.
  2. Select the "Run" option (the top option in that menu, perhaps not unsurprisingly)

  3. Cut and paste the below into the dialog box that turns up

"C:\Windows\System32\cmd.exe" /K "C:\Program Files (x86)\PICO-8\pico8.exe" -run $(FULL_CURRENT_PATH)

(this relies on you having installed your PICO8 to the default location. If it doesn't work, find a shortcut to it either on the desktop or the start menu, right click, and "Open File Location". If you change the text, save it in a text file before the next step.)

  1. Test it by clicking on the Run button. It should open up the windows terminal, which will then open up a copy of PICO 8 and autoload the cartridge you have open. I'll explain why you want the windows terminal open below.

  2. If it works, go back to Notepad++. Bring up the run dialog and paste in the text you used before.

  3. This time, click the "Save" button. Assign a shortcut -I'd recommend ctrl + A. It's right next to ctrl + s, which is save, meaning you can quickly save and run your program when there are any changes.

The reason you want to use the prefix "C:\Windows\System32\cmd.exe" /K is that this runs the windows terminal, which then runs PICO8. This means you can see any printh statements you've put in your code for debugging.

One thing to note is that the K switch in the line "C:\Windows\System32\cmd.exe" keeps the terminal open when you shutdown PICO8. This is my personal preference, if you want it to shut when you close PICO8, replace the K with a C.

If you use this alongside the syntax highlighting (go to Settings, Style Configurater, Lua in the top menus and add "p8" in the "User Extension" box at the bottom of the window) and Function List mentioned elsewhere on these forums, you've got a pretty awesome dev environment!

P#27087 2016-08-19 18:23 ( Edited 2017-01-11 12:22)

Thanks for this, I'm currently copying back and forth between sublime text and the pico editor. I'll try this out soon :)

P#35142 2017-01-07 05:57 ( Edited 2017-01-07 10:57)

Thanks, this works perfectly.

P#35196 2017-01-07 19:04 ( Edited 2017-01-08 00:04)

Nifty. Works like a charm...never really used Notepad++ for running anything, not sure I knew that feature even existed.

However, I usually run Pico8, load a cart, then open that *.p8 in an editor. When I save changes, I tab over to Pico8 and just CTRL+R to reload the cart, and it then loads with my changes. No need to rerun Pico8 every time and suffer through the boot sequence.

Only time the risk enters is if you switch into the Pico8 editor, then you have to make sure you re-load it after you edit in your local editor...but for me, I usually do all my sprites/music in batch so I'm not code editing at the same time.

But still very cool that NP++ can utilize Pico8 as such.

P#35212 2017-01-07 23:28 ( Edited 2017-01-08 04:28)

Thanks MT, I didn't know about CTRL+R to reload a cart. Thats even better again.

P#35313 2017-01-09 03:00 ( Edited 2017-01-09 08:00)

also check this up (p8run): https://www.lexaloffle.com/bbs/?tid=28483

P#35355 2017-01-09 12:19 ( Edited 2017-05-04 13:37)

You should be ashamed for using sublime text and not searching package control whenever you think "hm, would be nice if I could do this" :P
Sublime PICO-8 Package

P#35448 2017-01-11 07:22 ( Edited 2017-01-11 12:22)

I copied a cart into my AppData\Roaming\pico-8 carts folder then tried this, but I get a could not load message from Pico-8 on startup - do I have to somehow manage the cart location from in Pico-8?

P#66108 2019-07-26 11:08

I'm sorry it doesn't work with me.
The file doesn't seem to change when I run it from Npp but when I run it directly by double clicking it works.

P#78526 2020-06-25 23:47

yep, gives me the same error. is this a bug or are we just doing this wrong? lol

P#109632 2022-04-03 17:56

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2022-12-07 00:41:59 | 0.007s | Q:21