2014-10-08 04:28:02

hay, i'm programming in this bgt thingy. But i want an easy bgt file packer where can i get one? thanks!

no matter what you do, alwais, ghosts will be there. Demonic spirits waiting for you. Charlie Charlie are you here? suddenly, charlie appears with a knife. He killed me! charlie charlie are you here? tell me if it's yes. Are you gonna persew me or you're leaving me in peaze? oh my gosh charlie is indeed here! he's about to kill me!
:D

2014-10-08 07:10:01

I feel like we've been here before; have we been here before?

// Pack all files in a certain directory, recursive.
// This probably needs to be in its own script; pack everything separately from the game, otherwise it will do weird things when someone tries to play it.

// Both parameters here have a default value, so you can just call pack_all().close() and that's everything. You might try pack_all("sounds") if you only want the sounds folder, for example.

pack_file@ pack_all(string top="", pack_file@ ret=null) {
 if(@ret==null) {
  pack_file temp;
  @ret=temp;
  ret.create("sounds.dat");
 }

// Formatting:
if((top!="")&&(string_right(top, 1)!="/")&&(string_right(top, 1)!="\\")) {
 top += "/";
 }
string[] dirs=find_directories(top + "*");
string[] files=find_files(top + "*");

for(uint i=0; i<files.length(); i++) {
ret.add_file(top + files[i], top + files[i]); // The filename in the pack matches the filename on the system.
}

 for(uint i=0; i<dirs.length(); i++) {
 @ret=pack_all(top + dirs[i], ret); // Since ret is a handle, we shouldn't need to save it, but if this doesn't work, try adding @ret= to the start of this line.
}

return ret;
}


void main() {
// Example, packing everything in ./sounds
pack_all("sounds/").close();
}
看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2014-10-08 13:53:34

We have.

http://forum.audiogames.net/viewtopic.php?id=13721

2014-10-08 21:12:27

i don't understand preaty much this CAE thingy

no matter what you do, alwais, ghosts will be there. Demonic spirits waiting for you. Charlie Charlie are you here? suddenly, charlie appears with a knife. He killed me! charlie charlie are you here? tell me if it's yes. Are you gonna persew me or you're leaving me in peaze? oh my gosh charlie is indeed here! he's about to kill me!
:D

2014-10-09 21:51:33

uh, hello?

no matter what you do, alwais, ghosts will be there. Demonic spirits waiting for you. Charlie Charlie are you here? suddenly, charlie appears with a knife. He killed me! charlie charlie are you here? tell me if it's yes. Are you gonna persew me or you're leaving me in peaze? oh my gosh charlie is indeed here! he's about to kill me!
:D

2014-10-10 03:21:27

Save the code I posted and run it. It will pack everything in the sounds folder.
If you want to pack other things, change this line:
pack_all("sounds/").close();
Replacing "sounds/" with the path to the folder to pack. (Or just remove "sounds/" to pack everything under the current folder.)

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.