Dawnguard PSC Files [merged]

Post » Sat Nov 17, 2012 7:35 pm

jmpf is jump if condition is false

http://www.uesp.net/wiki/Tes5Mod:Compiled_Script_File_Format
plb's working on a parser to work with ian's decompiler (linked at the bottom of that page).
Also worth noting the date and time that decompiler was made -- He really is incredible.
(You'll need to change minor version to 2 in order to decompile Dawnguard scripts)

Edit: oh he already replied! Great work
User avatar
Lily Evans
 
Posts: 3401
Joined: Thu Aug 31, 2006 11:10 am

Post » Sat Nov 17, 2012 7:51 pm

@DocClox:

I'm using the PEX decompiler found on the nexus. Then I use some regular expressions to convert some of it into papyrus. The rest I do by hand.
As for the commands; look at my post (#31).

And yes the decompiler does generate crap halfway through the file for some files. Probably because of changes since the release of the decompiler.
User avatar
Rachie Stout
 
Posts: 3480
Joined: Sun Jun 25, 2006 2:19 pm

Post » Sat Nov 17, 2012 10:04 pm

It's as if I never even posted at all...
User avatar
STEVI INQUE
 
Posts: 3441
Joined: Thu Nov 02, 2006 8:19 pm

Post » Sat Nov 17, 2012 3:31 pm

@Mardoxx thank you for pointing out that scriptdumper could handle dawnguard files as well. I've tried it on one of the problematic files and it does seem to generate a complete script; now I'll have to see if I can get the hang of the somewhat different layout... At least until PurpleLunchBox can get that parser ready.
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Sun Nov 18, 2012 3:35 am

Hey guys I was just PM'ed by a dev about the missing sources; Bethesda is aware of the problem, but there is no news as of yet about when (or if, though I assume) they will be available.

He was also kind enough to point out that the PapyrusAssembler that ships with the CK can itself also disassemble the pex files. I just tried it and it also produces readable output, of course some work is still required to convert that to a psc file, but it will definitely help.

The Papyrusassembler generates fairly easy to process code and it uses labels instead of offsets.
User avatar
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Sun Nov 18, 2012 3:57 am

snip

Not to sound like I'm gushing or anything, but you are awesome. Thank you for taking the time to do put up these scripts.
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Sat Nov 17, 2012 8:55 pm

@PurpleLunchBox:
Could you try your decompiler on the DLC1NPCMentalModel (or something like that) pex file (this file would be useful to any mods modifying companion behavior). The old decompiler chokes about halfway through the file, making it impossible for me to decompile it. I suspect the scripting changes made with version 1.6(?) are responsible, since the script compiler decompiler was not updated since december 2011.
I was thinking of coding a decompiler myself, but since you seem to making good progress...
Script breaks about 3/4 the way down due to conditional messups I haven't fixed yet, also two instructions I haven't parsed yet (Because I haven't seen them before lol) so things might look a little weird in those areas.
http://pastebin.com/i09rWLQN
The pex format hasn't really changed, they only updated the version number.
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Sun Nov 18, 2012 2:03 am

He was also kind enough to point out that the PapyrusAssembler that ships with the CK can itself also disassemble the pex files. I just tried it and it also produces readable output, of course some work is still required to convert that to a psc file, but it will definitely help.

The Papyrusassembler generates fairly easy to process code and it uses labels instead of offsets.
That sounds very interesting. (I have used the decompiler from Nexus to verify how some convoluted logical comparisons are resolved.)

I tried using the CK assembler for disassembly, but I couldn't get it to run properly, most likely due to some trivial issue with parameters or file placements I couldn't figure out (as it seemed unable to find my pex no matter what I tried). I wonder, if I could ask you to kindly give any single working example of how it might be successfully run?
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Sun Nov 18, 2012 4:13 am

Disassemble:
PapyrusAssembler -D

It's a very simple application and only looks in the current working directory. You can also use the "-?" flag to see all the options.

The output will go to the current working directory in ".disassemble.pas". To re-assemble, remove the "disassemble" part of the filename and the "-D" from the above command line. (The filename change is so that disassembly won't overwrite any assembly file you may be working on)
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Sat Nov 17, 2012 2:48 pm

Thanks. That was exactly how I assumed it should work, apart from the "without extension" bit. My problem was using the automatic feature in the Windows command line box to complete the file name, which of course automatically also gave me the extension. Trivial indeed.
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm

Post » Sat Nov 17, 2012 6:34 pm

One interesting thing I noticed is that Events in Papyrus are mapped to normal functions (no special flags as far as I can tell) in the disassembled file.
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Sat Nov 17, 2012 7:49 pm

Could someone please give me a total idiot's guide to using that papyrus assembler thingy? I tried to run it but it just flashes for a millisecond and disappears so I'm probably doing it wrong... ._.
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Sun Nov 18, 2012 1:18 am

One interesting thing I noticed is that Events in Papyrus are mapped to normal functions (no special flags as far as I can tell) in the disassembled file.
events and functions are treated the same in papyrus, its purely syntactical

Could someone please give me a total idiot's guide to using that papyrus assembler thingy? I tried to run it but it just flashes for a millisecond and disappears so I'm probably doing it wrong... ._.
Go to the folder with it in, shift right click, open command window here, papyrusassembler filename switches
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Sun Nov 18, 2012 2:57 am

events and functions are treated the same in papyrus, its purely syntactical

That was my conclusion as well.
User avatar
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm

Post » Sun Nov 18, 2012 6:09 am

events and functions are treated the same in papyrus, its purely syntactical


Go to the folder with it in, shift right click, open command window here, papyrusassembler filename switches
I got completely lost after "open" ^^

Awh I just wish bethesda would release those sources! ._.
User avatar
Josh Lozier
 
Posts: 3490
Joined: Tue Nov 27, 2007 5:20 pm

Post » Sun Nov 18, 2012 1:18 am

Drop a file into the same directory as the PapyrusAssembler.exe, say dlc1batseffectscript.pex. Then type:

D:\Games\Steam\steamapps\common\skyrim\Papyrus Compiler>PapyrusAssembler.exe dlc1batseffectscript -dStarting disassembly of dlc1batseffectscript0 error(s), 0 warning(s)Disassembly succeeded

Notice there's no .PEX after the file name. It assumes that. AFter running you should get a file like:
dlc1batseffectscript.disassemble.pas

You can open that file in the editor of your choosing.

-MM
User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Sun Nov 18, 2012 1:49 am

Drop a file into the same directory as the PapyrusAssembler.exe, say dlc1batseffectscript.pex. Then type:

D:\Games\Steam\steamapps\common\skyrim\Papyrus Compiler>PapyrusAssembler.exe dlc1batseffectscript -dStarting disassembly of dlc1batseffectscript0 error(s), 0 warning(s)Disassembly succeeded

Notice there's no .PEX after the file name. It assumes that. AFter running you should get a file like:
dlc1batseffectscript.disassemble.pas

You can open that file in the editor of your choosing.

-MM
Aw thank you! But I think my problem is that I don't know *where* to type those things ^^ Whenever I try to open the assembler exe there's just a brief flash of a little black window and then nothing ._.
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Sun Nov 18, 2012 6:12 am

Aw thank you! But I think my problem is that I don't know *where* to type those things ^^ Whenever I try to open the assembler exe there's just a brief flash of a little black window and then nothing ._.

You essentially have to run cmd.exe, which creates that window, and then run the application inside it.
This is one of several pages I found using google: http://www.computerhope.com/issues/chdos.htm

Be advised however, that you also need to navigate into the appropriate directory when you have it open. That is all elemental MS-DOS stuff from years ago, and if you don't have a clue about it, you might find it a bit tricky. There are also tricks to setting Windows up so that one can easily open up that Command Line window in any folder one wishes, but that is then all about Windows tweaking, Right now I am much too tired to even think about possibly beginning to tentatively contemplate over any chance of going into that.
User avatar
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am

Post » Sat Nov 17, 2012 8:58 pm

If on Windows 7, Shift-Right-Click on the folder that contains the executables you want to run and select "Open Command Window Here". That opens the Command Prompt at that path instead of you needing to either type out the path name for the executable or doing a cd to the directory.
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Sat Nov 17, 2012 11:38 pm

Well, at least that is made easier then, than what it is with XP. Hopefully they will cough up the SP2 at some point, so I can also be bothered to upgrade. :)
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Sat Nov 17, 2012 2:45 pm

Well, at least that is made easier then, than what it is with XP. Hopefully they will cough up the SP2 at some point, so I can also be bothered to upgrade. :smile:

XP had that as well, but you had to install the add-on from M$oft to get it. Not sure if they still host it, though. :shrug:
User avatar
Betsy Humpledink
 
Posts: 3443
Joined: Wed Jun 28, 2006 11:56 am

Post » Sun Nov 18, 2012 1:27 am

Okays I somehow made it work by making a shortcut to the assembler and adding
insertscriptnamehere -d
to the "Target" field in file properties!

And awwwh I still only understand like a fraction of the output ._.

I so hope bethesda will release those sources soon! I just don't understand why they aren't available yet, this is stupid ._.
User avatar
Laura Ellaby
 
Posts: 3355
Joined: Sun Jul 02, 2006 9:59 am

Post » Sun Nov 18, 2012 12:51 am

@iMissLeeches:
Are you looking for any script in particular? I could convert it when I have some spare time...
User avatar
Annick Charron
 
Posts: 3367
Joined: Fri Dec 29, 2006 3:03 pm

Post » Sun Nov 18, 2012 5:01 am

@iMissLeeches:
Are you looking for any script in particular? I could convert it when I have some spare time...
Ohh you could? I would love that!

But... sadly I'm not looking for just one script which is why just having those sources would be so much easier! Right now I need all the new vampirism related perks (especially the new script for the old "thirst for blood" perk) and all the magic effects for new vampire abilities so I can see how they work and start integrating them with Vampiric Thirst's blood system and then I will need to know how the new perk tree works and so on and so on... that probably means I will need sources for everything that's vampire related ._.
User avatar
Vicky Keeler
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:03 am

Post » Sun Nov 18, 2012 3:48 am

Ohh you could? I would love that!

But... sadly I'm not looking for just one script which is why just having those sources would be so much easier! Right now I need all the new vampirism related perks (especially the new script for the old "thirst for blood" perk) and all the magic effects for new vampire abilities so I can see how they work and start integrating them with Vampiric Thirst's blood system and then I will need to know how the new perk tree works and so on and so on... that probably means I will need sources for everything that's vampire related ._.
The two scripts that plb posted are the only ones you should need.
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

PreviousNext

Return to V - Skyrim