Page 1 of 1

[Tutorial] How to transfer PR weapons into your personal mod(step by step)

Posted: 2012-04-24 09:21
by Kingslayer
OK I know this is not supposed to be in here, but since I cannot create a thread in the tutorials section I had to create it in here, if any mod read this and can be kind enough to move it were it belongs will be much apreciated. :)

Well, some things to take in account before the tutorial:

* English it's not my primary language, so I might/will have some incongruencies in what I write. :o ops:
* The tutorial it's like a "90%" secure, this means that the other "10%" are things which I'm not 100% sure if they are necessary for the weapons transfer or not, so they will be a "trial and error" for you.
* The way you extract a file/folder from the .zips is the next one:

_I extract the file "X" from "weapons_client.zip".
_I look into the "weapons_client_patch1.zip" for the file "X", if the file it's in there I extract and overwrite the "X" file from "weapons_client.zip".
_I look again but now into "weapons_client_patch2.zip", if the file it's in there I extract and overwrite the "X" file from "weapons_client_patch1.zip".

* If your mod doesn't have a respective .zip(menu_client.zip for example) or file you can create a new one or you can use the ones from BF2.
* This is my first tutorial EVER, so it might end up a little "disordered".
* ALWAYS REMEMBER TO MAKE A BACKUP OF EVERYTHING THAT YOU MODIFY!!
* Listening your favorite music/theme/song will help you...A LOT xD

1? WHAT DO YOU NEED?

* BF2 patched to 1.50
* Project Reality(LOL)
* Notepad++(you can use another similar program but I strongly recommend you using this one)
* WINRAR or 7zip
* Patience(LOL again)

2? PREPARING FOR WORK

Create a folder anywhere you want and name it "PR weapons"(or whatever you want to name it) and place in that folder the next .zips:

"C:/Program files/EA Games/Battlefield2/mods/PR/Objects"
_weapons_client.zip
_weapons_client_patch1.zip
_weapons_client_patch2.zip
_weapons_server.zip
_weapons_server_patch1.zip
_weapons_server_patch2.zip

"C:/Program files/EA Games/Battlefield2/mods/PR"
_common_server.zip
_common_server_patch1.zip
_common_server_patch2.zip

"C:/Program files/EA Games/Battlefield2/mods/PR/menu"
_menu_client.zip
_menu_client_patch1.zip
_menu_client_patch2.zip
_menu_server.zip
_menu_server_patch1.zip
_menu_server_patch2.zip

3? ICONS, HUDS

This method in particular will give you not only the weapon's icons but EVERYTHING including HUDS, now the "problem" is that some huds/icons from PR are named identically like some ones from BF2, this will make some bf2 icons/huds that are not related to weapons to be replaced or overwrited by the ones from PR, it's not really that big of a deal for me BUT if it bothers you, then you can use the method "B".

METHOD "A"

1_Go to your work folder and extract "MemeAtlas_0.dds" and "MemeAtlas_1.dds" from the Atlas folder in the "Menu_client.zip", and put this 2 files into the Atlas folder from YOUR MOD'S "menu_client.zip".

2_Go to your work folder and extract "PR_MemeAtlas.tai" from the Atlas folder in the "menu_server.zip", and put it in the Atlas folder from your mod's "menu_server.zip".

3_Go to your mod's "menu_server.zip" and extract "AtlasList.con", open the file and add this line at the end:

hudManager.addTextureAtlas "PR_MemeAtlas.tai"

Save the file and put it back into the Atlas folder from your "menu_server.zip", and that's it you have all the necessary icons/huds for the weapons.

METHOD "B"

This method will allow you to avoid the "conflict" with PR/BF2 icons/huds but it will give you a lot more work since you will have to manually add the icons/huds.

Repeat the step 1 from method "A", and extract the "MemeAtlas.tai" from the Atlas folder of your mod's "menu_server.zip", leave it in somewhere and later I will tell how to use it.

4? OPTICS/SIGHTS

OPTICS:

1_Go to your work folder and extract the "optics" folder from "TR_Scripts" in the "common_server.zip".

