tiled-pico8 icon indicating copy to clipboard operation
tiled-pico8 copied to clipboard

awkward workflow for simultaneous editing (both pico8 and Tiled)

Open pancelor opened this issue 1 year ago • 2 comments

This happens to me often enough:

  1. I open a p8 cart in pico8
  2. I open the same cart in Tiled
  3. I edit some non-map data in pico8 (sprites, music, etc)
  4. I edit the map in Tiled, and save it
  5. My edits from 3 were overwritten!

This can be avoided by adding extra steps after 3: 3.1. ctrl-S in pico8 to save the cart 3.2. ctrl-R in Tiled to load the cart

But it's a bit awkward. Would it be possible when saving from Tiled to re-read the pico8 cart and only edit the map? That would eliminate the need for step 3.2.


Having written this up, I've realized that step 3.1 will still be necessary, so this probably isn't actually a very helpful suggested solution. Maybe what I want instead is to be able to save the map to a custom .txt format that I can #include and then parse during game startup...

pancelor avatar Jun 28 '23 06:06 pancelor

Alright, I got it working! The workflow is much nicer for me -- no accidental overwriting or pico8 saying "didn't save; conflicting external changes" anymore. But it's pretty janky; the user has to create a .p8l file beforehand with the exact right info in it, and Tiled only knows how to load the sprites by reading an absolute path from a comment in the custom .p8l file... it's a bit of a mess. I think I'll make a separate repo for this

pancelor avatar Jun 28 '23 13:06 pancelor

Yeah, unfortunately the workflow you aim for can’t really happen without some additional help from PICO-8. Maybe Zep would agree to implement some kind of interval-based autosave feature?

If you are running Windows, another, maybe less intrusive solution, could be a AutoHotKey script that detects whenever PICO-8 is about to lose focus, or Tiled gains focus, and sends PICO-8 a Ctrl-S keystroke. Not sure if this accounts for all situations, but it’s probably the approach I’d try.

samhocevar avatar Jul 05 '23 16:07 samhocevar