Log In  
Follow
MBoffin

There's nobody else like me. I checked.

[ :: Read More :: ]

Using window{pauseable=false} in fullscreen apps does not disable the ability to pause by hitting ENTER.

Steps to reproduce:
1) Boot Picotron.
2) Add this code to main.lua (as per the manual):

window{
    pauseable=false
}

function _draw()
    cls()
    print(t())
end

3) Run it.
4) Try to pause by hitting ENTER.
5) Watch in helpless grief as you continue to fail to pause, despite mashing ENTER over and over and over.

Oh yeah, and another thing I noticed. @zep, the Proggy demo is now kinda broken since you can't type anything in the editor window without it popping up the pause menu every time you hit ENTER. (I noticed when trying to use my Froggy app today and realized that would affect Proggy too.)

P#147808 2024-05-03 03:18

[ :: Read More :: ]

I know there is still so, so much yet to add in Picotron, but there are quite a few features PICO-8 has that would be so nice to also have in Picotron. I imagine a non-zero percentage of these are probably already on some official/unofficial/mental roadmap that @zep keeps for Picotron. Nevertheless, I thought I'd list some here just to get them "on paper" and not floating around in my head. Feel free to contribute your own items to this list.

Keep in mind, I have zero expectation that any of these ever actually get added, let alone added soon. So if you decide to contribute to this list, keep in mind the vibe here is more "ooh, that'd be neat if Picotron did this too" rather than "why doesn't Picotron have this feature?!"

  • Ctrl-D to duplicate the current line
  • fget(sprite_num) also supporting the fget(sprite_num, flag_num) overload
  • Shift-Enter auto-adding a closing end and then indenting
  • Having the option to show tab character indicators
  • Alt-up and alt-down jumping you one function up or down at a time
  • Ctrl-clicking a tile in the map editor to replace all instances of that sprite with the currently selected sprite (not the same as the paint bucket)
  • Showing the color number when moving the mouse over a color in the palette in the sprite editor
  • Being able to use the numpad ENTER key and not just the main ENTER key
  • At the beginning of a line, if you hold shift and press the down arrow to select that line, having it select the entire line and the line break at the end, instead of just the text of the line with no trailing line break
  • Having the cursor "remember" what character position it was at as you move up and down lines, even if it moves onto a line without enough characters to go back to the same horizontal position. It's hard to describe, but here's a GIF of what it does in PICO-8 and what it doesn't do in Picotron:

Edit:

  • R to rotate sprites in the sprite editor. Obviously would only work if the sprite was square. But if the sprite wasn't square, maybe swapping the length and width to allow rotation of non-square sprites?
P#147736 2024-05-01 21:22 ( Edited 2024-05-09 00:21)

[ :: Read More :: ]

I usually keep all my carts in a specific folder in Picotron, but it's annoying having to cd into that folder every time I want to load a cart, or type the whole path out. I'd rather just be able to load carts from that folder from anywhere in the filesystem.

