Author Topic: [PC] LGP inserter/extractor/repacker & library - ulgp (1.2)  (Read 77070 times)

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #125 on: 2013-10-11 22:22:09 »
Is this true of lgp files outside of ff7?  if so there is prob no point.  :)

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #126 on: 2013-10-11 22:23:45 »
I haven't checked ff8 yet, I don't think lgp is used anywhere else.

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #127 on: 2013-10-12 00:08:56 »
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 Edit: 2013-10-12 01:46:39 by DLPB »

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #128 on: 2013-10-12 04:43:25 »
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.

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #129 on: 2013-10-12 10:50:03 »
I'll wait until you have updated the readme on main post.  That way I can distribute that with the program :)

sen

  • *
  • Posts: 1244
  • Good vibes
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #130 on: 2013-10-12 14:44:45 »
I think next I'll make an explorer right-click extension like 7-zip's, and a registry key to associate .lgp files.
That'l be really handy :)

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.0] ulgp - lgp inserter / extractor / repacker & library
« Reply #131 on: 2013-10-14 12:26:30 »
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 Edit: 2013-10-14 12:55:22 by luksy »

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #132 on: 2013-10-17 04:29:52 »
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.

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #133 on: 2013-10-17 04:35:46 »
http://www.youtube.com/watch?v=juHgQBB2tLU

I'll test it later on :)

edit.  Looks good to me!  Decode encode working fine here.
« Last Edit: 2013-10-18 00:10:16 by DLPB »

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #134 on: 2013-10-18 04:27:24 »
Made minor changes, GUI is a single exe but matches both the Xp and Vista+ styles accordingly. Not changing version  :P

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #135 on: 2013-12-29 18:28:13 »
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 Edit: 2013-12-30 10:03:53 by DLPB »

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #136 on: 2013-12-30 23:53:03 »
1.2.1 forces all chars to lowercase, I'll leave both up just in case because I can't remember if case is used at all internally in the games, if it causes problems just use 1.2 and make sure the filenames match 100%

https://dl.dropboxusercontent.com/u/3227870/ulgp_v1.2.1.7z

Grimmy

  • *
  • Posts: 498
  • Join in my tarnished light.
    • View Profile
    • GrimmyGames
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #137 on: 2013-12-31 02:21:43 »
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.

luksy

  • *
  • Posts: 375
    • View Profile
Re: [1.2] ulgp - lgp inserter / extractor / repacker & library
« Reply #138 on: 2013-12-31 02:58:05 »
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.

obesebear

  • Administrator
  • *
  • Posts: 1358
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #139 on: 2014-11-04 19:33:50 »
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 http://forums.qhimm.com/index.php?topic=8641.0 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

Kaldarasha

  • *
  • Posts: 2438
  • Prince of Model Editing
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #140 on: 2014-11-05 06:30:50 »
Use a tool to allow the process to use more than 3GByte ram and it will work.

Aali

  • *
  • Posts: 1196
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #141 on: 2014-11-05 14:34:57 »
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 http://forums.qhimm.com/index.php?topic=8641.0 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

I would like to see that broken LGP you produced with my tool. If you could come up with a set of source files that produce a broken LGP file with my tool and a working one with ulgp that would be even better.

obesebear

  • Administrator
  • *
  • Posts: 1358
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #142 on: 2014-11-06 00:08:43 »
I would like to see that broken LGP you produced with my tool. If you could come up with a set of source files that produce a broken LGP file with my tool and a working one with ulgp that would be even better.
Well holy hell, I was testing the different lgps i had compiled to make sure I uploaded the correct one, but this time the textures and shells showed up.   But in the next fight they didn't at first, but did during the second attack. I even recompiled one from scratch again. 

My problem must have something to do with 60fps.  Though it is still strange that luksy's version keeps producing errors.

quantumpencil

  • *
  • Posts: 72
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #143 on: 2015-04-26 06:43:02 »
Could anyone explain to me what exactly causes the "Volume of a file has been externally altered" output in the command line? I'm having that issue now while trying to compile my battle.lgp file for my (soon to be released) mod. A few months ago I used this tool fine and didn't seem to have any problems. There exist plenty of mods which have larger battle.lgp files though -- so is there a work around for this?

Thanks,

QP

luksy

  • *
  • Posts: 375
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #144 on: 2015-05-01 09:19:10 »
The previous version seems to choke with larger files due to all the memory-mapping going on, I've switched back to regular filestreams again which should fix the issue

https://dl.dropboxusercontent.com/u/3227870/ulgp_v1.3.7z

Command-line only for now, the invocation has a changed a little and is much simpler, just keep in mind that you must be in the directory where you want the files to be dumped/packed (the archive itself can be anywhere).

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #145 on: 2015-05-06 02:58:30 »
I've had a look and I think the syntax needs a little tweak.  The easiest and most common use people have is:

List:
Code: [Select]
ulgp l FileExtract:
Code: [Select]
ulgp x File FolderAdd:
Code: [Select]
ulgp a File Folder
It's simple and it requires no effort or change apart from the x and a.

imho that should be the default behaviour.

The only other feature would then be to extract specific files, and that can just use something like

Code: [Select]
ulgp f File Folder Filter
So the f flag would have a third parameter being the Filter for specific files.  For example, "cor" would return all "corel" fields and so on.

Code: [Select]
ulgp f c:\ff7\data\field\flevel.lgp MyFields cor
« Last Edit: 2015-05-06 08:56:51 by DLPB »

luksy

  • *
  • Posts: 375
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #146 on: 2015-05-14 01:42:37 »
I managed to re-introduce some bugs in v1.3, so they're fixed, and I've reworked the interface as follows:

There are no more commands, the first argument is autodetected as either a file or a folder. If it's a file it extracts, if a folder it archives the files in the folder.

If the second argument is omitted, it creates a folder from the stem of the lgp file if extracting (e.g. magic.lgp => magic/), or it adds .lgp to the folder when archiving, otherwise it uses the second argument as the target archive / folder.

Any other arguments are a list of files to extract / add, relative to the folder, if no files are specified it extracts / adds all files.

This also means you can just drag a file or a folder on top of the exe and it should do what you expect.

https://dl.dropboxusercontent.com/u/3227870/ulgp_v1.3.1.7z

(64bit only for now, will get round to a 32bit version).
« Last Edit: 2015-05-14 02:01:19 by luksy »

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #147 on: 2015-05-14 02:46:28 »
This is much better now :)

luksy

  • *
  • Posts: 375
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #148 on: 2015-05-22 02:49:53 »
I've replaced the file list with a single regex pattern, and recompiled for 32bit

https://dl.dropboxusercontent.com/u/3227870/ulgp_v1.3.2.7z

Keep in mind the pattern is regex, not a globbing pattern, so something like

  ulgp magic.lgp somedir "foo|bar"

can be used to extract "foo" and "bar" only, and

  ulgp magic.lgp somedir "x.*"

extracts all files beginning with x. The glob-like pattern "x*" would only extract files with two characters.

DLPB_

  • Banned
  • *
  • Posts: 11008
    • View Profile
Re: [FF7] LGP inserter/extractor/repacker & library - ulgp (1.2)
« Reply #149 on: 2016-03-29 14:07:40 »
I have created a batch file to make modifying / decoding lgp archives in FF7 easier.

lgp_edit  is HERE

The batch file uses Luksy's ulgp tool.

« Last Edit: 2016-03-29 14:29:02 by DLPB »