Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

selyb

Modding
How To Create Patchkits For Applypatch

13 posts in this topic

This is a tutorial to create a patchkit for use with my ApplyPatch app. This requires that you have already converted a mod to a working DLC and you want to create a patchkit for it instead of realeasing the repacked mod files. If you are trying to convert a mod to Xbox 360 DLC, refer to this tutorial

I tried to make ApplyPatch versitile and easy to adapt so there are multiple ways to make the patchkits. For simplicity for end users, it is recommended to use ApplyPatch as-is and only modify the patchkit as necessary.

ApplyPatch.bat usage is like this:

 

applypatch.bat file [patch] [md5]file is the original file to be patchedIf patch is not specified then ApplyPatch will look for file.deltaIf md5 is not specified then ApplyPatch will look for file.md5

So for this to work, you need the original mod file(s), a single combined file if the mod has multiple files, an md5 of that single file, and the patch created with xdelta3. You can read the usage on xdelta3 and md5sum to create these files or you can use the same method I use with the files provided below.

For all methods, you will need this bat in your system32 folder (or anywhere in your path)

makepatch.zip

ESP only:

1) Extract original mod ESP into a tmp folder

2) Copy this bat file to the same tmp folder

ESP_Only.zip

3) Copy the already created DLC file to the same tmp folder

4) Open a command prompt and run this

 

makepatch original.esp DLC_File original.delta
where original.esp is the name of the esp and DLC_File is the name of the existing DLC file. This will create the md5 and delta files with the same name as the original esp.

5) Rename ESP_Only.bat to the same name as original.esp (e.g. SkillRings.esp > SkillRings.bat)

6) Open ESP_Only.bat with notepad and edit this line:

Set "sDest=Destination"
Change Destination to the filename of the DLC file (e.g. "sDest=SkillRings v1.1" or "sDest = SkillRings_Xbox360_DLC")

7) redistribute the .md5, .delta, and edited bat file

ESP plus BSA:

1) Extract original mod ESP and bsa into a tmp folder

2) Copy this bat file to the same tmp folder

ESP_plus_BSA.zip

3) Copy the already created DLC file to the same tmp folder

4) Open a command prompt and run this

copy /b "original.bsa"+"original.esp" "original.bin"makepatch original.bin DLC_File original.delta
where DLC_File is the name of the existing DLC file. This will create the md5 and delta files.

5) Rename ESP_plus_BSA.bat to the same name as original.esp (e.g. SkillRings.esp > SkillRings.bat)

6) Open ESP_plus_BSA.bat with notepad and edit this line:

Set "sDest=Destination"
Change Destination to the filename of the DLC file (e.g. "sDest=SkillRings v1.1" or "sDest = SkillRings_Xbox360_DLC")

7) redistribute the .md5, .delta, and edited bat file

ESP plus loose files:

This gets a bit more complicated. This bat file expects an extra file as a list of all the loose files.

Loose Files.zip

To set this up, you will first need to create the list of files. Extract the original mod into your tmp folder, open a command prompt there, and do this

for /r %f in ("*") do echo %f >> files.lst

Next, you need to edit this file in notepad and remove the beginning of every line. You may also want to remove some files from the list if they are not part of the mod (e.g. FOMOD folder, Docs folder). What I mean by remove the beginning of each line is remove the current folder so that when the end user runs this script, they don't have to create the same folder structure you have. My list file had this:

F:\x360\tmp\wabba-ori_proj.esp F:\x360\tmp\wabba-unrel_proj.esp F:\x360\tmp\fomod\ModuleConfig.xml F:\x360\tmp\meshes\clutter\food\cheesewedge01-morefire.nif F:\x360\tmp\meshes\clutter\food\cheesewedge02-morefire.nif F:\x360\tmp\meshes\clutter\food\cheesewheel01a-morefire.nif F:\x360\tmp\meshes\clutter\food\cheesewheel01b-morefire.nif F:\x360\tmp\meshes\clutter\food\cheesewheel02a-morefire.nif F:\x360\tmp\meshes\clutter\food\cheesewheel02b-morefire.nif F:\x360\tmp\meshes\weapons\daedric\daedricarrowprojectile-long-fire-collision-morefire.nif F:\x360\tmp\meshes\weapons\daedric\daedricdaggerarrow-fire-collision-morefire.nif F:\x360\tmp\Scripts\DA15WabbajackEffectSCRIPT.pex F:\x360\tmp\Scripts\magicProjectileSelfAttack_Hits_Caster.pex F:\x360\tmp\Scripts\magicProjectileStormScript_Hits_Caster.pex F:\x360\tmp\Scripts\magicProjSelfAttack_hits_caster_cheese.pex F:\x360\tmp\Scripts\magicProjStorm_Hits_Caster_Cheese.pex F:\x360\tmp\Scripts\magicSetWeatherScript_Hits_Caster.pex F:\x360\tmp\Scripts\teleportRandomwabba.pex F:\x360\tmp\Scripts\teleportwabba.pex F:\x360\tmp\sound\fx\wabba\sheogorath-wabba.wav 

My current folder is F:\x360\tmp\ so I had to remove that from the beginning of each line and also remove the FOMOD folder. I also recommend to put the esp at the end of the list. This is because I use Friday DLC Maker and inside the DLC container, the esp is added after the bsa.

 

