Modding 101

By [BF:A] Croupier, January 31, 2006 in BF2 Community Tutorials 


Ok lets start from scratch, we'll keep this as simple as possible, let's say you want to change the Amount of mines the Engineer has, and we want to test it on Strike at Karkand.


1. Open the Editor and create your mod. (starting from scratch so that nothing else previously done will interfer with the process, I am doing this as I type so I can say that it will work 100%)


2. Copy the Strike_at_Karkand folder from mods/bf2/Levels and place it in mods/your_mod/Levels


3. Copy mods/bf2/Objects_server.zip to mods/your_mod/


4. Rename it Custom_Objects_server just for the hell of it.


4.1 Open your_mod/ServerArchives.con leave the bf2 mounted stuff and just add:


fileManager.mountArchive Custom_Objects_server.zip Objects


it should look like this:


fileManager.mountArchive Custom_Objects_server.zip Objects


fileManager.mountArchive mods/bf2/Objects_server.zip Objects


fileManager.mountArchive mods/bf2/Menu_server.zip Menu


fileManager.mountArchive mods/bf2/Common_server.zip Common


4.2 Optional, but I edited the ClientArchives.con also to only read the bf2 content seeing as though Im only going to mount a server file, it looks lke this:


fileManager.mountArchive mods/bf2/Objects_client.zip Objects


fileManager.mountArchive mods/bf2/Common_client.zip Common


fileManager.mountArchive mods/bf2/Menu_client.zip Menu


fileManager.mountArchive mods/bf2/Fonts_client.zip Fonts


fileManager.mountArchive mods/bf2/Shaders_client.zip Shaders


5. Delete everything in Custom_Objects_server.zip except the Weapons folder. (I prefer to use WinRar)


6. Open the Weapons folder and delete everything except the Handheld folder.


7. Open the Handheld folder and delete everything except the at_mine folder.


8. Open the at_mine folder and delete evrything except the at_mine.tweak file.


Time for a micro mod.


Lets just give the Engineer a few more mines to play with. And how about we make the mines explode when soldiers walk on them.


9. Extract at_mine.tweak file to your desktop rightclick and uncheck read only, apply and then add it back to the .zip overwriting the original (I like to tweak my files while they are in the zip) next open up the at_mine.tweak file in notepad and edit 3 lines.


9.1 First one is in the ThrownFireComp, Change


ObjectTemplate.fire.maxProjectilesInWorld 5, to


ObjectTemplate.fire.maxProjectilesInWorld 10, this is pretty obvious allows us 10 mines before they start to dissapear.


9.2 Second tweak is in the DefaultAmmoComp and will enable 10 mines or 2 mags of 5 a mag if you like. Change


ObjectTemplate.ammo.magSize 1, to


ObjectTemplate.ammo.magSize 2, easy peasy.


9.3 Last tweak is the Player triggering the mine, this will take place in the DefaultDetonationComp. Change


ObjectTemplate.detonation.triggerType MTYVehicle, to


ObjectTemplate.detonation.triggerType MTYPco, kabooommmmm


OK lets check it out shall we, but before we do that we will want to shortcut to the mod.


10. Copy you BF2 shortcut and rename it your_mod, rightclick properties, and change it appropriately, +fullscreen 0 +modPath mods/your_mod


Fullscreen 0 so as you can surf the web while you most likely optimise shaders (if your trying this on a newly created mod). I didn't opt for BF2_r.exe as I was getting a heap of dice code errors.


I tested in singleplayer and it works beautifully.

Community content is available under CC-BY-SA unless otherwise noted.