Create Custom Pickup Kits Old

Create custom pickup
kits

By O2

This post aims to give
an example of how you can create custom pickup kits and add them to maps fairly
easily (bf2 editor not required).

**1.0 - Creating the Pickup Kit**

Determine what kind of kit you want to create, based on the different soldier
kits/classes in the game. For our example we are going to create a Sniper kit.

**1.1 - Start with a template**

We want to create a Sniper kit for the US team, as an example, which means we want to copy the contents of the following file:

>
>
>
>
>
>
> Objects\_server.zip\Kits\US\US\_Sniper.con
>
>
>
>
>

Into our own custom file

>
>
>
>
>
>
> Objects\_server.zip\Kits\PICKUP\PICKUP\_US\_LongRangeSniper.con
>
>
>
>
>

**1.2 - Renaming the Kit**

We now have a template to work with for our custom pickup kit. We need to
change a few things to get it working. First, we need to rename the kit to our
>
>
>
>
> ObjectTemplate.create Kit US\_Sniper
>
>
>
>
>
>
>

With this line:

>
>
>
>
>
>
> ObjectTemplate.create Kit PICKUP\_US\_LongRangeSniper
>
>
>
>
>
>
>

Notice that the name we replaced US\_Sniper with is the same as our kit's .con
file.

**1.3 - Adding the CollisionMesh**

Choose your collison mesh and it for your weapon.

Note: This thread alsocontains information on how to get your pickup kits into the bf2 editor if you
prefer using the editor.

After this line:

>
>
>
>
> ObjectTemplate.cullRadiusScale 2.4
>
>
>
>
>

Insert these lines:

>
>
>
>
> rem ---------------CollisionMesh----------------------
>
> ObjectTemplate.collisionMesh small\_collonly0
>
> ObjectTemplate.mapMaterial 0 collision\_material 76
>
> ObjectTemplate.physicsType Point
>
>
>
>
> rem ---------------/CollisionMesh---------------------
>
>

**1.4 - Modifying kit items (weapons)**

In our example, we're going to replace the standard M24 with the M95 Barrett,
>
>
>
>
> ObjectTemplate.addTemplate USRIF\_M24
>
>
>
>
>
>
>

With this line:

>
>
>
>
> ObjectTemplate.addTemplate ussni\_m95\_barret
>
>
>
>
>
>
>

**1.4.1 - Adding a weapon geometry (optional)**

If you would prefer to see the actual weapon on the ground, instead of a
soldier's kit, then replace this line:

>
>
>
>
> ObjectTemplate.geometry US\_Kits
>
>
>
>
>
>
>

with this line:

>
>
>
>
> ObjectTemplate.geometry ussni\_m95\_barret
>
>
>
>
>
>
>

Note that by default if you replace a PCO on a map with this, then the weapon
may well be half submerged in the ground. To remedy this, you need to edit the
Y value of the 'Object.absolutePosition X/Y/Z' for the ObjectSpawner you are
using (adding .2 to .3 to the Y value seems to work well).

**1.5 - Removing the unlocks**

AFAIK, it won't hurt to leave the unlocks in the .con file, but they only work
on ranked servers anyway so you might as well go ahead and remove them:

Delete the following lines:

>
>
>
>
> ObjectTemplate.addTemplate UnlockUSSniper
>
> ObjectTemplate.addTemplate UnlockUSSniper2
>
> ...
>
> ObjectTemplate.create ItemContainer UnlockUSSniper
>
> ObjectTemplate.addTemplate ussni\_m95\_barret
>
> ObjectTemplate.unlockLevel 1
>
>
>
> ObjectTemplate.create ItemContainer UnlockUSSniper2
>
> ObjectTemplate.addTemplate gbrif\_l96a1
>
> ObjectTemplate.replaceItem USRIF\_M24
>
> ObjectTemplate.replaceItem ussni\_m95\_barret
>
> ObjectTemplate.unlockLevel 2
>
>
>
>
>
>
>

**1.6 - Save the file**

Save the file and we're done. We've now created a US Long Range Sniper pickup
kit. The next step is getting it into a map.

**2.0 - Getting Our Pickup Kit Into a Map**

