Aller au contenu

Photo

[Release] pyGFF 0.5 ALPHA


  • Veuillez vous connecter pour répondre
192 réponses à ce sujet

#76
tazpn

tazpn
  • Members
  • 70 messages
I believe 0x8DD70FE1 are HLSL shader scripts like fx and dx11 in materialdefinitions. I've brute force checked extensions with 4 characters so I think its a longer extension.

#77
Thought Process

Thought Process
  • Members
  • 191 messages
What ERF file did you encounter them in though, it isn't materialdefinitions (at least in the demo).

#78
Tyrium

Tyrium
  • Members
  • 511 messages
Thanks so much for this guys, I have a question if people have time - I've used pyGFF to extract the dlg file I'm interested in modifying, but opening said file in the toolset or in pyGFF opens up the conversation starting list line list etc.

I know a dlg file can't be straight opened into a conversation tree like the resources automatically in the toolset are, but is there any way to get at the actual dialog, perhaps by crossreferencing the talktable?

(what I'm trying to do is alter certain dialog to trigger only for a male PC, but I can't see what is the line content, let alone conditions)

#79
Eshme

Eshme
  • Members
  • 756 messages

Mephales wrote...
I can certainly add an additional executable to my editor that's a standalone ERF extractor. How do you want the command line to be? erfextractor [--password <erf password>] <erf file> <resource to extract> <destination>? Do you want to specify the directory to extract to, or the full path including filename, so you can name it whatever you like. If instead you want to specify the directory, and the resource has directories in its name (like the art/* files), do you want all the directories created, or do you want the file created in the exact directory you specify? How about errors?



It would need arguments like:
ErfFile (with path),
Resource to extract (in the form of either a Hash or Offset/Length(preferred). Filenames are not suited cause the first filename to import from is unknown prior extracting, the rest of filenames that are linked are known thou.)
Destination Path and Filename,
Password maybe too but i dont know if that is worth the time, since we dont know passwords.

I thought this is tailored to run thru my importer hence the weird arguments ,its only a binary dump and a decompression essentially.

While im saying this, am i actually able to write this in C++ myself? I have no experience whatsoever,  would anyone give me a lesson or write the basic stuff and i compile it with gcc or whatever it is called? I am up to expand the code by myself, if i only had a headstart by a working example :lol:

I have downloaded a decompression commandline tool on its own, thats only a few bytes. So i expect its not too big? I dunno no idea.

#80
Mephales

Mephales
  • Members
  • 83 messages
OK, I've uploaded 0.4.6. It includes the command-line ERF extractor Eshme wanted, essentially. Just do "erfextract --help" to get the command-line options and everything. It supports extracting files when you know the filename, the offset, or the hash.
Second, the beginnings of my next GFF parser/dumper are included. If all you're doing is editing values, not adding or deleting elements from lists, or anything with references, but are just editing strings and numbers, then it's the better choice in many ways, as it loads and saves extremely quickly and results in minimal rearrangement of the gff. My savegame editor, as all it does is edit values, now uses this new class. In the editor, it's accessible as "Instant Save" under the settings menu.

Eshme, if you want any more done to the extractor, just tell me.

Modifié par Mephales, 07 mars 2011 - 11:27 .


#81
daywalker03

daywalker03
  • Members
  • 357 messages
Any chance of the V3.2 editor becoming (more) functional any time soon?

#82
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Eshme, You would be able to decrypt/encrypt, and compress/decompress in c++, it should be relatively simple as long as you are not actually modifying the contained files. You could potentially add files to the ERF as well. Anything more would be quite a bit of work. I would actually recommend using C not C++ as you would just be doing bitwise manipulation, perhaps a bit of header editing.

Another thing I would be careful of is whether GMAX can run external files. It might be worth it to export to an intermediate then just have your external program do the actual exporting. It would probably faster and easier to maintain compatability.

#83
daywalker03

daywalker03
  • Members
  • 357 messages

ChewyGumball wrote...