So, I made loadcart. It's like load (and even uses load to do the actual loading), but you can run it from anywhere and it'll always load from a folder you specify. (It will default to /desktop if you don't set a folder.)

Let's say /desktop/carts is where you store all your carts. You'd run loadcart -d /desktop/carts at some point to set loadcart's saved folder. Now, from that points on, from anywhere in your filesystem, you can type loadcart mycart and it would be the same as running load /desktop/carts/mycart.p64.

Here's the contents of the .lua file. Just save it to /appdata/system/util/loadcart.lua. When you run it with the -d switch, the saved folder will be set in /appdata/loadcart.pod.

--[[
    For loading carts from a specific
    saved folder.
]]

function print_usage()
    print("\f6usage:\t\tloadcart filename\n\t\t\t\tcan be file or directory\n")
    print("\f6\t\t\tloadcart -d directory_name\n\t\t\t\tsets carts directory (defaults to \"/desktop\")\n")
    if (fstat("/appdata/loadcart.pod")) then
        local meta = fetch_metadata("/appdata/loadcart.pod")
        if (fstat(meta.dir) == "folder") then
            print("\f6current: "..meta.dir)
        else
            print("\f6current: /desktop")
        end
    else
        print("\f6current: /desktop")
    end
end

--show help
local e = env()
local argv = e.argv
if (#argv < 1 or #argv > 2) then
    print_usage()
    exit(1)
end

--load cart based on settings or default to /desktop
if (#argv == 1) then
    if (argv[1] == "-d") print_usage() exit(1)

    local dir = "/desktop"
    if (fstat("/appdata/loadcart.pod") == "file") then
        local meta = fetch_metadata("/appdata/loadcart.pod")
        if (meta.dir and fstat(meta.dir) == "folder") then
            dir = meta.dir
        else
            print("\f6invalid directory setting, defaulting to /desktop")
        end
    end
    cd(dir)
    create_process("/system/util/load.lua",
        {
            print_to_proc_id = e.print_to_proc_id,
            argv = {fullpath(argv[1])}
        }
    )
    exit(0)

elseif (#argv == 2) then
    cd(e.path)
    if (argv[1] == "-d") then
        local directory = fullpath(argv[2])
        if (fstat(directory) == "folder") then
            store("/appdata/loadcart.pod","",{title="loadcart utility settings",dir=directory})
            print("\f6loadcart set to: "..directory)
            exit(0)
        else
            print("invalid directory")
            exit(1)
        end
    else
        print_usage()
        exit(1)
    end
end
P#147116 2024-04-22 15:57

[ :: Read More :: ]

I'm trying to run a /system/util command from my own custom /appdata/system/util command, but I can't seem to get the output from the /system/util to show up when I run it.

For example, let's take a dumb example and pretend I want a custom command called sys_ls to list the contents of the system folder. I would think my /appdata/system/util/sys_ls.lua would look like this:

create_process("/system/util/ls.lua", {
    argv = {"/system"}
})

And then running sys_ls should spit out the same output as if I ran ls /system. But it doesn't. Instead it outputs nothing at all.

Any idea how to get the called command's output to actually display in terminal along with any other output from a custom command?

P#147075 2024-04-21 19:37 ( Edited 2024-04-22 15:24)

[ :: Read More :: ]

Cart #btnwut-0 | 2024-04-07 | Embed ▽ | License: CC4-BY-NC-SA
1

I cannot figure out what's happening with btn(). It seems totally random. I made this cart so you can see. I thought it was supposed to imitate PICO-8's btn() function, but that's clearly not happening.

Also, if anyone knows how to get data from different controllers, please share. Usually I would do something like btn(btn_num, controller_num) but with btn() acting the way it is... 🤷😂

P#146003 2024-04-07 22:56 ( Edited 2024-04-08 00:30)

[ :: Read More :: ]

@zep It would be hugely helpful if we had a -home [path] commandline parameter for Picotron. I'll describe how I currently have it set up for PICO-8, so you can see how it would be helpful for Picotron:

> Computer lab environment, with each computer having Google Drive installed. (Installing Google Drive locally is like Dropbox, but for Google Drive. Basically gives you a G-Drive on your computer that is direct local access to your Google Drive files and folders, so you can, say, save directly from Notepad into your Google Drive.)
>
> PICO-8 is installed on each computer, but the desktop shortcut to launch PICO-8 uses the -home commandline parameter to point the home folder to c:\pico8 instead of the user's profile folder. Inside c:\pico8 are folder symlinks for carts and images that point to corresponding folders in G:\My Drive\pico8. Then the c:\pico8\config.txt points desktop_path and root_path to ./images and ./carts, respectively.
>
> This means no matter which computer they use, c:\pico8\carts always points to their carts folder in their G-Drive. And because their carts are saved to the cloud, they're not locked to using a specific computer and they can even access carts from home.

This works beautifully.

However, with Picotron having no -home commandline parameter, each student is now locked to having to use a specific computer if they want to use Picotron because on each computer, a separate picotron_config.txt gets created for each student that logs in, rather than just being able to simply have the Picotron desktop shortcut globally point to the single c:\picotron folder and pick up the global config file in there.

I hope this makes sense. It would be hugely helpful to have this feature.

Or, in place of a -home parameter, having a -mount parameter that supersedes whatever is in the picotron_config.txt file would work too. Then I could just make the desktop shortcut use -mount / "G:\My Drive\picotron\drive" and that would work just as well.

P#145805 2024-04-05 16:21

[ :: Read More :: ]

Cart #time_check-0 | 2024-03-19 | Embed ▽ | License: CC4-BY-NC-SA

Just checking web player timings. Please ignore.

(Just to note, this uses really crappy math for getting the seconds, so if it overlaps the current minute's seconds, the numbers will be overlap incorrectly. Just start it again near the beginning of a minute.)

But @zep, check these timings. The web player is running super fast.

P#143901 2024-03-19 21:41 ( Edited 2024-03-19 21:43)

[ :: Read More :: ]

Cart #hexpop-1 | 2024-03-25 | Embed ▽ | No License
36

This is a fun, simple wallpaper. I was trying to keep it from being too annoying, but also still look cool. At some point I may have it follow the current theme colors. But for now it just uses the spritesheet. It runs idle at around 0.3% CPU and maxes out around 4% or 5% CPU.

You can add this to your Picotron wallpapers by typing this in Terminal (which assumes you've already created a /appdata/system/wallpapers folder):

load #hexpop
save /appdata/system/wallpapers/hexpop.p64.png

If you want them, I also made three other variations: Fire, Rainbow, and one that follows your theme.

Cart #hexpop_fire-0 | 2024-03-25 | Embed ▽ | No License
36

Cart #hexpop_rainbow-0 | 2024-03-25 | Embed ▽ | No License
36

Cart #hexpop_theme-1 | 2024-03-25 | Embed ▽ | No License
36

P#143893 2024-03-19 20:37 ( Edited 2024-03-25 17:39)

[ :: Read More :: ]

When using Ctrl-X to cut and paste sprites, the sprite flags remain in the old sprite location. Maybe this is intentional? But it seems like maybe the sprite flags should reset back to a brand new, untouched sprite state when sprites are cut and then pasted elsewhere. Here's a GIF showing the behavior:

P#111411 2022-05-06 20:49

[ :: Read More :: ]

If you keep increasing the Y value of the cursor, things get weeeeiiird. First, the CPU usage goes out the roof. Second, there's a weird area in the corner that obscures the text. Here's a bit of code that will reproduce the problem:

function _init()
    y=110
    f=0
end

function _draw()
    cls(1)

    f+=1
    if (f%20==0) y+=1
    cursor(0,y)
    print("hai")

    print("cursor_x:"..peek(0x5f26).."\ncursor_y:"..peek(0x5f27).."\ny:"..y.."\ncpu:"..stat(1),0,0,7)
end

And this is what happens:

P#90006 2021-04-05 10:00

[ :: Read More :: ]

Cart #mb_simplefps-0 | 2021-02-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
17

I made a very simple FPS controller as a sort of example cart to build off of. This is just to get you going, as opposed to a full framework around which to build a full game. Hopefully it serves as a good jumping off point for someone to make something fun.

It uses player 2's ESDF controls for moving around and SPACE for jumping.

EDIT: Here's a very heavily commented version! Probably way more comments than usually necessary, but it's intended to help you learn, rather than just briefly annotate what's happening in the code.

Cart #mb_simplefpscomments-1 | 2021-02-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
17

P#88033 2021-02-23 00:50 ( Edited 2021-02-23 05:28)

[ :: Read More :: ]

Cart #mb_digdeeper-2 | 2021-02-13 | Code ▽ | Embed ▽ | No License
28

Dig Deeper

This was made for Global Game Jam 2021 with PIGSquad. The theme was Lost & Found.

Controls

⬅️➡️⬆️⬇️ - Movement
🅾️/❎ - Interact (Z/X or X/C on keyboard!)
⬅️➡️⬇️+❎ - Dig
⬆️ - Jump/Jets

Credits

Everything But Music - @MBoffin
Music - @Gruber (from PICO-8 Tunes Volume 1)

Edit: Forgot to mention, but there is a speedrun mode you can enable/disable from the menu.

Edit 2: Fixed a couple visual errors and balance tweaks. Also made the speedrun mode skip the intro cutscene, and also shows your final time on the very end message screen (after the final cutscene).

P#87544 2021-02-12 19:50 ( Edited 2021-02-13 01:40)

[ :: Read More :: ]

Cart #infinipig-0 | 2021-01-18 | Code ▽ | Embed ▽ | No License
6

You are the ghost of Cubepig, looking for a body! Can you find one on your own, or will you have to trade something... precious...

This game was made in 3 hours by the PIGSquad Twitch Chat during a mini-jam on January 17, 2021.

P#86559 2021-01-18 16:52

[ :: Read More :: ]

@zep:

I teach a LOT of students PICO-8 and lately I've been mostly teaching online classes over Zoom. I'm usually doing this webinar style where I am the presenter and the students are participants. I can't see their screen, but they can see mine and there's a Q&A chat window where they can ask questions and so forth.

It would be extremely helpful to be able to copy console error messages to the clipboard. Currently you can hit CTRL-C in the console to copy what's typed into the command prompt, but it would be even more useful, if the prompt was empty, to use CTRL-C to copy the last error generated. Like this:

This would make it so much easier to help students when they run into errors, especially the very young students. If they get an error, they can just hit CTRL-C and paste the error into the Zoom chat. This would also be helpful for people trying to get other live help online, such as from Discord.

P#84208 2020-11-13 23:11 ( Edited 2020-11-13 23:12)

[ :: Read More :: ]

Cart #mb_topdown_vox-0 | 2020-08-06 | Embed ▽ | License: CC4-BY-NC-SA
12

I had a lot of fun making this. This is the top-down adventure game tutorial I made for PICO-8, but re-written to work in Voxatron.

I had to make a few changes to how things worked, since it's in 3D, of course, and there are things that Voxatron doesn't have, like a map editor or its associated functions like mget() or mset(), or other functions like btnp() and so forth. But other than those few changes, it's basically the same code as from the tutorial.

Feel free to take it and make your own games with it. :)

P#80433 2020-08-06 22:05

[ :: Read More :: ]

I'm sure this is probably an easy answer, but why do these work differently, where co_anim1 resets to nil after completion, but co_anim2 does not?

function _init()
    co_anim1=cocreate(animate)
    co_anim2=cocreate(animate)
end

function _draw()
    cls()

    --first method
    if (co_anim1 and costatus(co_anim1)!="dead") then
        coresume(co_anim1)
    else
        co_anim1=nil
    end

    --second method, same as first,
    --but sent to a function to do
    --the work.
    resume(co_anim2)

    print("co_anim1:",0,0,5)
    print(co_anim1,36,0,7)
    if (co_anim1) print(costatus(co_anim1),75,0,7)

    print("co_anim2:",0,6,5)
    print(co_anim2,36,6,7)
    if (co_anim1) print(costatus(co_anim1),75,6,7)
end

function resume(co)
    if (co and costatus(co)!="dead") then
        coresume(co)
    else
        co=nil
    end
end

function animate()
    local a=rnd()
    for i=1,40 do
        circ(64+cos(a)*i,64+sin(a)*i,4,7)
        yield()
    end
end

This code results in this behavior:

P#77176 2020-05-25 16:54

[ :: Read More :: ]

I use Dropbox to share my PICO-8 carts, screenshots, and gifs between my desktops and laptop. It's extremely useful to use it that way. It means all my carts in are one place, they're all saved to the cloud, and I never have to worry about which carts are on which device. (Another bonus is that I only have to update PICO-8 in one place, Dropbox, when a new version comes out.)

The TL;DR is just installing PICO-8 in a folder in Dropbox, and then tweaking the config file on each device to make sure it uses the Dropbox folder as where stores the carts and images (screenshots and gifs).

I know there are probably tweaks that could be done to this guide for each person's individual setup, and maybe there are ways to improve what I have set up here, but this has worked for me for half a decade, so.... ¯\_(ツ)_/¯ Also, I primarily use Windows machines, so this setup may need tweaking to make this kind of setup work on MacOS or Linux. (It should be effectively the same process, though.)

Here are the steps I use:

1) I install PICO-8 into a folder on Dropbox. I'll call that folder D:\Dropbox\pico8 for simplicity. (My actual path to PICO-8 in Dropbox is way longer, has spaces, etc.)

2) I run PICO-8 from that folder so that it creates the appropriate files and folders in my AppData folder at C:\Users\Dylan\AppData\Roaming\pico-8

3) I create a carts and images folder in D:\Dropbox\pico8

4) I create a symbolic link folder for both carts and images in the root of my C:\ drive by opening up a Command Prompt window and typing the following:

cd c:\
mklink /d pico8-carts d:\dropbox\pico8\carts
mklink /d pico8-images d:\dropbox\pico8\images

This step requires some explanation, and this step might not be necessary for you, but I do it because my full Dropbox folder path has spaces in it and that seems to not work with PICO-8's config file settings.

A symbolic link is a like a fake folder that points to a real folder. So I'm effectively making a fake c:\pico8-carts folder that, when you open it, actually goes to D:\Dropbox\pico8\carts instead.

5) Now I edit my PICO-8 config.txt file to use these new folders. Specifically, I ensure that these settings are set in the config.txt file:

