STAR WARS™: The Force Unleashed™ Ultimate Sith Edition

STAR WARS™: The Force Unleashed™ Ultimate Sith Edition

Not enough ratings
Modding TF1 by extracting the contents of an .lp archive file, modifying files, and reimporting them back.
By Dill Dough
I'm so sorry about the length, i'm not good at writing guides but i thought i should probably just publish this for others to see. This game has had the reputation of being "unmoddable" for far too long. A game being "unmoddable" is a scam and a massive psy-op. Everything's moddable if you put your mind to it.
   
Award
Favorite
Favorited
Unfavorite
Intro
This is a really quick guide i'm writing in order to share what i just figure out, which is, a method for making mods for TFU1 by extracting the contents of a given .lp archive file (using QuickBMS), modifying any number of files you want, and reimporting the extracted files back into an archive (also using QuickBMS).

This process allows you to mod TFU1. Not quite to the extent that mods such as Kuku's SWTFU Characters Mod are able to mod TFU2, as this method doesn't allow you to add new files to be loaded into the game just yet... but yeah.

For context, TFU2's .lp files (which is a custom type of archive) are openable and modifiable using WinRAR, whereas the formatting of TFU1's .lp files makes this a bit more difficult. But, i figured out how to unpack TFU1's .lp archives, and also how to reimport modified files back in!
Well, to be honest i didn't figure it out, i just pieced the method together from a QuickBMS script made by someone else like a decade ago, and QuickBMS' cool file reimportation mode. So credit where credit is due!
First Steps:
First things first, you're going to need to download TFU1.

Then, download QuickBMS https://aluigi.altervista.org/quickbms.htm

Now download the QuickBMS script used to extract and reimport .lp files https://aluigi.altervista.org/bms/star_wars_lp.bms
Something To Note about .lp Files:
An .lp file is a custom archive file, like .rar, that the TFU games use to store things like animations, 3D models, some gameplay logic, global game variables, force power effects and usage, .xml files relating to some VFX, and much more.

The TFU1 .lp files seem to have a lot of duplicate files, especially between the different outfits (each outfit has all of it's relevant data stored in it's corresponding .lp file, hence much of the data like animations and VFX are duplicated between them).
I haven't figured out the way the game loads those files (Since there might be a way to reimport eg. a modified .xml file into a single custom .lp file, where this could theoretically override and supersede other copies of this file, but i haven't figured this out so far. So for now, i've only been able to modify each outfit's .lp file individually to make sure any changes affect each outfit.)

These facts alone are a massive pain in the ass. For an example, Kuku's Mod for TFU2 is able to simply insert new files into the game quite easily by creating new .lp archives, which contain many files directly taken from TFU1 (Like for example the Darth Maul costume with the double-bladed lightsaber hilt of the Darth Maul boss from TFU1.)