Eshme, You would be able to decrypt/encrypt, and compress/decompress in c++, it should be relatively simple as long as you are not actually modifying the contained files. You could potentially add files to the ERF as well. Anything more would be quite a bit of work. I would actually recommend using C not C++ as you would just be doing bitwise manipulation, perhaps a bit of header editing.

Another thing I would be careful of is whether GMAX can run external files. It might be worth it to export to an intermediate then just have your external program do the actual exporting. It would probably faster and easier to maintain compatability.


Gmax should be able to; didn't Brian Chung (ThriKreen) do domething like this with NWMax?

#84
Mephales

Mephales
  • Members
  • 83 messages

daywalker03 wrote...

Any chance of the V3.2 editor becoming (more) functional any time soon?


It's a pretty low priority. There is an existing editor for V3.2 GFF available at nwn.bioware.com/developers/gff_download.html that's not a memory-hog like the DA Toolset's V4.0 editor. Eventually mine will be able to edit V3.2, but assume it won't be anytime soon. I mainly put it in because I'd already written the parser and noticed there were a lot of V3.2 formats still in use, and this makes it somewhat easier to analyze game files.

#85
tazpn

tazpn
  • Members
  • 70 messages
Regarding the 8dd70fe1 hash its in the materialdefinitions of the release DA2 which I preloaded over the weekend.

I feel bad about posting other projects here but i've updated my erf unpacker as well as I introduced a bug in my hash detection script that dropped a large number of files. I have about 47000 hashes built up.  Its currently in tab seperated format since that is easier for me that way.  If I could get my sqlite adapter to do bulk insert I'd update the hashes presented here but I couldn't so I'm giving up for now.  Feel free to borrow those hashes and join them into your database.  Those tools are under my projects here with the hashes in the Resources folder of the binary download.

Edit:  Also if people want the standalone DAO GFFEditor with the Admin Rights removed and keyfile requirement removed contact me (unless they actually released a fix for that) and a couple of additions added about the new MAO files.  For obvious reasons I'm not posting it here.  I prefer the python editor here though because it is nowhere near the memory hog.

Modifié par tazpn, 08 mars 2011 - 06:02 .


#86
Mephales

Mephales
  • Members
  • 83 messages

tazpn wrote...
I feel bad about posting other projects here but i've updated my erf unpacker as well as I introduced a bug in my hash detection script that dropped a large number of files. I have about 47000 hashes built up.  Its currently in tab seperated format since that is easier for me that way.  If I could get my sqlite adapter to do bulk insert I'd update the hashes presented here but I couldn't so I'm giving up for now.  Feel free to borrow those hashes and join them into your database.  Those tools are under my projects here with the hashes in the Resources folder of the binary download.


I'm not sure I can borrow them per se, but I have added them to the database and credited you in the description.

#87
Thought Process

Thought Process
  • Members
  • 191 messages
Looks like string handling in your code is wrong for GFF 4.1 (as of 0.4.6): easiest way to see this is to open a DA2 save file.

#88
Mephales

Mephales
  • Members
  • 83 messages
Hmm, 'k. All I had to go on was profile.dap. Unfortunately it looks like I have more time to finish up Awakening and the other DLC, since Gamestop only shipped DA2 today.

However, if I could get my hands on a sample save file I could work on that as well.

#89
Thought Process

Thought Process
  • Members
  • 191 messages
I've sent you a sample.

#90
Mephales

Mephales
  • Members
  • 83 messages
Thanks. So it looks like the two new fields in the header are the number of strings and the address of the first zero-terminated string like I thought, but references to strings in structs and lists are for the nth string in the list, not the offset from the first string like I thought. OK, I'll have a new version up tonight.

#91
Mephales

Mephales
  • Members
  • 83 messages
0.4.7 is up. Thanks to Thought Process's sample, I finished figuring out V4.1, so that's done. And apparently my pitiful save game editor still works on DA2, as if anyone but I used it.

#92
daywalker03

daywalker03
  • Members
  • 357 messages
