[PC] LGP inserter/extractor/repacker & library - ulgp (1.2)

  • Thread starter Thread starter luksy
  • Start date Start date
Status
Not open for further replies.
That's odd, I'll check again later, I could have sweared it was working, I even made a test script.

edit: Seems to be working for me, by the way if you don't specify any files it will automatically add everything in the specified folder so you can just do ulgp -c foo.lgp -C thefolder

To get a better idea of what's going on, post a dump of the directory structure you have and run ulgp with the -v flag

The commandline app doesn't dump the files with -t due to a bug, but that isn't causing your issue.
 
Last edited:
I run ulgp -c foo.lgp -C folder1

With -v I get
"inserting 2 files/folders
Inserting folder2\config2
Inserting "config"
Writing lgp file to foo.lgp

But on decode, no folders.

Structure is >

\folder1\folder2

Inside folder1 there is a file called config
Inside folder2 there is a file called config2

Inside foo after -c all there is is config and config2
 
Last edited:
This is entirely intended and you should get the same results with classic lgp, folders are only preserved for identical filenames in separate folders, i.e if you have foo.txt in the folders test1 and test2 it should work fine. Unique filenames are stripped of their paths.
 
This is entirely intended and you should get the same results with classic lgp, folders are only preserved for identical filenames in separate folders, i.e if you have foo.txt in the folders test1 and test2 it should work fine. Unique filenames are stripped of their paths.
But -r kept them?

Surely sometimes different files in different folders are necessary?
 
Last edited:
That's because when the lgp was created, the path was stripped. When you used -r, you now have two files with the same filename, so the new one is inserted with its path. The only file that uses paths is magic.lgp, and it only uses them for files with identical filenames — the only reason lgp even exists is so the files can be looked up in the hash table, so unique filenames have no need for a path.

I can change this of course if it makes more sense to always keep paths, it's just something that will never be necessary for actual game files.
 
Is this true of lgp files outside of ff7?  if so there is prob no point.  :)
 
ulgp.exe seems to be working great!  8)  Very useful tool. 

Download FF7LGP 1.1

And I have just done some research and created a batch file (above) that will encode/decode all LGP files in FF7 using ulgp.exe.  You just place any LGP file (like flevel.lgp) in a folder called LGPs.  The folder is placed in the same place as ulgp.exe.  Double click FF7LGP.bat (which is also in same place as ulgp.exe) and then select either d or e. It will do the rest.  To create all necessary folders (it will place them in a new folder called Files) just select f.

so d: decode to folders (it will obviously create all decode folders  here because ulgp does that)
e: encode from folders
f: create entire folder structure.
c: close command prompt

I highly recommend selecting f before anything else.
This will set all the folders up for you.
With Luksy's permission I can distribute this in a ready made zip file with his exe

Always make sure you back up your lgp files before using ulgp based programs.

It will work with ALL lgp archives, even non-English ones like gflevel.lgp.

take flevel as an example.

Running d will place all flevel files into Files\DecFlevel

Running e will encode from Files\EncFlevel

If you have any problems or think something needs changing, let me know.

edit.  1.1 is released :P
 
Last edited:
Yeah if it wasn't clear anyone has permission to do whatever they want!

I think next I'll make an explorer right-click extension like 7-zip's, and a registry key to associate .lgp files.
 
I'll wait until you have updated the readme on main post.  That way I can distribute that with the program :)
 
Here's a batch file that will associate .lgp files with the commandline version of ulgp, once it's run you can double click an .lgp file and it'll automatically extract it to a folder with the same name as the lgp file + ".files" in the same folder as the lgp file.

To use the batch file, copy it to the same directory as ulgp.exe and run it, 'i' installs, 'u' uninstalls. If you move ulpg you'll need to reinstall to update the path.

https://dl.dropboxusercontent.com/u/3227870/install.bat

Hopefully I'll get round to making a right click handler for the reverse too at some point.
 
Last edited:
Updated, I've simplified the syntax again as most people won't need to mess around with the other options

ulgp v1.2

tl;dr:

Extract magic.lgp to a folder named "magic"
ulgp -x magic.lgp

Create magic.lgp from a folder named "magic"
ulgp -c magic.lgp

Overwrite files in magic.lgp from those in a folder named "magic"
ulgp -r magic.lgp

Run install.bat to associate .lgp files with ulgp, once installed simply double click on an .lgp file to extract to the default folder. Hold shift and right click on any folder to create / add to an .lgp file using the files inside.

The GUI now comes in two flavours depending on your version of Windows, the only changes are visual.

As always the readme contains full info.
 

I'll test it later on :)

edit.  Looks good to me!  Decode encode working fine here.
 
Last edited:
Made minor changes, GUI is a single exe but matches both the Xp and Vista+ styles accordingly. Not changing version  :P
 
For anyone else, just a note.  The -r (overwrite files) option has some sort of bug and is sometimes not updating files.  Luksy will be looking at this shortly I am guessing.

edit.

Turns out I was being stupid.  The problem is that ulgp has to be fed lowercase files (including lower case extentions).
 
Last edited:
What about new file names? Like a new texture or p file that did not exist before added to any lgp. Would it matter if that file was upper or lower cased. It seems like a pointless check since the game and driver both ignore case when loading a file.
 
1.2 will happily accept two files separately as foo.bar and foo.BAR, this apparently is an issue because some people have been changing the case of the files they dump. It's an issue because the in-game lgp lookup probably just returns the first case-insensitive match it finds, so if for instance you have added foo.BAR as a replacement for foo.bar, foo.bar isn't actually overwritten in 1.2. When the game looks up foo.bar it'll just return whichever is first in the table (presumably). New files won't be affected I guess, assuming the in game lookup is case-insensitive as you say.
 
Per DLPB's request, I'm filing a bug report for 1.2.1.   Upon attempting to compile a heavily modified battle.lgp that will be 1.04Gb or larger, it throws the error "the volume for a file has been externally altered so that the opened file is no longer valid".  However, using a compiled version of Aali's code from https://www.ff7catalog.com/threads/5713/ will compile it just fine (though in instances like barret's attack, his shells will no longer appear. and there are a few other texture errors).   Your version has fixed whatever that problem is, it just won't compile it if it's too big it seems.

Also tried compiling the 1.04Gb battle.lgps using Aali's code and using 1.2.1 to then dump that.  It errors saying battle.lgp cannot be found
 
Status
Not open for further replies.
Back
Top