IN SHORT: iI've only figured out how to do .lp archive-specific file replacements for now in TFU1 (like swapping the model of the lightsaber hilt in a player costume .lp file), but i haven't figured out how to add new files.
Next Steps:
Extract QuickBMS into a designated folder.
Place the downloaded script into the same folder as quickbms.exe.
In the same directory, create two folders: one named "input" and another named "output". (You can call these whatever you want, but i'm going to be using those names from now on)
Now you're ready to go. I'll explain exactly how to extract files from a given .lp archive and how to reimport modified files.
Where to Find .lp Files?
Go to your install directory of TFU1. Then, go to a folder called "LevelPacks". This folder contains all of the game's .lp files.
Some of these .lp files represent data which appears in some particular level (like the file "cloudcity_act2_pc.lp", which appears to contain all data relating to the Cloud City level. This contains the level geometry, object data, level logic, enemy models and other data, etc)
But other .lp files represent individual outfits wearable by the player. I haven't looked into the level-based .lp files yet, so we'll be taking a look at how to modify some very simple behavior of a particular player costume.
Non-Comprehensive List of Select Costume .lp Files:
This is a slightly rough list so forgive some mistakes. This is mostly just to illustrate which .lp files contain costumes you might wish to modify:

player.actor.xml_pc.lp - This is the "Training Gear" costume. First one you unlock.
playerdarthvader.actor.xml_pc.lp - This is the file for the playable Darth Vader of the game's prologue mission on Kashyyyk. I've now managed to mod him into the game, replacing the slot of another costume. You can find that mod here: https://www.nexusmods.com/starwarstheforceunleashed/mods/25?tab=description
playerdeathstar.actor.xml_pc.lp - This is the "Jedi Adventurer Robe" from the Death Star mission.
playerdarthmaul.actor.xml_pc.lp - This is the Darth Maul costume. (Note: it should be possible to give him a double-bladed lightsaber while using the default animations, like in Kuku's Ultimate Mod for TFU2. I am currently working on that.)
playerraxusact1.actor.xml_pc.lp - This should be the "Heavy Training Gear", from the first mission to Raxus Prime.
Next Steps...?
Right, so in your game's "LevelPacks" folder, find a file called "player.actor.xml_pc.lp". This file is responsible for the default costume worn by the player character in the TIE Factory level, the first post-prologue level of the game. This is the first costume you unlock in the costumes screen, you know the one. We'll be working on this one for simplicity's sake.
Note that since we'll only be modifying this one outfit, any changes we make to it will be exclusive to this one outfit. You can duplicate the changes for other outfits if you'd like to maintian those changes outside the outfit.

Copy the "player.actor.xml_pc.lp" file and place it in the "input" folder you created earlier in the QuickBMS directory.

If you wish, you might want to read QuickBMS' readme file for additional context. I've rambled on enough, so i'll try to be quick here:
Removing the Ugly-Ass Streaking Blur from Starkiller's Default Outfit when Attacking and Dashing:
1. Double-click the "quickbms.exe" file.
2. A file selection window will pop up: Select the QuickBMS script that you downloaded. (Should be called "star_wars_lp.bms")
3. Another file selection window will appear: Go to your "input" folder and select the "player.actor.xml_pc.lp" file you just copied there.
4. Yet another file selection window appears: Open your "output" folder, and press the "Save" button. This will select the "output" folder as the output of the extraction.
5. Once the extraction is finished and the command prompt shows text that you can close QuickBMS, close it.
6. Go into the folder "Scum", then "characters", then "actor", then "maleAverage", then "player"
7. Find the "player.boneblur.xml" file. Open it in Notepad (Preferrably Notepad++, but whatever)
8. Find these lines at the top of the file:
<alpha>1.0</alpha>
<amountOfBlurStreaking>0.9</amountOfBlurStreaking>
<maxLength>5</maxLength>
9. Change numbers, so that they look like this: (Adding or deleting symbols when editing these .xml files has the potential to cause some issues, but after extended testing, i've come to the conclusion that it's fine the majority of the time. However you *can* also update the file size values, held in hexadecimal in the "player.actor.xml_pc.lp" file's header. See the section of the guide below if you're interested in doing that. But yeah, i don't personally do that anymore when modding the archives.)
<alpha>0.0</alpha>
<amountOfBlurStreaking>0.0</amountOfBlurStreaking>
<maxLength>0</maxLength>
10. Save the file and exit Notepad
11. Find a file called "reimport3_localizations.bat" and run it. (This runs QuickBMS in a file reimportation mode for sequential files, like .lp)
12. Select the same script you used for extracting files ("star_wars_lp.bms)
13. Now select the same .lp file you just extracted earlier, in your "input" folder. ("player.actor.xml_pc.lp")
14. Finally, now you go into your "output" folder and press "Save", like before. Since we're using the reimport functionality, the "output" folder you select acts as the folder *from which* files are reimported *into* the .lp archive.
15. Wait until the process is finished: now the "player.actor.xml_pc.lp" file in your "input" folder contains the modified file.
16. Copy the "player.actor.xml_pc.lp" file from your "input" folder, and paste it into the "LevelPacks" folder in your TFU1's game files. Replace the original file (Back it up beforehand in case something goes ♥♥♥♥♥-wucky!)
17. Play the game, select the "Training Gear" costume, and you'll notice that the fugly motion blur that happens during dashing and some attacks is completely gone! Magic!!!)
How to Change .xml File Length Without Crashing the Game
UPDATE: Skipping this step tends to actually *NOT* crash the game, so you can ignore this section. I've experienced some strange glitches sometimes since i started skipping this step, but i'm not sure if that's because of this. I've kept the old text here just to be thorough.

I've discovered a way to change the length of exported .xml files, so that reimporting them into an .lp archive doesn't crash the game. Let's use the same .lp file and .xml file as before as an example.

In the "player.boneblur.xml" file, find the line that we modified earlier:
<amountOfBlurStreaking>0.0</amountOfBlurStreaking>

Change it to this:
<amountOfBlurStreaking>0.00</amountOfBlurStreaking>

Then save the file and reimport it into the "player.actor.xml_pc.lp" file as above.

Then open the "player.actor.xml_pc.lp" file in a hex editor. What we do here is adjust the file's internally recorded file size to match the updated, actual file size with the modified .xml reimported back in.

Right click on the file and select "Properties". Check the "Size", in bytes. For me it says "63.0 MB (66,113,566 bytes)".

We need to convert that byte number (which is a signed int32) into it's corresponding Hexadecimal code, specifically in LITTLE ENDIAN notation. You can do that online. The result is "1ED0F003".

Open up the file using a hex editor and find the two addresses, one at offset 0x00000034, and another at offset 0x00000048. These offset locations are intrinsic to the headers of all .lp files, this is where the file stores it's size for verification. If the file's actual size in bytes is different from this internal size, that crashes the game once the file is inserted into the game files.

So now, find the 8 numbers starting at locations 0x00000034 and 0x00000048. For the unmodified "player.actor.xml_pc.lp" file, both of these fields hold the value "A0CBF003". Depending on which hex editor you're using, you'll be able to just Ctr+F and find that value. It only appears twice in the entire file: right here at the beginning, and we'll be modifying both of them.

Change both of these values of "A0CBF003" into "1ED0F003", and save the file. Then insert it into the game's "LevelPacks" folder as before.

You'll see no changes to the game in any way - BUT, it will not crash! This means we have successfully inserted data into an .xml file, and we have packed it into it's .lp file correctly.

This technique can be used for even greater things than i originally hoped for. God bless OpenBMS. (Now, installing these particular mods is still a hassle - you need to go through this process for each costume you want to modify, even if a given mod only changes a single file within an .lp archive. This is kinda stupid, but using QuickBMS seems to provide no easier solution unless somebody writes a dynamic install script or something. Also publishing mods is a pain for the same reasons - i've made some simple modifications for my own use, such as removing those ugly lightsaber halo effects that appear during combos, and changing the dash to feel as responsive as in TFU2 by reducing the hidden "dash cooldown". I'm hesitant about releasing those mods precisely because of the messiness for the end user, and the large download size, but if there is at least some interest, i can throw them up on MODDB or NexusMods or something if you guys want. Peace!)
1 Comments
rem Mar 29 @ 1:38pm 
this is amazing