edit after 0.2.5e
The cart works fine in local 0.2.5e PICO-8, but uploading to the BBS (i.e. inserting in this post) is still broken. I think the _ENV is being changed to _env still by some processing after upload(?).
earlier post
The following prints out 1 twice on 0.2.5c, but crashes on 0.2.5d with:
runtime error line 10 tab 0
return function_a(_ENV)
attempt to call global 'func_a'
(a nil value)
in func_b line 10 (tab 0)
at line 17 (tab 0)
Code:
function get_thing() return { func_a=function(_ENV) return 1 end, func_b=function(_ENV) return func_a(_ENV) end } end thing=get_thing() print(thing:func_a()) print(thing:func_b()) |
Makes some of the OO/class stuff (based on https://www.lexaloffle.com/bbs/?pid=116282) that I've been doing a little limited.
The _env (lower case) keyword is no longer supported:
example cart: https://www.lexaloffle.com/bbs/?tid=48907
likely a general bugs on upper/lower case remapping.

Tiny Code Christmas
LoveByte’s Tiny Code Christmas is an event to help you take your first steps in demoscene sizecoding with Lua based fantasy consoles like TIC-80 and PICO-8!
Over 12 days, from the 12th to the 23rd of December, learn the effects and techniques used in Byte Jams, Byte Battles, and Tiny Intros!

About Tiny Code Christmas
Join us for 12 days of tiny challenges to gradually introduce you to size coding and effects!
A new video will be released each day to introduce a new concept and outline the challenge.
A little bit of programming knowledge will help but you don’t need a lot. The challenges will introduce demoscene concepts without jargon so it is friendly for newcomers to the scene! Tell your friends!
Sharing is caring!
If you feel like it, why not share what you’ve done with us on the LoveByte Discord,



Hey all! Time for some more bugfixes and esoteric features / QOL improvements to finish off 0.2.5*. And thanks to some snippets from @samhocevar's excellent z8lua, some cleaner code parsing. PICO-8 0.2.5d is now up on lexaloffle, Humble, itch.io, and for PocketCHIP and web (Education Edition).
0.2.5e
0.2.5e fixes a bug in the loader that causes uppercase characters to not be loaded as punyfont (e.g. breaking _ENV).
0.2.5d
Added: tline(bits) to set number of bits used for fractional part of mx,my,mdx,mdy (13 by default)
Added: ctrl+mousewheel to scroll code horizontally
Added: current bbs cartridge id shown in window title (config.txt show_cart_id_in_title to disable)
Added: poke(0x5f36, (@0x5f36)|0x80) to enable character wrap by default when printing
Added: blit_method in config.txt // Can use a software blitter by default (slower but more reliable)
Added: reminder when re-locating sprites that only the top half of map is altered by default
Added: draw boot sound as note glyphs on startup when sound is off
Changed: print() returns both max(cur_x), max(cur_y) and includes non-printed characters (e.g. tabs)
Changed: extcmd("folder") and extcmd("set_title", "foo") can now be used from bbs carts
Changed: Indexing a string out of range returns nil (was "")
Changed: Replaced most of pre-processor with Lua parser modifications based on z8lua (fixes various edge cases)
Changed: "a










Some more scratch blocks that I don’t know if they’re in pico 8

If you don’t know what they do:
-length of(“apple”):
-takes the input of a string and outputs how many characters are in that string (for example, length of(apple) = 5
-length of(listname):
-takes the input of an array and outputs how long that array is (for example:
X={1,2,5,3,7,}
Z=length of(x)
//Z == 5
)
So if you know if these are in pico 8 and what they are please tell me




I noticed today because I have a mouse wheel that can unlock and spin that it is possible to scroll very far past the end of a text tab in PICO-8, and then I have to spin it all the way back up. Even if there's no white space populating the document. I would expect scrolling to stop when the last character hits the top or just above the top of the screen or something like that. Hard to illustrate with a gif since you can't know when I'm using the mouse wheel (except by a pause and the cursor is jittering cause i'm hammering the mouse wheel down a bunch of times then up), but, here's one anyway.

I was wondering if we could do a demake of Densetsu no Stafy 1 for GBA
It will be fully localized in english
It will have the same HUD as the original Gameboy Color Prototype
It will have the soundtrack recomposed Pico-8 style
It will be split into 9 carts, each depicting every world
How you like that idea?

Hi! I'm thinking install Linux in an old HP Mini 210 32bits netbook but not sure wich Linux distro install on it in order to use Pico-8. I've searching in the Pico-8 docs but I don't find nothing clear and I'm very newbie in Linux.
Anybody knows what is the "minimal" Linux version/distribution that allows me using Pico-8?
Thanks in advance!
Regards.



One nice thing about objects is that objects set with the =
operator or as arguments are all 'linked' meaning, among other things, you can provide them as arguments for a function call and that function will be able to edit the local copy of that object and have it affect the original one too. But sometimes, you don't want that. Sometimes you want to copy an object, make changes to it, and then discard the new copy without affecting the old one. That's why I've created a little helper function for this circumstance. Actually, I've created several. Here's the fully-featured 'default' function:
function cpy_obj(obj,recursion) if type(obj)=="table" then local return_value={} for k,v in pairs(obj) do if recursion then v=cpy_obj(v,true) end return_value[k]=v end return return_value else return obj end end |
Usage: copy= cpy_obj(𝘰𝘣𝘫𝘦𝘤𝘵)
or function_call( cpy_obj(𝘰𝘣𝘫𝘦𝘤𝘵) )

Logarithm Function: https://pico-8.fandom.com/wiki/Math
A simple calculator cartridge.
Controls:
(D-pad) Move Cursor
(O) Selected Button
Limitations:
• Numbers only go up to 32767 before wrapping around
• Numbers are rounded to 4 digits
• Logarithm function is approximated
• Generally bad code


(v00 12-10-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type:
load #slowdown
In this demo use the LEFT and RIGHT arrow keys to control actual runtime speed of the cart. Examine the code to see how it is done.
Hello.
As you know conventional code allows you to run your cart in 30fps or 60fps.
However making use of the seldom known command, _set_fps()
you can set any of these values or an arbitrary one.
Is there a way of setting FPS <30 inside a cart that does make use of _update() or _update60() ?




It's been a while since I've posted anything here - in fact I think the last game I posted was another Christmas game back in 2019... I guess that means I like Christmas games.
Anyway, Santa has lost his sleigh for reasons unknown - maybe he made some kind of stupid mistake, I don't know. Long story short, he needs to get back on his sleigh before time runs out. While getting there, however, he needs to get presents delivered to all the chimneys (and chimney-type objects) along the way. Maybe not all, but most would be good.
It's snowy and very windy out there, so leaping from chimney to chimney isn't going to be easy. Also kids or punks or people like that are throwing snowballs, so watch out for them. If you're lucky, you'll catch some falling rings along the way. If you're unlucky, you'll land on the wrong chimney at the wrong time and catch fire.




Can you get the blue screen of death? Can you beat the painful virus hidden in another program? Can you complete the ritual?
That, and more, is right here, in picOS 2.0!
This is a sequel to my previous (and not very good) adventure into a desktop-like thing: https://www.lexaloffle.com/bbs/?tid=43948.
I completely redid everything, and although not super optimized , it works okay, and has some secrets and easter eggs.
If you want to make a program for it, here is the cartridge:

There are some more instructions in the code on how to do it.