Nice. I'll grab it tomorrow and see how it goes. I also grabbed the file you suggested and it pretty much does what I wanted; I just have to change file extensions to get it to recognize editable files, but that's a minor annoyance I can deal with.

#93
tazpn

tazpn
  • Members
  • 70 messages
Tried the editor to give some extra potions and I think it nerfed my attack rate as next battle my DPS was zero. Your editor is nice and simple and gives a good summary view of inventory unlike using the GFFEditor but anyway...

#94
Mephales

Mephales
  • Members
  • 83 messages

daywalker03 wrote...

Nice. I'll grab it tomorrow and see how it goes. I also grabbed the file you suggested and it pretty much does what I wanted; I just have to change file extensions to get it to recognize editable files, but that's a minor annoyance I can deal with.


Have you tried drag-and-dropping those files onto the Bioware editor? It might work.

#95
Mephales

Mephales
  • Members
  • 83 messages

tazpn wrote...

Tried the editor to give some extra potions and I think it nerfed my attack rate as next battle my DPS was zero. Your editor is nice and simple and gives a good summary view of inventory unlike using the GFFEditor but anyway...


Really? So you used the savegame editor to just edit the number of potions in a stack? Assuming this was the version bundled with 0.4.7 or 0.4.6, that's concerning... It should just have edited the four bytes (or byte, since it's a limit of 99, at least in DA:O) that correspond to the stack size. I assume you did have the number of potions you adjusted it to? Do you still have the original and the edited? You could compare the two with www.cjmweb.net/vbindiff/ and see if more was changed. Otherwise, I can do some testing of my own once my copy arrives.... whenever that happens to be. <kirk>GAAAAAAMESTOOOOOP!</kirk>

#96
Malcroix

Malcroix
  • Members
  • 360 messages

Mephales wrote...

0.4.7 is up. Thanks to Thought Process's sample, I finished figuring out V4.1, so that's done.



It still can't save as 4.1 though, only 4.0 (which is unrecognisable by DA2). Any chance you could fix that? Otherwise savegames are uneditable.

#97
Mephales

Mephales
  • Members
  • 83 messages

Malcroix wrote...
It still can't save as 4.1 though, only 4.0 (which is unrecognisable by DA2). Any chance you could fix that? Otherwise savegames are uneditable.


It can't? Interesting, I was hoping it could load either. However, the Instant Save setting does support saving in 4.1, and as long as you don't plan on editing lists it works (it disallows list editing, so no corruption worries there.). My save game editor uses it to save Dragon Age 2 save games.

I'm currently working on the Instant Save so it can handle lists. Hopefully I'll be done tonight... And I still haven't gotten my copy of DA2, so it's not as if that's going to get in my way.

#98
Malcroix

Malcroix
  • Members
  • 360 messages
Thanks for the quick reply, Mephales!

So I have to turn on Instant Save, eh? Will try!

Also, what exactly do you mean by lists?

#99
Malcroix

Malcroix
  • Members
  • 360 messages

Mephales wrote...
However, the Instant Save setting does support saving in 4.1, and as long as you don't plan on editing lists it works (it disallows list editing, so no corruption worries there.). My save game editor uses it to save Dragon Age 2 save games.


Tried editing a save game with Instant Save on. Added a name for a player morph (in override) under character appearance.

Nothing in game, and when I opened the same save again, the field was blank, as if it didn't save the change I made.

Maybe I'm doing it wrong © and am using the Instant Save function improperly?

Also, after looking in the log, I see I'm getting a lot of "NotImplementedError: Views cannot update string fields in non-V4.0 GFFs". All I did was try to insert a morph name in the relevant field in the Appearance tag.

Modifié par Malcroix, 10 mars 2011 - 12:38 .


#100
Mephales

Mephales
  • Members
  • 83 messages
Ack, I forgot about that. I hadn't implemented rebuilding the string table in that version.

You know what, in about 15 minutes or so I will have uploaded the new version. It doesn't have any restriction on editing, though it's no longer "Instant Save".