Log In  

Hi there,

I wrote a script which helps to write lua code in an external editor. The script listens to changes in the .lua file and re-integrates the lua code back into the .p8 cartridge. Each time you save.

So you can happily change lua files and edit assets in Pico-8 and everything gets merged back as soon as you save. Write some code in your editor, switch to Pico-8 and press ctrl-R to reload. It's quick :)

Works great for me in Intelij Idea, where I have syntax highlighting, code analysis and code completion. When trying to call a function, the IDE even shows the function parameters and lua-doc. What more can you ask for?

Some other things the script can do for you

  • include library code (#include library)
  • remove debug code on release (#define debug, #if debug, #end debug)
  • strip comments if you hit the size limit (please consider that comments are helpful for the Pico-8 community ;))
  • convert pico-8 specific statements like += to plain .lua. Some IDEs might work better with plain lua.

That's it, hope you like it. Download it here:

https://github.com/sulai/p8lua

Have a look in the python file, there is more detailled und up to date instructions on the features.

PS: one down side though: the script works for Linux only at the moment, since it uses pyinotify for getting notified about file changes. I'm happy to accept pull requests if you want to port it to windows, maybe doing polling on the .lua files.

P#43725 2017-08-29 07:30 ( Edited 2017-09-07 03:59)

Interesting. I currently use an atom package to enable p8 syntax highlighting and more on .p8 files

P#43728 2017-08-29 10:26 ( Edited 2017-08-29 14:26)

I tried to use atom, too, but I wanted to see the function parameters and possibly lua-doc as a tooltip while doing auto complete. That's why atom didn't work for me. Can't work without that context at my finger tips ;)

P#43731 2017-08-29 11:59 ( Edited 2017-08-29 15:59)

Watchdog does cross-platform file watch notifications. I've used it for stuff, though I haven't tested it on Windows.

picotool can build .p8 and .p8.png files from multiple files, including folding a Lua source file into an existing cart with images, etc. I'll add a feature request for a watch mode, good idea!

P#43976 2017-09-06 23:59 ( Edited 2017-09-07 03:59)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 20:40:57 | 0.006s | Q:14