Jump to content
Sign in to follow this  
STALKERGB

Custom Backpack Tutorial by STALKERGB

Recommended Posts

Hello everyone,

Custom Backpacks, what are they?

Might as well start at the beginning, if you've just made some shiny new infantry addon and you wanted to have them be able to carry or remove their backpacks then you're going to want to make a custom backpack. Although the actual process of creating one isn't that hard, it's very easy to forget or miss out a single step which will mean they won't work. This tutorial will be aimed at people who have created infantry addons so that they can get their infantry carrying the backpacks but will also explain the whole process of creating a custom backpack. All the bits you'll need are in the template backpack download below:

Link to tutorial backpack example

Getting your infantry model carrying backpacks

This is actually probably the easiest bit, in the template download is a p3d file called "Backpack proxy". All you need to do with this is open it up and copy/paste it onto your own infantry models. Once you've copied it over onto your models it should look something like the image below:

pic1.jpg

And that's all you have to do with your model! So you can save and close that and move on to the last part of getting your infantry to carry backpacks. For this last part you will need to open up your addon's config. Under the entries for your infantry units in the config, you'll need to add a single line of code:

cancarrybackpack = 1;

Once that is added then you can save the config. You could load the addon up in Arma and be able to carry around the backpacks already present in the game or any made by other modders :)

But what if I want to create my own backpack?

The easiest way to describe the backpacks in Arma is as though they are portable ammobox's. Most of the components that make up a model for an ammo box are also present on a backpack p3d.

The first LODs in my template backpack are 1.000 and View - Pilot. These are where the actual model of the backpack goes. You can add as many of these LODs as you like (such as 2.000 4.000) to include lower poly versions of the model to help keep performance up in game. But basically, these LODs are the same for just about every type of model in Arma. The one thing you should note, is that the model needs to be weighted (just as you would for a infantry model). In fact it even uses the same selection names as an infantry model. You can see these on my template backpack along the side (such as Spine1, LeftShoulder etc).

lod1.jpg

The next two LODs in my template backpack are ShadowVolume 1.000 and ShadowVolume 1000.000, these two are also like in most other models. All they do is create the shadow that is cast from the backpack onto the ground or other objects in game. The reason they are "inside out" is so that they don't cast on the backpack if there are clipping issues (at least I think that is the reason).

shadowlod.jpg