// Location of pico-8's root folder
root_path c:\pico8-carts

// Desktop for saving screenshots etc. Defaults to $HOME/Desktop
desktop_path c:\pico8-images\

If the settings aren't already in your config.txt file, go ahead and add them. (The lines that start with // are just comments and can be ignored if they aren't there or are different.)

This makes sure that PICO-8 is looking at the "fake" folders created with mklink above for saving carts and screenshots/gifs. While PICO-8 thinks they are being saved to c:\pico8-carts and c:\pico8-images, they are actually being saved into my Dropbox folder.

I then do steps 2-5 on each device. Now, when I save or load a cart, or I save a screenshot or gif, it goes to Dropbox instead and everything stays in sync.

I'm happy to answer questions on this process, and if you have suggestions for improving it or changing it, feel free to comment below. Like I said above, there are probably many ways of simplifying this process or making it cleaner (like using command line arguments instead of changing the config.txt, for example) but this works for me and I thought others might benefit from its use.

P#77028 2020-05-22 19:15 ( Edited 2020-05-22 20:04)

[ :: Read More :: ]

Cart #mb_advent2019-2 | 2019-12-03 | Code ▽ | Embed ▽ | No License
14

Remember the classic Shockwave Flash snowball fight game called Snowcraft from 1998? 21 years ago! My entry for this year's PICO-8 Advent Calendar is a demake of that beloved Flash game. Huge thanks to @Gruber for helping with the sound effects!

This game uses the mouse. (Sorry, mobile users!)

I tried to make this as close to the original as possible. Have fun! :)

P#70560 2019-12-04 07:32

[ :: Read More :: ]

Cart #mb_3dboids-0 | 2019-11-10 | Embed ▽ | License: CC4-BY-NC-SA
3

❎ to show CPU usage (but I don't think it's accurate?)
🅾️ to show the follow target

This is a quick port of my PICO-8 boids cart. Nothing fancy, just some boids doing their thing.

P#69784 2019-11-10 20:30

[ :: Read More :: ]

Cart #mb_boids-0 | 2019-11-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

❎ to show the follow target
🅾️ to show CPU usage

I've been wanting to do this for a while. This is a simple boids simulation. Most of the code was adapted from Daniel Shiffman's implementation in Processing.

Feel free to pick apart the code. Unfortunately, it's not commented much, and I'm absolutely sure there are optimizations that can be done.

P#69779 2019-11-10 09:13

View Older Posts