Log In  
[back to top]

I understand Pico-8 has a subset of the full Lua language. However, I wonder is there enough of it there to make the following book useful: https://www.amazon.com/Programming-Lua-Fourth-Roberto-Ierusalimschy/dp/8590379868/ref=pd_lpo_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=JKY5ABS0S7DB70RF732Z

Does anyone have this and did it help you?

I've been able to get by picking up a smattering of lua syntax just online, but I enjoy the idea of getting a deeper look at the language. However since Pico-8 is the only platform on which I'm extensively using Lua, I want to make sure the investment would be worth it.

P#50146 2018-03-09 12:32 ( Edited 2018-03-09 17:32)

I've been using an "object-like" idiom in my Pico-8 programs so far where I have functions where I basically pass in a "self" and do operations on an object. I also tend to keep a "type" variable. That seems to have been enough to get as "object oriented" as I need to be. I've seen that it is possible to hack Lua to basically give you full oop and inheritance. It looks as though it is a hack and not a built in language feature, and from what I've been reading not very many Pico-8 users use it.

My question is, to those that do, what do you believe the advantages are, especially in the context of making such small programs...? (guessing there aren't any, other than finding it interesting to implement)

P#49689 2018-02-25 22:33 ( Edited 2018-02-27 20:41)

I have pico 8 on my home pc, my work pc, and my raspberry pi, but they each have their own favorites list. Is there a way to put this favorites list in the root path? I have all my carts and such in a dropbox share that all three machines use, but not the favourites.txt.

Also is there a way to sort favourites.txt (other than just editing the file and sorting by the column of the title of the game)?

P#43138 2017-08-08 22:39 ( Edited 2017-08-09 02:39)

Is there any way to make a pattern stop short of 32 notes? (like famitracker has a Bxx effect for jumping to another pattern/frame) I have some music with a repeating section but it won't fit in 32 notes. if I could make it stop at say note 24 (or whatever it ends up being) I could repeat this section in a pattern and not have to waste an extra sfx.

P#43133 2017-08-08 21:24 ( Edited 2017-08-13 00:27)

Cart #42865 | 2017-07-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Inspired by Dino Riki on the NES. Features Dan (an old friend of mine) netting bees. And screaming: BEEEEEEEES!

P#42844 2017-07-28 11:49 ( Edited 2019-06-06 18:39)

I recently wrote the following routine to scale text:

--scales some text, used for title
function scale_text(text,tlx,tly,sx,sy,col)

    for y=0,7 do
     for x=0,#text*8-1 do
      local col=pget(x,y)
      if col!=0 then
      local nx=x*sx+tlx
      local ny=y*sy+tly


However it depends on first printing the text to the screen.

I was trying to think of ways I could enable scaled text printing while other things are going on. Right now I just keep a black strip at the top of the screen of my current game so that I can scale text whenever I would like.

One idea I had was to create a table outside of Pico-8 that matches the Pico-8 font, and each row would be a single byte where every bit is a pixel, 8 bytes each for all characters in the font, then look up the correct bit when scaling each character, instead. Problem with that is the space it could use up, I guess.

I was kinda hoping the font would be in some kind of pseudo "system ROM" readable using PEEK, but I didn't see this listed in the memory map.

Another idea I had was to print every character, read the pixels and keep the data in a table. It'd be a sort of ugly "blip" of text right as the game starts up, though, but it might be so fast nobody would notice...

P#42303 2017-07-09 22:17 ( Edited 2017-07-15 05:58)

Here's my Raspberry Pi 3, which I'm using as a dedicated Pico-8 machine. I also added a 3D printed Pico-8 logo.

P#42232 2017-07-06 19:42 ( Edited 2017-07-07 12:48)

Is there a way to adjust how quickly held keys repeat keypresses within the code editor, etc? It appears Pico-8 applies its own setting/behavior to this, it does not inherit it from the host operating system. I like to use very fast key repeat settings, in general. In particular it would be nice for using page up/page down to navigate a large program.

P#41582 2017-06-13 12:22 ( Edited 2018-08-11 16:50)

I'm simply curious to know whether midi input will be added natively to Pico-8. I enjoy composing in FamiTracker using my KORG nanoKEY2 (tiny piano keyboard for entering midi notes), and I really wish I could do the same in Pico-8. I guess there are workarounds for this, but, I'm still hoping this will be added in the future; it'd really push this product over the edge for me enjoyability wise.

P#41129 2017-05-30 09:36 ( Edited 2017-05-30 13:36)

I'm considering making a jrpg in Pico 8 at some point. Yes, I know it is a very tired genre. However I really don't mind, I still love it.

One thing I was wondering was how to make an overworld that's larger than the 128x64 cels in the built in map memory.

My current idea is to represent the overworld in terms of geometry instead of in terms of a grid, rendering the tiles manually (or temporarily filling a portion of the map cel memory). So I'd have like, a mountain range defined as a rectangle, and then I'd overlay rectangles to give them a shape, and have some logic for arranging the tiles around the edges to look correct, etc.

Then individual tiny dungeons perhaps would just be hard coded in the map cels. Not sure.

I have seen several adventure type games in Pico 8, but...are there any that are trying to give the appearance of being "vast?"

I am really interested in the idea of packing a lot of engaging gameplay into a tiny space like this.

P#40765 2017-05-19 20:02 ( Edited 2017-05-21 20:34)

I'm very fond of this idea of a fantasy console, and I'm enjoying Pico 8 a lot. Every so often, I think, gee, I'd like one with fewer constraints.

But then something dawned on me: There must be a point beyond which, if constraints are relaxed too far, the point of being a fantasy console evaporates and you may as well be simply using a more generic game framework.

I imagine this has been discussed many times before. But it explains to me why we will probably not see an extremely large proliferation of fantasy console software, the reason being that it is the constraints that make it unique as a console. If we make something as powerful as say protected mode DOS and make it a fantasy console, users may as well either use Dosbox or just write a game with a modern game framework, because the constraints are so relaxed relatively speaking. The craft of fitting a game idea into constraints is gone.

I'm aware of Liko 12 and PixelVision 8 and TIC-80 and so forth. The point of my discussion here is just a thought experiment about how much folks would value something that's a lot more powerful---where at that point there's really no need to have it be a console.

P#40619 2017-05-15 12:04 ( Edited 2017-09-18 14:13)

This is a weird (ocd) question, but, is there any way to make pico 8 normalize everything as spaces? I noticed I can select some text and hit tab and shift tab as in many modern editors. However sometimes I use spaces to line other things up as I'd like. When I open my p8 file in another text editor then I have a mess of some tabs, some spaces. I was just curious if there's a flag for config.txt to make all tabs into spaces perhaps.

P#40558 2017-05-13 22:34 ( Edited 2018-03-04 14:38)

I've of course found plenty of things on doing queues in lua all over the web, but it appears pico 8 has fewer of the main lua libraries available.

What I'd like to do is have a queue for passing messages to coroutines for "commands" to process. TBH it's probably overkill, but I'd like to know how anyway.

I know I can add(x, 10) to append to a table. But then there's del, which apparently only searches for a value and deletes it. I'm surprised there's no mirror operation to add which would remove from the end (or start) of a table. That's what I'm looking for, I think.

P#40290 2017-05-07 20:25 ( Edited 2017-05-08 00:25)

Cart #adventurecreator-8 | 2021-01-12 | Code ▽ | Embed ▽ | No License

This is a demake of Adventure Creator, an old Atari 400/800 game. It's not my goal to perfectly imitate the game, just get enough of it in there to be fun and nostalgic to play.

The original game was by Spinnaker/Dale Disharoon on the Atari 400/800 released in 1984.

It is dedicated to the memory of Dale Disharoon who died in 2008. His game gave me and my sister Katy a lot of fond memories together. I hope this demake honors his memory and preserves his legacy in some form.

It's a bit of a strange and probably outdated game. It is best described as a roguelike with questionable mechanics. But it makes a fun toy, and probably interesting to small children and anyone who remembers the game.

The original game had a mode in which you could compose and save your own adventures (hence creator), but this demake focuses ONLY on random dungeon generation.

Thanks to @Krystman for his Porklike tutorial, as I was able to glean some ideas for dungeon generation from it which are used in this cartridge.

To play the game:

You are presented with a goal of a particular treasure to find. When you start the game, you are in a randomly generated maze that is different every time you play the game.

-x or z to start
-move around with dpad
-x to try opening chests (some take extra tries!)
-z to open your inventory screen (also shows your goal treasure and how much energy you have)
-dpad to select a tool from inventory screen
-x will use currently equipped tool if not touching a chest

Monsters exhibit several different behaviors. They can talk, give, steal, trade, zap (hurt you), pop (teleport you around the screen randomly).

Hazards are glowing blue and yellow objects of various shapes and behaviors. They will hurt you, but they come in and out of existence.

When actions occur, a heads-up display will pop up at the bottom of the screen telling you what happened.

Tool guide:
-Ferrets: Shoot this at a monster to find out what its behavior will be if you touch it.
-Hobbles: Freezes monsters for a few seconds so you can get past them.
-Nippers: Shoot this at glowing hazards to remove them.
-Torches: These will light up a dark room so you can see the maze.
-Shields: Makes you totally impervious to monsters and hazards.

Note that Ferrets, Hobbles, and Nippers are projectiles. They will shoot in the direction the knight was last moving.

P#40248 2017-05-06 19:29 ( Edited 2021-01-12 22:56)

I've got some code similar to this in my game for different types of entities.

 function ()
  while(knight.alive) do

   if btn(0) then

... ... .. ..

Basically inside the function I'm creating a coroutine from I just use the "knight" reference from global scope as a "this" reference, so to speak. But...now I want to create a different type of entity within a loop, using a similar approach to the above.

 for m=1,10 do ::redo::

    while chest.alive==true do

The problem I'm running into is that that "chest" variable inside the loop, only ever seems to refer to one chest (presumably the very first time the function() is processed by lua).

I want to create a coroutine for each chest entity, which has a reference to "that" chest for each one in the loop. I'm sure there's a way to do something like that but I'm fairly new to lua.

P#40244 2017-05-06 16:43 ( Edited 2017-05-06 20:46)

I'm totally new to the Raspberry pi. I thought it would be fun to basically make myself a dedicated Pico 8 machine. I have no idea what all I'd need. I'm imagining:

-A raspberry pi board. Should I get the newest model 3 version? Should the Pico 8 build work on it?
-A case. I want to play this on my tv, don't want the board just dangling out in the dusty air.
-Wifi so I can browse Featured games
-I already have usb controllers. Should they just work?
-A pc keyboard for programming Pico 8 on my couch
-A power supply for the rpi

nice to have:
-set up dropbox linux client so my pico 8 share is accessible via this system as well as my two PCs. Haha. That'd be awesome

Should I need anything else? I'm not even remotely interested in gpio or breadboards or any of that fancy makerfaire electronics stuff. I JUST want pico 8. lol.

NOTE: I do NOT want an emulation station. I JUST want pico 8. Bare bones linux, and pico 8. nothing else. Purity.

NOTE: Also do not want PocketCHIP. That thing looks like garbage to actually use for editing a pico 8 game, even playing it. The controls and keyboard look like a nightmare. I can see it being fun for kids though maybe.

P#39612 2017-04-13 14:33 ( Edited 2018-07-09 09:34)

I'm having so much fun with Pico-8...I feel just like I did when I was 13 getting into QBasic for the first time in 1996. I used to go with my dad to the university with a floppy disc so I could download other people's QBasic programs, which were often "tiny games" by today's standards.

I love the feeling of being inside this cozy little world, that's all about playing games, reading code and writing code. I didn't think I'd ever be in such a world ever again.

I'm actually part of a world that's almost like this one. The NES homebrew community. Folks actually making real NES games in 6502 assembly (and also C at times). It's not quite the same though as the QBasic world felt, but I love it for many other reasons...

I live for making retro games, thanks to the creator for making this wonderful software. Hopefully I'll have some fun tiny games to share with the community at some point.

P#39096 2017-04-04 22:57 ( Edited 2017-04-05 22:58)

Hi! I'm toying around with Pico 8 for fun and relaxation on the side, where my primary pursuit is to develop games for the Nintendo Entertainment System in 6502 assembly.

It's fairly straightforward to implement coroutines in 6502 assembly and use them to represent state machines for entities (actors, etc.).

I was curious if it's common to use coroutines in Lua on Pico-8 for this purpose. I tried searching for "cocreate" in a couple of the featured games but no results came up.

P#39044 2017-04-03 12:48 ( Edited 2017-04-04 16:33)

Follow Lexaloffle:        
Generated 2021-01-21 12:09 | 0.169s | 2097k | Q:67