This is a little more tricky. First off, without using the editor we are
limited to replacing an existing PCO (e.g. Stinger/Igla/TOW/Artillery Cannon,
etc). In this example we're going to replace the US Artillery Cannon
(USART\_LW155) with our US Long Range Sniper Kit on Gulf of Oman SP 16
(vanilla).

**2.1 - Getting our map to load custom objects**

You've probably seen this before in a number of maps which have been released
on BFSP. This is a process which allows us to load custom objects (vehicles,
weapons, etc) for a particular map.

First off, we're going to extract the server.zip for Gulf of Oman so we can
modify it. Go ahead and extract it to your temp directory.

**2.2 - Modifying tmp.con to load our custom pickup kit**

Open \Server\tmp.con and add the following line:

>
>
>
>
> run Objects\Kits\PICKUP\PICKUP\_US\_LongRangeSniper.con
>
>
>
>
>
>
>

This line tells the game that when we load up this map we want it to include
our pickup kit.

**2.3 - Creating a ServerArchives.con file**

Create a new text file \Server\ServerArchives.con and open it. Now add the
following line:

>
>
>
>
> fileManager.mountArchive Levels/gulf\_of\_oman/Objects\_Server.zip Objects
>
>
>
>
>
>
>

Save and close the file. This file tells the game to mount the archive which
contains our custom pickup kit. OK, almost done, all we have to do now is place
the pickup kit on the map.

**2.4 - Replacing a PCO with a Pickup Kit**

Here's where we're going to replace the US Artillery Cannon with our pickup
kit. Open the file \Server\GameModes\sp1\16\GamePlayObjects.con and replace
this:

>
>
>
>
> rem [ObjectSpawnerTemplate: CPNAME\_GO\_SP16\_beach\_ART]
>
> ObjectTemplate.create ObjectSpawner CPNAME\_GO\_SP16\_beach\_ART
>
> ObjectTemplate.activeSafe ObjectSpawner CPNAME\_GO\_SP16\_beach\_ART
>
> ObjectTemplate.modifiedByUser nla
>
> ObjectTemplate.isNotSaveable 1
>
> ObjectTemplate.hasMobilePhysics 0
>
> ObjectTemplate.setObjectTemplate 2 USART\_LW155
>
> ObjectTemplate.minSpawnDelay 260
>
> ObjectTemplate.maxSpawnDelay 360
>
> ObjectTemplate.holdObject 1
>
> ObjectTemplate.teamOnVehicle 1
>
>
>
>
>
>
>

with this:

>
>
>
>
> rem [ObjectSpawnerTemplate: CPNAME\_GO\_SP16\_beach\_ART]
>
> ObjectTemplate.create ObjectSpawner CPNAME\_GO\_SP16\_beach\_ART
>
> ObjectTemplate.activeSafe ObjectSpawner CPNAME\_GO\_SP16\_beach\_ART
>
> ObjectTemplate.modifiedByUser nla
>
> ObjectTemplate.isNotSaveable 1
>
> ObjectTemplate.hasMobilePhysics 0
>
> ObjectTemplate.setObjectTemplate 2 PICKUP\_US\_LongRangeSniper
>
> rem ObjectTemplate.setObjectTemplate 2 USART\_LW155
>
> rem ObjectTemplate.minSpawnDelay 260
>
> rem ObjectTemplate.maxSpawnDelay 360
>
> rem ObjectTemplate.holdObject 1
>
> rem ObjectTemplate.teamOnVehicle 1
>
>
>
>
>
>
>

Save and close the file. Now you will need to re-zip all the files under
\Server\\*.\* into a zip file called Server.zip.

**2.5 - Deploying our map**

All that is left to do is deploy our map. First make sure you have made a
backup copy of the original Server.zip for Gulf of Oman, and once you have done
that go ahead and copy your new Server.zip to
'\mods\BF2\levels\gulf\_of\_oman\Server.zip'.

Now copy our custom Objects\_Server.zip (see attachment) to
'\mods\BF2\levels\gulf\_of\_oman\Objects\_Server.zip'.

That should be it. Fire up Gulf of Oman SP 16, join US and spawn at the beach.
Then go have a look where the US Artillery Cannon used to be and you should see
a soldier's kit sitting there. Walk up to it and press your 'get key', just
like you would to pick up a fallen soldier's kit.

Have fun.