I've made a little tool (Windows only) that helps saving time and keeping organized when working on bigger pico-8 projects. It might be useful to some of you so I'm sharing it here on my blog. To see what it does and does not do, please read the blog post before downloading.
UPDATE: P8Coder is now open source P8Coder on GitHub
Nifty idea. I installed it but when I create a new entity, it adds a question mark to the function names, like upd?() and drw?() which P8 does not like.
And when I add a sub-entity, the resulting function is just the parent entity name, also with a question mark, so it keeps breaking.
I'm running it on Windows10, if that helps.
I dig the idea and can see how having all things in tabs would be a great way to help organize. Keep it up.
Looks nice! This seems like it could be a really useful tool, especially if you added sprite/map and maybe audio editing. What language did you use to write it?
@morningtoast: that's by design. It creates only a function stub for you. The questionmarks (or the whole function name or everything depending on how you use it) are to be replaced by you.
@Ivoah: I will add a panel for sprites and map of the cart but only for reading (to get sprite indices w/o loading pico-8) not for editing. The compontents for this are already done for a different tool. It's written in C# .net.
I downloaded it and find it very useful ! I'd say even for not-so-big projects.
The possibiliy to view the sprites+indices and map is great.
Another great feature would be live coding :) If I'm not wrong PICO-8 reloads the code automatically when the cart is edited from an external text editor. So if you don't "block" P8Coder while using PICO-8, perhaps live coding would be easy and no need to reboot the cart each time ?
The only problem would be not erasing the updates made in the cart by error (sprites or maps or sound), if a save was not done by the user before editing the code. I suppose you blocked the "live" feature for this reason ?
What do you think about this ?
Thanks for your comment. PICO-8 does not reload automatically but you can make it reload and run with CTRL+R. I will make an update soon that leaves P8Coder unlocked while PICO-8 is running - that's better in any case. Yes, if changes on cart data are not saved (CTRL+S), they are lost but that's always the case so I think it's acceptable.
The update including sprite picker and other visual helper tools is coming tonight.
Good job on this tool, i'm enjoying using it so far. Only thing I'm missing so far is doing quick searches using ctrl-F3 and then doing F3 and shift-F3 to go to the next and previous found string respectively.
Also waiting on the next update myself! :)
updated p8coder; it now has a spritesheet viewer; fixed several small bugs (one concerning undo was critical). working in p8coder while pico-8 is running is possible now (not blocked anymore). sorry for the delay; I'll add search features when I have time. have fun!
Your program will not load my p8 code. Here are the functions in it currently:
function main()
function pst8(h,v,x,y)
function pstxy(h,v,x1,y1,x2,y2)
function pst(h,v,x,y)
function fnr(x)
It does not use functions, "_Init" "_Update" or "_Draw."
dw817: Please read the description carefully, especially the "WARNING" section.
Which license is it, and can we get a LICENSE file for the repo? IIRC you can also configure the repo with the license and Github will display it in the top bar.
Thanks for all your work on this!
New release 1.2 today. Added a dialog for pico-8 launch parameters and a button to save the spritesheet as png.
Cool. I missed this before so I am going to give the 1.2 release a try. Looks nice and clean and simple. I normally code right in the pico8 editor, sometimes just pull it into notepad++ so maybe this is a good middle. The entity tree is nice. Thanks for your work.
You say look at the WARNING section but why would this screw a .p8 file up with custom function names. That just doesn't make sense at all.
Why not just import the file with its own function names instead of screwing someones code up???????
Normally I don't start a new pico-8 project with code I already have in a p8. In my workflow, I don't write any code in pico-8, I copy/paste existing code from other P8Coder instances/projects if needed. I use pico-8 for art and music.
I don't understand what you mean by "custom function names".... you can name your functions whatever you like.
I've tried to put the warning everywhere necessary (right above download-sections on my blog and on github). Sorry if you've lost code ... The tool is out for 2 years now - so far you are the first complaining about this behaviour. P8Coder does at no time import code from anywhere. P8Coder overwrites all code of the cartridge you select.
Speaking about "screwing someones code up": Note that P8Coder makes everything lower-case on build - so you can use upper-case characters in your code if you like.
If you wish to have an import-code-from-cart feature, I can add it if you ask nicely - or you pull-request your fork on github.
Updated to 1.4. Fixes loading carts made with latest versions of pico-8 (p8 only contains data different from default state)
https://github.com/movAX13h/P8Coder/releases/tag/1.4
Have fun!
Amazing ♥
This is something I was looking forward, and then just found it.
A couple of suggestions (and keep in mind that maybe I'm just using it wrong)
-
There's this little problem with p8's line numbers on error reports, which (obviously) correspond to the merged file generated by P8C but then have no relation to what you see on the editor (of course, you could still track the error following the stack). It would need to keep track of the resulting position for the each/current view/editor (Entity->function->editor) on the merged file so that it shows that position as the first line number on each corresponding editor. While at it, it would be nice to implement a "jump to line" function that switches to the propper Entity->function
-
Would be very useful to have P8C variables inside the code and just pass everything through a regex while mergin. It would allow me to code something like this for instance...
__#{function}()
#{entity}:#{function}()
#{entity}:someOtherStuff()
assuming an entity MyEntity and a function myFunction, that would translate to (on the merged file):
__myFunction()
MyEntity:myFunction()
MyEntity:someOtherStuff()
Can't think of much use for the function name variable right now, but the entity name is very useful for class/metatable names
edit 1: it would be nice to also have this variables and entities/functions references globally instead of just locally (to each view Entity->function), but that's slightly more work and probably requires to ask the user for a variable name / global identifier when creating and entity
-
Would be nice to have an option to just get the code instead of "build & run", it's the default behavior when no cartridge is selected, but once a cartridge is selected, couldn't find a way to get the code and/or deselect the current cartridge
edit 2: actually you do have the resulting merged code on the selected p8 cart, still would be nice to get it on clipboard or whatever instead of "build & run"
-
Would be nice to have a config option regarding lower casing
edit 3: actually my very first experience with P8C was a (previously) working project that wouldn't work on P8C, having some problems with an undeclared global _MOUSE and stuff like that that simply made no sense because said globals where there for sure. That brought me to the "need to see the merged source code to have a clearer idea of what's going on" point, and that led me to how much you may need to actually control code casing. Problem was (of course) that _MOUSE got lower cased by P8C, but the src code for that was on a library included with #include, so P8C didn't touch that code, so I got a global _MOUSE from the library, and a (non existant) global _mouse from P8C (temporarily fixed this importing all libraries used to P8C so that they get lowercased as well)
- Would remove any and all placeholder/default/example code when creating entities/functions
Would give you a hand with any of this just as soon as I get to compile your project ;)
And again, thanks, really nice work ñ__n
Sorry I'm late with my response. I like your suggestions. Feel free to modify the program, it should be straight forward to load and compile it in Visual Studio.
I would use a different P8 coder if only it would run as quickly as the main IDE does when you press CTRL+R. I realize this one does not, yet perhaps in the future someone can ?
[Please log in to post a comment]