2_Create a folder and name it "TR_Scripts"(without the ") an add the optics folder in it.

3_Put the "TR_Scripts" folder into your mod's "common_server.zip".

SIGHTS:

All sight/reticles from the PR weapons are in the "menu_server.zip\HUD\HudSetup\Weapons", BUT it's not recommended to transfer ALL the files since, like with the icons/huds, some PR sights/reticles are identically named like some ones from BF2 so you should only use the ones necessary for the weapons you are transferring, for example if you are transferring the M4_eotech then you just need to use the "HudElementsEotech.con" for the eotech's reticle.

1? Go to your work folder and extract the "HudElement" you need for your weapon from "menu_server.zip\HUD\HudSetup\Weapons", and add it to your mod's "menu_server.zip\HUD\HudSetup\Weapons".


ICONS/HUD METHOD "B" PROBLEM:

If you are using the method "B" for icons/hud transfer then we have extra work to do since you need to manually add the reticles/sights.

1_First than nothing you need to identify the ".tga" you want to add, I'm going to use the eotech's reticle as an example:

Open the "HudElementsEotech.con" and look for the ".tga" name, in this case is "Ingame\CrossHair\eotechAimPoint.tga"

2_Now that you have the ".tga" name, open the "PR_MemeAtlas.tai" and search for "eotechAimPoint.tga", once you found it copy the entire line like this:

Menu/HUD/Texture/Ingame/Crosshair/eotechAimPoint.tga Menu\Atlas\MemeAtlas_0.dds, 0, 0.731445, 0.924316, 0.0244141, 0.0244141(it usually has an space, it has to be like that)

3_Now open your "MemeAtlas.tai"(remember this file? xD) and at the end of it add the line you copied from the "PR_MemeAtlas.tai", save it and put the "MemeAtlas.tai" into your mod's "menu_server.zip".

This "extra work" will also be the same for the weapons icons, you will have to identify the weapons icons and do the same process.

10% PROBLEM

I remember that when I tranfered the weapons long ago, I did something with the "shaders_client_pr.zip"(BUT I DON'T REMEMBER WHAT I DID!), so here comes your trial and error thingy:

1_You extract all the content from "shaders_client_pr.zip" and add it to your mod's "shaders_client.zip".

2_You copy the "shaders_client_pr.zip" into your mod's folder, open your mod's "clientarchives.con" and add the next line:

fileManager.mountArchive Shaders_client.zip Shaders

3_You do nothing with "shaders_client_pr.zip" because it's not necessary D:

DON'T WORRY, IT'S ONE OF THOSE THREE.

5? WEAPONS .TWEAK

So here comes basically the most important part of weapon tranferring:

1_ Go to your work folder and extract the "gerrif_mp7" folder from the "weapons_client.zip", and add the folder into your "Objects_client.zip/weapons/handheld"(I know I know, you want to transfer another weapon but for now bear with it and use the mp7)

2_Go to your work folder and extract the "gerrif_mp7" folder from the "weapons_server.zip", and open the "gerrif_mp7.tweak" file.

3_All right, from now on I will tell which lines you will have to pay SPECIAL attention in order to succesfully transfer the weapon:

*rem ---BeginComp:WeaponHud ---

For all the "METHOD B GUYS" xD here you have the names of the ".tga" you will need for the weapon icons.

"ObjectTemplate.weaponHud.weaponIcon" the icon that displays when you select a kit(NOTE: some weapons don't have this icon, so all you have to do is add the line "ObjectTemplate.weaponHud.weaponIcon" and use the same icon from "ObjectTemplate.weaponHud.selectIcon")

"ObjectTemplate.weaponHud.selectIcon" this is the icon that displays when you are selecting a weapon ingame

*ObjectTemplate.aiTemplate

As far as I remember this line will tell the game how the weapon behaves ingame, ALL PR weapons use their own aitemplate so you will need to replace them with an existing one from bf2(you can also transfer the aitemplate from PR but I won't cover that part in the tutorial), in this case the aitemplate from the weapon is "smg_ai", so let's change it for the one used in the BF2's MP7 which is "usrif_mp5AI", now the gun will behave just like the mp7 in BF2.

*ObjectTemplate.addTemplate e_muzz

Some PR weapons use custom muzzleflashes, so you will have to replace it with an existing muzzleflash, in this case it uses the mp5's muzzleflash so there is no problem.

*ObjectTemplate.addTemplate e_shellejection

Some PR weapons use custom shells/cases, so unless you want your gun without them you will have to replace them with existing ones, in this case the weapon uses "9mm" and since it's already in BF2 then there's no problem.

*ObjectTemplate.projectileTemplate

Again, ALL PR weapons uses custom projectiles, unlike the other lines the game will not give you any kind of error if you leave the PR projectile but when you are in the game the weapon will not hit anything since the projectile you are using doesn't exist in your mod or in BF2, so in order to fix this you will have to use an existing projectile, let's use the "sasrif_mp7_Projectile"

*ObjectTemplate.itemIndex

This is REALLY IMPORTANT, if you mess in here the game will crash WITHOUT giving you any error, the item index tells the game where the weapon is located in your inventory, if you have 2 weapons with the same item index the game will try to load 2 items in the same slot and will crash, so you are free to choose whatever itemindex you want depending on what do you wnat to replace with the mp7(a knife, greande, pistol, rifle, etc), for now let's leave it on "3".

6? PUTTING YOUR GUN INTO YOUR MOD

OK!! We're almost there...

1_Put your modified "gerrif_mp7" folder into your mod's "objects_server.zip/weapons/handheld"

2_Go to your mod's "objects_server.zip/kits/factionyouwant" and extract any kit you want, open the kit ".con" and look for the weapon that occupies the item index "3", delete the name and replace it with "gerrif_mp7"(without the "), save the ".con" file and put it again into your "objects_server.zip/kits/factionyouwant".

7? TESTING THE WATERS

All right this is the final step and is pure trial and error:

Go to your mod's shortcut and in the properties look for a line like this one:

"C:\Program Files\EA GAMES\Battlefield 2\BF2.exe"

and add this at the end: +fullscreen 0

"C:\Program Files\EA GAMES\Battlefield 2\BF2.exe"(leave an space)+fullscreen 0 <----it should look something like this

Save it and open the game, now the game should be working on windowed mode.

OK from now on it's just common sense, start any map you want(it has to have the faction you choosed) and the game will start to load the map, during this process it might happen(and will) that the game crashes BUT it will give you an error(unless you are failing at the item index part) and will tell you what file is missing, all you have to do is look for this file into the PR's objects.zip and put it into your mod's Objects.zip.

Weapons_client.zip (textures, sounds, .bundledmesh errors)
Weapons_server.zip (animations, .collisionmesh errors)


AND IT'S OVEEEEEEEEEEEEEEEEERRRRRRRRRRRRRRRRRRRRRRRRRRRRR :,DDDDDDD

I started this tutorial at 3:00 AM and now it's 6:16 AM D: I'm going to sleep >____<

Well I guess I didn't miss anything, if anyone have questions or doubts just post below and I will help in what I can :D

BYE!!!