The next LOD is the Geometry LOD, as with the shadow LODs above, the model used for this is a low poly simple shape (although it's not inside out). To make the geometry LOD work correctly you'll need to select the whole model (Ctrl + A) and navigate to "Structure/Topology/Find Components" from the drop down menus. you'll then see a selection(s) appear called Component01 (and Component02/03 etc if there are more than 1). This step is important if you want to make sure the geometry LOD will actually work for your backpack. The last thing you will need to do is again, select the whole model and in the bottom left corner enter a mass for the object. I set mine to 20.000 but feel free to play around with yours.

geolodS.jpg

Larger

The next LOD is the Memory LOD. In here all you'll need is a single point defined to the selection "doplnovani". As far as I know, this is to allow the user actions (such as "take backpack") to appear in game when you aim over the backpack. The single point should be placed somewhere behind the rucksack like in the image below:

memlod.jpg

After the Memory LOD comes the LandContact LOD, in this you'll once again only need to add a single point. This will define where the rucksack will sit on the floor once it has been dropped by your character in game. The point doesn't need to be added to a selection:

lclod.jpg

The next LOD is the RoadWay LOD, personally I'm not too sure what this does but it is present on the Ammoboxes that I used for reference when creating my custom backpacks so I assume it is required. Either way, this LOD is simply a 4 points with a face pointing away from the model like in my picture below. Like with the Geometry LOD you'll need to navigate to "Structure/Topology/Find Components" while the face is selected so that it gets defined to the Component01 selection:

rwlod.jpg

The final LOD is the ViewGeometry LOD, this is a very important one and if you get it wrong then your units in game won't be able to "see" the model so the option to pick it up or take stuff from it won't appear. Luckily, the process for getting this LOD right is the same as with the Geometry LOD. In my template I've used the same simple, low poly shape for this LOD and the Geometry LOD so you can copy/paste from the Geometry LOD if you want. Bare in mind that if you do. You'll need to DELETE the "Component01" selection that should appear in the ViewGeometry after you paste. Once you have you'll need to select the whole model in the ViewGeometry LOD and head to "Structure/Topology/Find Components". Although it seems like you have just recreated what you deleted, I've had problems with just copying and pasting before. If you didn't copy and paste, you'll also need to head to "Find Components".

viewlod.jpg

Once you have finished that, the model work should be all done!

So how do I get it working in game then?

Just like everything, you'll need to create a config for your custom backpack. If you want to combine it with your infantry's config that is fine too, I do this and would suggest it's a good Idea to place them above the infantry in the config.

Below is the example config I have included with the template download, my configs aren't the best so this could be much more tidy:

class CfgPatches -------- This is required for all addons as far as I know, if you are combining the backpacks with your infantry config you should already have this.

{

class Template_Backpack

{

units[]={};

weapons[]={};

requiredVersion = 1.000000;

requiredAddons[]={CAData,CACharacters,CAWeapons,CASounds};

};

};

class CfgVehicles -------- This is where you define your backpacks, the top classes in red are external references to classes already in game, the important one here is USBagBasic which the template rucksack inherits properties from

{

class Land;

class Man: Land

{

class ViewPilot;

};

class CAManBase;

class USBasicBag;

////////////////////////////BAGS/////////////////////////////////

class Template_Backpack: USBasicBag ----- The classname of our backpack and what it inherits properties from.

{

scope = 2;

displayName = "Template Backpack"; ------- The in game name of our backpack.

model = "\Template_Backpack\Template_Backpack.p3d"; ------- The path to our backpack's model (the p3d file).

picture = "\CA\weapons_E\Data\icons\backpack_US_ASSAULT_CA.paa"; ----- The path to the picture you would see in the gear menu for our backpack.

icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa"; ------ The icon you would see on the map for our backpack (if it was placed in the editor for example).

transportMaxMagazines = 8; --------- How many magazines the backpack can carry (this is anything that is not a weapon as far as I know)

transportMaxWeapons = 0; ------- The number of weapons our backpack can carry.

};

};

The only thing left to do after adding the backpack to the config is adding it to a model.cfg, if the model for your backpack is in the same place as any infantry models you have you can add it to the model.cfg for them. All it takes is a single line of code:

class Template_Backpack: ArmaMan {};

The "Template_Backpack" part of that code needs to be EXACTLY the same as the name of your backpack's p3d file. If it''s not it won't work at all (or normally crashes Arma!)

If you aren't adding the backpack to a model.cfg you are already using, you'll be able to see that in the template download is the ARMA2 example model.cfg with my backpack added down near the bottom in the class cfgmodels section (just underneath ArmaMan which it inherits from.)

With a bit of luck, you should now be able to use your custom backpacks in game without a problem :)

Hope that helps some folks out there, if anyone has any questions feel free to ask in this thread.

All the best,

Matt

Edited by STALKERGB

Share this post


Link to post
Share on other sites

Apologies for bringing up this old thread, but is there an alternative location for downloading StalkerGB's template and tutorial? Original link is dead :(

Share this post


Link to post
Share on other sites

I'll reupload the backpack as soon as I get a chance, away from my main computer at the moment, tutorial is at Roadkill's link :)

Share this post


Link to post
Share on other sites

I have updated the first post to include the tutorial in this thread instead of linking to another post. I have reworked the whole thing so hopefully it is a bit more clear for some people. I have also included the Template Backpack at the top of the first post. I've added the Backpack Proxy to the download too. :)

Share this post


Link to post
Share on other sites

STALKERGB, thanks for manual!

But i have a problem with my own backpack. I made a radiostation as bp and a unit who can carry bps can't pick up my bp: there is no actions on it.

Also when i write "this addbackpack "class" into unit's init, unit may drop this bag but he can't take it again.

here's my config:

#define private 0

#define protected 1

#define public 2

#define true 1

#define false 0

enum {

STABILIZEDINAXISX = 1,

STABILIZEDINAXISY = 2,

STABILIZEDINAXESBOTH = 3,

STABILIZEDINAXESNONE = 0,

};

class CfgPatches {

class Racia_Backpacks {

units[] = {};

weapons[] = {};

requiredVersion = 1.000000;

requiredAddons[] = {"CAWeapons"};

};

};

class cfgVehicles {

class Land;

class Man: Land {

class ViewPilot;

};

class CAManBase;

class USBasicBag;

class R_163 : USBasicBag {

scope = 2;

displayName = "Radio_R159";

picture = "\p_163\pict.paa";

icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";

mapsize = 2;

model = "\P_163\test5.p3d";

transportMaxWeapons = 0;

transportMaxMagazines = 1;

};

};

Can you help me?

I made bp without any units and unit's config and can't insert proxy to my model

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×