meshes\clutter\food\cheesewedge01-morefire.nif meshes\clutter\food\cheesewedge02-morefire.nif meshes\clutter\food\cheesewheel01a-morefire.nif meshes\clutter\food\cheesewheel01b-morefire.nif meshes\clutter\food\cheesewheel02a-morefire.nif meshes\clutter\food\cheesewheel02b-morefire.nif meshes\weapons\daedric\daedricarrowprojectile-long-fire-collision-morefire.nif meshes\weapons\daedric\daedricdaggerarrow-fire-collision-morefire.nif Scripts\DA15WabbajackEffectSCRIPT.pex Scripts\magicProjectileSelfAttack_Hits_Caster.pex Scripts\magicProjectileStormScript_Hits_Caster.pex Scripts\magicProjSelfAttack_hits_caster_cheese.pex Scripts\magicProjStorm_Hits_Caster_Cheese.pex Scripts\magicSetWeatherScript_Hits_Caster.pex Scripts\teleportRandomwabba.pex Scripts\teleportwabba.pex sound\fx\wabba\sheogorath-wabba.wav wabba-ori_proj.esp 

You can see that the relative paths are still present. This is necessary. Also just for this mod, there were two esp files and the other wasn't needed so I removed it from this list.

Now, we need to create the bin file that the patchkit will use to patch. Put this batch file into the tmp folder and drag/drop files.lst onto it.

Makebin.zip

Once the bin file is created, rename the bin, lst, and Loose Files.bat to match the name of the esp file. Now you need your already converted DLC file in the same tmp folder. Run makepatch

 

makepatch original.bin DLC_File original.delta

Last, you need to edit the sDest line in Loose Files.bat to the name of your DLC file. That should be all. If you have any questions don't hesitate to reply and I will do my best to help you through it.

Edited by selyb
pcaquercia likes this

Share this post


Link to post
Share on other sites

thanks for posting this so fast!

Now i have only one question. The first mod i want to post is this: http://skyrim.nexusmods.com/mods/27043

But when running it on the xbox as is, the candle smoke will have a gray cube involving it. So i removed the effect with tes5edit.

So can a patchkit make those changes when creating the dlc for the end-user using the original esp as base?

a pic of how the original looks on the xbox: https://docs.google.com/open?id=0BzWtcdgVFxivZFlvUXVQUy1NR3c

Edited by pcaquercia

Share this post


Link to post
Share on other sites

The patchkit can take any file and patch it to any other file. You could take Skyrim.exe and patch it to Rain.dds, though what purpose would that serve? ApplyPatch uses xdelta3.exe which is a universal binary patcher. It will apply any given patch to any file even if it isn't the original file. This is why I packaged md5sum with it. ApplyPatch uses md5sum to verify the original file is correct before applying the patch.

So can a patchkit make those changes when creating the dlc for the end-user using the original esp as base?

I have done similar things with some of the patchkits I posted. BTW, that gray cube issue sounds like something I saw when I repacked Textures.bsa incorrectly. Maybe your bsa for the mod is invalid? I will update my mod conversion tutorial soon with directions for the new BSAOpt v2 because it can now create Xbox360 archives. Edited by selyb

Share this post


Link to post
Share on other sites

Since i use the Archive tool for bethesda, it seem unlikely that it would be invalid.

And i've created bsa's containing textures before the same way and none had this problem. I believe it's the way the effect is implemented itself, as i recall it's a box that replay the same sequence of textures (4 i think) in all faces (the effect is kind of always "facing" you).

Share this post


Link to post
Share on other sites

Looking at the mods i want to upload, some have loose files, so the bat file for that would be nice if it's not too much trouble.

Or i could just make a patchkit for the esp + bsa, and ask people to build their own bsa

Share this post


Link to post
Share on other sites

Or i could just make a patchkit for the esp + bsa, and ask people to build their own bsa

This is too much trouble for the end user and is why I made the system for myself. I will finish that either tonight or tomorrow.

Share this post


Link to post
Share on other sites

Draggin and dropping the files.lst into the makebin.bat was not working for me, got a message 1 file(s) copied and cmd closed really fast.

Had to open cmd, go to location and run makebin.bat files.list command, and after a while the bin got created

edit: successfully created a patchkit for a loose files mod, uploading now!

Edited by pcaquercia

Share this post


Link to post
Share on other sites

Draggin and dropping the files.lst into the makebin.bat was not working for me, got a message 1 file(s) copied and cmd closed really fast.

It probably created it in your system32 folder, you might wanna check there. I'll edit the makebin.bat so it can be dragged/dropped.

Edit: Actually, I'm going to write a vbscript that will do more of the work. I'll post it later or tomorrow.

Edited by selyb

Share this post


Link to post
Share on other sites

Trying to convert some more mods today and i've noticed that if the files.lst entries have blank spaces, the bin created with makebin comes back blank (zero bytes)

Renaming stuff and updating the files.lst solved the problem, and i suppose, changing back the files.lst after the patch is created will result in a working patch

But it's impratical in some cases, as mods may have hundreds of files.

Am I doing something wrong, or is this a legitimate problem?

btw, was converting this mod

http://skyrim.nexusmods.com/mods/12977

edit: actually, just updating .lst with the normal names resulted in an error with the bin when running the bat to create the dlc

Edited by pcaquercia

Share this post


Link to post
Share on other sites

Redownload Loose Files.bat and Makebin.bat. Both should fix problem with spaces in file names and you should now be able to run makebin from anywhere. A .bin file will be created with the same name as the .lst file dropped onto it.

pcaquercia likes this

Share this post


Link to post
Share on other sites