Log In  

1

Since reload() and cstore() can now read and write across carts, it should be possible to create tools to edit carts from within pico8.

I'm making a small utility to reorganize the sfx samples (and remap them to the music accordingly). Keeping it on pico8 itself allows the user to preview what each sample sounds like.

However, it would be great if filesystem commands were accessible from carts themselves.
It is possible to use the commands, but for instance, it would be great if ls() returned a table with the files in the current directory, instead of just printing them to the screen directly.

This would allow to make file browsers (like splore) to choose carts to edit from a running cart.

featurerequests
P#20284 2016-05-07 13:15

::

I definitely agree, the ls function or an equivalent would be extremely useful in carts!!
Maybe just a function that works like all(table) that lets you iterate through the names of the files?

It'd be great! Love you Zep! ~<3

P#20291 2016-05-07 19:35

::

I was initially thinking of a table with filenames as keys and file type as value, but you could also make an array and have each entry hold another table with all the file metadata (name, type, size, etc)

something like this:

local files = ls()

-- iterate over the files
for k,v in pairs(files) do
    print(v .. " - " .. k)
end

--> d - wip
--> f - disco_descent.p8
--> f - iconoclasm.p8
--> f - music_editor.p8
--> f - visualizer.p8

or, for the second implementation:

local files = ls()

-- iterate over the files
for file in all(files) do
    if file.type == "d" then
        color(14)
        print(file.name)
    else
        color(6)
        print(file.name .. " - " .. file.chars)
    end

end

--> wip
--> disco_descent.p8 - 1175
--> iconoclasm.p8 - 0
--> music_editor.p8 - 2727
--> visualizer.p8 - 1160
P#20301 2016-05-08 05:32

::

+1

Having this feature (along with extending DevKit mode to have keyboard support, like we have "mouse"), would be SO helpful for us to build tools for PICO-8 game/level editing.

P#39788 2017-04-20 01:06

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2017-06-27 22:24 | 0.219s | 1572k | Q:13