Log In  
[ :: Read More :: ]

Reacting to Cart Drag Events

I was thinking about the final fantasy games for the ps1 and about how I really love the concept of a game which prompts you to switch the game disk out for another one you have sitting nearby. I know pico8 can automatically load carts without user input, but I was trying to brainstorm a way which would allow you to have that tactile feel of sticking a cart in. I'd like to propose a method of achieving this and open the floor up to further discussion about the topic.

Basically this is sort of an advanced, tactile multicart that a developer can customize to their will.

I was wanting to implement this in such a way where the cart developer has full control of how it works aesthetically, so with as little intervention as possible, so I wanted to avoid a function which completely freezes the cart and waits for a drag event.

Suggested Method:

"Stat" Method
(similar to how dev mouse is only activated when it's queried, perhaps this feature should be opt-in in the same way)

  • have a set of stat values which store the filepath/bbs id(?)
  • if a drag event happened this frame, it records the filename of the drag and finds some sort of unique identifier set by the user from the cart (unknown what this would be yet)
  • probably clear these stat values on the next frame to be ready for another drag event
  • activate by poking a memory value or maybe by querying the feature for the first time with stat
    • to avoid a drag event immediately unloading the current cart and loading the new one
    • prepare the console to get the new stat()s and maybe enable a cute drag indicator when you drag stuff over the window
  • to switch carts, have a loop running around checking every frame if the values have been set, and react accordingly
    • "now loading map Baja California, please insert baja cart"
    • if stat(uid) == "mybikes_baja" then load stat(filename) etc etc, if it's wrong "please try again" or whatever
    • if btnp (cancel) then go back to main game loop and do something or other (different map maybe? cancel teleport?)
    • etc

I could think of alternate methods like calling a function which would pause the cart and wait for a drag event, but that seems intrusive and not very customizable


One problem with this idea is currently it's very difficult to hide/find a unique identifier inside a pico8 cart. I was thinking the cartdata string would be a good one, but this is not explicitly set per cartridge inside the cart itself, and also there's no way to guess by looking at cartdata calls because carts can arbitrarily read and write any cartdata they want.

Another issue is that this feature would not work for BBS carts, so some sort of alternative would need to be in place if the user cannot or willnot drag a cart into the window. I'm not sure how to do this unintrusively. maybe if you press the pause key and the console calls the function or stat, then it adds an option to the menu to prompt for a bbs id? maybe this feature just isn't for bbs carts, just as multicart isn't really supported for bbs?

Another problem is exporting to a multicart binary would also be very difficult. but perhaps the two features would be mutually exclusive? this is more of an aesthetic choice that a developer could make for fun.


I'd love to hear what people think of this idea. I think it would be a lot of fun, even if it would take a while before we see it used in a cart. Does anyone else think this would be a good idea or see any other problems with it?

P#77850 2020-06-10 08:06 ( Edited 2020-06-10 08:10)

[ :: Read More :: ]

Cart #ghost2_0_1-3 | 2019-03-07 | Code ▽ | Embed ▽ | No License

just a test I'm doing with classes and npcs

trying to make a game where anything can be turned into a player because they perform tasks by accepting a button array as input from their "ai"

P#62456 2019-03-03 10:50 ( Edited 2019-03-07 10:06)

[ :: Read More :: ]

did something change recently with the time function? when I run it in update60() I get seconds every half second, but when I run it in update() I get seconds every second

do I need to divide by 2 if I'm running in 60fps mode or is this a bug?

this is all the code I have currently, was just running a quick test when I noticed odd behavior

function _init()


function _update60()

function _draw()
P#62339 2019-03-01 01:17

[ :: Read More :: ]

This is my effort at trying to make the mouse work as a joystick. Click to move.

Also it's sort of a cart I want to work on more, so it's in WIP instead of Snippets

Cart #58200 | 2018-10-21 | Code ▽ | Embed ▽ | No License

P#58201 2018-10-20 21:31 ( Edited 2018-10-21 01:31)

[ :: Read More :: ]

Working on some sort of burger game, still figuring out the mechanics, but here's a random burger generator

Cart #58060 | 2018-10-18 | Code ▽ | Embed ▽ | No License

P#58061 2018-10-17 21:22 ( Edited 2018-10-26 08:49)

[ :: Read More :: ]

I feel like I make one of these every year or so, but it's a rudimentary physics engine for bouncy balls

seems like randomly the balls are too fast to see, just restarting the cart seems to fix it
(added particle count)
old version:

P#58006 2018-10-16 10:16 ( Edited 2018-10-20 13:33)

[ :: Read More :: ]

was testing out rotation of sprites and found a small shorthand, still experimenting with this

arrow keys to move duck

Cart #57995 | 2018-10-16 | Code ▽ | Embed ▽ | No License

P#57990 2018-10-15 18:51 ( Edited 2018-10-17 04:20)