Jump to content
warhawk373

Help with making a weapon attachment

Recommended Posts

I've checked the wiki and so many forums and I feel like an idiot because from how many tutorials there are, I cant seem to understand it.  I need someone to take me through simple steps such as how in the world do I put a weapon attachment (pistol silencer) in-game, what software do I need, and what is all this proxie configuration stuff I've read so much about.  I've read all the code and I still don't get it.  Please help because none of this makes any sense and I thought that I was decent at scripting until I started looking at all this configuration stuff. 

 

P.S.  I'm using blender as my modeling software and I know how to model but I don't know how to scale it to the gun and import it in-game so that the game reads it as a silencer muzzle attachment

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/Arma_3_Weapon_Config_Guidelines

This should cover most of the basics, and dont forget to check out the weapon sample model provided with the A3 tools (it's in your A3 tools steam folder). You can copy the proxies from the sample into your model and just move them to the correct spot, is less complicated that way.

Focus on making the weapon(or attachement) model and the .p3d model file first, then the model.cfg (take a close look at the sample for this) and then the config. Don't try to do all at once ;)

 

A proxy is a location indicator for the engine basically, and at this location it loads another model. For example, in a vehicle a gunner proxy is added, and ingame this proxy is where the real character model of the gunner appears. They have case-by-case functions. You can also have "static" proxy - means a specific model is located there all the time.

 

If the only thing you wanna do is the silencer, you dont need to worry about model.cfg or proxies, you dont need them for the silencer. Only if you wanna create a weapon do you need them.

Share this post


Link to post
Share on other sites

I don't know how to scale it to the gun and import it in-game so that the game reads it as a silencer muzzle attachment

 

Just make it to scale with the real thing.

 

Arma's modelling software is scaled with a 1 meter grid size that relates to a 1 meter distance in the game. So if you model in another piece of software where the grid size is in meters, it'll import at the same size. If your grid is set up in other units (mm, cm, inches etc.) you just apply the correct scale factor to convert those units to meters when importing the model to Object Builder.

 

If your grid in Blender is using cm units and you want a Suppressor that's basically a cylinder, 15cm long with a 3cm diameter, you just model it so that it's 15 grid units long and 3 wide, then when it comes to importing it to object builder you apply a master scale factor of 0.01 (because 1cm = 0.01m) and it will be 15cm long and 3cm in diameter ingame. There's an option to do this in the various importer windows (.obj import, .fbx import etc) or you can just manually apply a discrete scale factor to the X, Y & Z axis (select the model and go \Points\Transform 3D\Scale)

If you imported it with a master scale factor of 1 it could have been 15m long and 3m wide ingame, if you used a master scale factor of 0.001 it would be 15mm long and 3mm wide ingame, and so on.

 

With attachments, the main issue with getting it to look right on a weapon is alignment. What you need to understand here is that the spot where the attachment model loads/spawns on the weapon model lines up with the [0,0,0] grid coodrinate in your attachment model.

 

Here you see a picture of a weapon with the TOP proxy for optics attachments:

 

http://img853.imageshack.us/img853/4763/yc81.jpg

 

The spot on the proxy where the attachment models will load from is that 90-degree corner on the big red proxy triangle. So that corner vertex will be where the [0,0,0] grid position in the optics model will snap to.

 

Generally with suppressors, the MUZZLE proxy is aligned directly along the bore-axis of the weapon's barrel so the bore of your suppressors should lie on the Y=0,Z=0 plane, and you only need to adjust the position of the suppressor along the X axis until it's positioned wherever you want it to sit along the length of the barrel. Looking at some of BIS' handguns I think the proxy is positioned at the tip of the barrel, sitting flush with the slide/frame, so if you make the rear of your suppressor flush against the X=0 line, it'd probably appear in the right position without being so far forward that it's floating in the air, or too far back that it's clipping through the pistol's frame.

Share this post


Link to post
Share on other sites

Ok so I now have arma 3 tools, I am trying to follow simple steps to put a box into arma 3 just to see if I can do that (apparently not).  I followed this tutorial https://steamcommunity.com/sharedfiles/filedetails/?id=405684985and a couple problems arose.  First off, I cant import a .3ds file from blender into object builder in arma 3 tools.  It just doesnt work for some reason.  So next I just created a box in object builder then followed the steps form there.  After I pack it into a pbo and get it in an addon folder with all those config files too, it says basicdefines_A3.hpp not found.  I've looked and I have the basicdefines  file in there and its all spelled correct.  It makes me want to give up on modeling because I cant even put a box in game while following a very simple tutorial.

Share this post


Link to post
Share on other sites

The config files (including .hpp files) need to be packed in the pbo, not sitting in the addons folder.

Share this post


Link to post
Share on other sites

In my post I said I had them in a pbo.  I used the addon maker in arma tools (its called something like that) to pack all the config files and the p3d file into a pbo, thats what the tutorial said to do

Share this post


Link to post
Share on other sites

Ok I fixed the box thing.  I can now successfully get a box into arma 3.  So now going back to my original post, I still cant get the suppressor in game.  I have it modeled but I dont get quite how to do the config.cpp for it.  Basically what I've tried so far since I've never done this before, I just pasted this in the config.cpp and changed the model directory, the display name, and I wasnt sure what to put for the picture so I just set it to "" assuming that was default.  That was just on the wiki https://community.bistudio.com/wiki/Arma_3_Weapon_Config_Guidelines#Muzzle_accessories

class Mode_SemiAuto;
 class cfgWeapons
 {
 	class ItemCore;
 	class InventoryMuzzleItem_Base_F;	
 	class myMuzzleAccessory
 	{
 		scope = 2;
 		displayName="My Muzzle Accessory";
 
 		picture="\A3\weapons_F\Data\UI\myMuzzleAccessory_CA.paa";
 		model = "\A3\weapons_f\acc\myMuzzleAccessory";	
 		
 		class ItemInfo: InventoryMuzzleItem_Base_F
 		{	
 			soundTypeIndex = 1; // index of sound in sounds[] in weapon modes (inherited 1 from parent class)
 
 			class MagazineCoef
 			{
 				initSpeed = 0.8;
 			};
 
 			class AmmoCoef
 			{
 				hit=0.8;
 				visibleFire=0.3;
 				audibleFire=0.8;
 				visibleFireTime=0.5;
 				audibleFireTime=1.0;
 				cost = 1.0;
 				typicalSpeed= 0.8;
 				airFriction = 1.0;      
 			}; 
 
 			muzzleEnd = "zaslehPoint"; // memory point in muzzle supressor's model
 			alternativeFire = "Zasleh2";  // class in cfgWeapons with model of muzzle flash	
 	
 			class MuzzleCoef
 			{
 				dispersionCoef = 1.0f;
 				artilleryDispersionCoef = 1.0f;  
 
 				fireLightCoef = 0.1f;
 
 				recoilCoef = 1.0f;
 				recoilProneCoef = 1.0f;
 
 				minRangeCoef = 1.0f; minRangeProbabCoef = 1.0f;
 				midRangeCoef = 1.0f; midRangeProbabCoef = 1.0f;
 				maxRangeCoef = 1.0f; maxRangeProbabCoef = 1.0f;
 			};
 		};
 	};
 };

Share this post


Link to post
Share on other sites

The path to the model/picture needs to be pointing to your pbo prefix\folder. \A3\ is built in Arma 3 stuff. If your pbo prefix is myPbo and your p3d is in a data folder then it'd be \myPbo\data\myMuzzleAccessory .

Share this post


Link to post
Share on other sites

I know how to set file paths, that was just off the wiki that's not actually what I had.  My file path is set and all but I don't know what the picture is supposed to be because its a model not a picture.  Also it doesn't show up in game.

Share this post


Link to post
Share on other sites

The picture works the same way, but should point to a picture of the image (it's the thumbnail/icon for the inventory).

 

For weapon attachments, you'll also need to either modify the weapon's compatibleItems or use ASDG joint rails to make weapons support your attachment.

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

×