LUA FilePAK 0.1 Beta

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

LUA FilePAK 0.1 Beta

Post by MikeHaggar »

Well... Tell me what you think guys.

http://haggar.pocketheaven.com/files/luapak01b.zip


This release is only for devs ;)

This program packs lots of files together into a single file.
This could be useful for people with games that have lots of level files.

There are currently 3 functions in unpak.lc:
returnvalue unpak(pakname,filename) - unpacks a file fully into the memory stick,
not recommended to use because it's very slow for big files.

returnvalue unpakFunc(pakname,filename) - runs a lua script in the pak file in
memory. It does the same thing as dofile("level01.lua") would do.

table unpakList(pakname) - gives a System.listDirectory() kind of table.

If the above made no sense whatsoever, then look at unpak.lua for examples.

You should use pak.lua to make a pak file before doing anything else. If you think
it's slow, then remove the big 1mb file from the test subdir. ;)

Whatever files you put in the test subdir will be added to the pak file (err... after you (re)run pak.lua that is, it doesn't get added by magic powers).
The exceptions are 0 byte files, and directories.

When you run the unpak function, the temp files will be put in the temp dir.
unpakFunc and unpakList doesn't need any temp files.

This is only a beta, so there's almost no checks for stuff that could go wrong.
Like missing pak files and missing test and temp dirs.


====
TODO
====
- Finish it.
- Add FileBrowser integration.
- Scrap it whenever PhysicsFS gets added to luaplayer.

========
CONTROLS
========
Select = Quit the scripts ;)



Oh... And this got nothing to do with .pak files you find in <insert game name here>.
Wraggster
Posts: 121
Joined: Fri Aug 26, 2005 7:40 am
Contact:

Post by Wraggster »

damn i was gonna post this until i read the devs only bit ;)
Webmaster of http://www.dcemu.co.uk

DCEMU The Worlds Only Homebrew & Gaming Network of Sites.
matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

Does this compress the data? Combining this with modsyn's huffman compression would be a neat way to distribute Lua programs. If Lua apps were hosted this way, someone could make a Lua program to download these and install them directly to the memory stick without using a PC.
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

Well... Somebody must send me lua-huff.rar then ;)
matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

Umm... Nice broken link ;)
matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

Um, what? I just clicked on it, and downloaded it just now. ?!?
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

Yep, it works fine now.
Post Reply