Intro to Modding

Modding 101

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

[Change Engineer number of Mines]

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.