アットウィキロゴ

Arma3 Weapon Config Guideline-

Arma 3 Weapon Config Guidelines

Arma3 武器コンフィグガイドライン

 

Contents

Intro

101 - How to set up a weapon for Arma 3

Arma3での武器の作り方

 

Please be aware of our Arma 3 modding license:http://community.bistudio.com/wiki/Arma_3_Modding_License

ARAM3用MOD作成に関するライセンス規定を確認してください。

 

Additional functionality compared to A2/OA

Arma3で追加された機能

 

  • Slotable weapon accessories ○武器にスロットが追加されました。
  • Custom reload animations ○リロード時の動きをカスタム(武器ごとに固有の動きを与えるという意味かと)
  • Adjustable sights ○照準を調整できます。(ACEでの機能とは別物)
  • Underwater weapons ○水中武器の設定
  • Ammo changes on fly and on hit ○
  • Rotating muzzle-flash ○マズルフラッシュ
  • Explosion shielding

 

Model requirements {p3d}

p3dモデルに関する必須項目

 

  • proxies for slotable accessories
     ○ スロットできるアクセサリの格納場所
     
    • muzzle accessory should be on proxy\A3\data_f\proxies\weapon_slots\MUZZLE 
      ○銃口部分のアタッチメント(サイレンサー)
    • optics should be on proxy\A3\data_f\proxies\weapon_slots\TOP  
      ○光学アイテム(スコープ)
    • side accessory should be on proxy\A3\data_f\proxies\weapon_slots\SIDE 
      ○武器のアクセサリアタッチメント(ライト)
    • all these proxies could be redefined incfgWeapons >> Weapon >> WeaponSlotsInfo >> XXX >> linkProxyparameter where XXX is the slot name 
      ○すべてのアイテムはXXX(スロットの名前)で定義されます。

 

  • selections for folding iron sights 
    ○アイアンサイトを(折畳)倒すかどうか選べます。
    • You need to create selections and axes for iron sights if You want them folded once the optics is put on the weapon
      ○もし折畳式アイアンサイトを武器につけたい場合、アイアンサイトの中心を定義する必要があります。
    • Front part should be namedForeSightwithForeSight_axisin memory lod
      ○フロントサイトの名前は定義は↑       ↑ ※axis は 中心って意味
    • Rear part should be namedBackSightwithBackSight_axisin memory lod
      ○リアサイトの名前定義は ↑です         ※axis は 中心って意味
       
  • adjustable sights for grenade launchers
    ○グレネードランチャー用の調整可能な照準器
    • there needs to be a selection that is going to rotate (in case of collimator sights), default naming isOP
    • this selection needs to have an axis in memory lod, default naming isOP_axis
    • there needs to be a focus point, the best place is the red dot of collimator, with memory pointOP_lookby default and several points for eye, usuallyOP_eyeXwhere X is the number of the point. Good practice is to place them in same distance form focus point

Model config changes {model.cfg}

  • custom reload animation have a good use of newly added parameterunHideValuefor hide type of animations - you are now able to make asymmetrical animations eg. for hiding of magazine:
{model.cfg}
                       class magazine_hide
                       {
                               type = "hide";
                               source = "reloadMagazine";
                               selection = "magazine";
                               minValue = 0.000000;
                               maxValue = 1.00000;
                               hideValue = 0.220;
                               unhideValue = 0.550;
                       };
  • the animations could look a bit better by simply adding a translation for the magazine and adding an axis for that in model - magazine should translate at first, then disappear, appear and translate back
{model.cfg}
                       class magazine_reload_move_1
                       {
                               type = "translation";
                               source = "reloadMagazine";
                               selection = "magazine";
                               axis = "magazine_axis";
                               minValue = 0.145;
                               maxValue = 0.170;
                               offset0 = 0.0;
                               offset1 = 0.5;
                       };
  • foldable iron sights usehasOpticscontroller
{model.cfg}
                       class BackSight_optic
                       {
                               type = "rotation";
                               source = "hasOptics";
                               selection = "BackSight";
                               axis = "BackSight_axis";
                               memory = 1;
                               minValue = 0.0000000;
                               maxValue = 1.0000000;
                               angle0 = 0.000000;
                               angle1 = (rad 90);
                       };
  • new animation controllerszeroingandzeroing2take values fromdiscreteDistance[]of first and second muzzle of the weapon. The value is index number of current zeroing in the array starting with zero (that means the first value is 0, second is 1, the last is number of discrete distances plus one). It might be used for iron sights of the weapon if desired but better use is for UGL collimator sights rotation:
{model.cfg}
                       class OP_ROT
                       {
                               type="rotation";
                               source="zeroing2";            // use second muzzle zeroing for rotation
                               sourceAddress="loop";     // loop when phase out of bounds
                               selection="OP";       // selection we want to rotate
                               axis="OP_axis";                  // has its own axis
                               minValue=0;
                               maxValue=3;   // this weapon has array with 4 distances
                               angle0="rad 0";
                               angle1="rad 65";
                       };
  • rotating muzzle flashes are done using a new animation sourceammoRandomwhich changes it's value every time weapon is fired. Various degrees of rotation may be set up by using correct muzzle flash shape and minValue maxValue combination.
{model.cfg}
                       class MuzzleFlashROT
                       {
                               type="rotationX";
                               source="ammoRandom";            //use ammo count as phase for animation
                               sourceAddress="loop";     //loop when phase out of bounds
                               selection="zasleh";       //selection we want to rotate
                               axis="";                  //no own axis - center of rotation is computed from selection
                               centerFirstVertex=true;   //use first vertex of selection as center of rotation
                               minValue=0;
                               maxValue=4;               //rotation angle will be 360/4 = 90 degrees
                               angle0="rad 0";
                               angle1="rad 360";
                       };

New config parameters {config.cpp}

Slotable weapons

  • Available slots are defined in each weapon but are usually inherited from a parent weapon. They are stored as classes inclass WeaponSlotsInfowhich contains the slots and parameters for inventory
    • Massis a new unit used to describe weight and volume of an object used. Each container has a set capacity in the same units.
    • allowedSlots[] is an array of slot numbers where you may put the weapon. 701 stands for vest, 801 stands for uniform, 901 stands for backpack
    • each weapon slot is a separate subclass in class WeaponSlotsInfo
      • parameterlinkProxydefines a proxy in weapon model for said slot (see standard names on top)
      • parameterdisplayNamedescribes a mouse-over name of slot in Inventory
      • arraycompatibleItems[]lists possible accessory placeable into that slot. Most weapons are able to have any RIS equipment, but eg. muzzle accessory differs according to caliber.
    • external classesCowsSlotandPointerSlotare used for standard optics and side accessory. That means these classes are outside cfgWeapons and changeable for all weapons at once.
class SlotInfo;
class CowsSlot : SlotInfo
{
       // targetProxy
       linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";

       // display name
       displayName = $STR_A3_CowsSlot0;

       // class names with items supported by weapon
       compatibleItems[] = {"optic_Arco","optic_aco", "optic_ACO_grn","optic_hamr","optic_Holosight"};
};
class PointerSlot : SlotInfo
{
       // targetProxy
       linkProxy = "\A3\data_f\proxies\weapon_slots\SIDE";

       // display name
       displayName = $STR_A3_PointerSlot0;

       // class names with items supported by weapon
       compatibleItems[] = {"acc_flashlight","acc_pointer_IR"};
};

class cfgWeapons
{ 
       class myWeapon
       {
               class WeaponSlotsInfo
               {
                       mass = 4; /// default mass of a weapon
                       class MuzzleSlot : SlotInfo
                       {
                         // targetProxy
                         linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";

                         // display name
                         displayName = "Muzzle Slot";

                         // class names with items supported by weapon
                         compatibleItems[] = {}; // moved to each weapon
                       };
                       class CowsSlot: CowsSlot {};
                       class PointerSlot: PointerSlot {};
                       allowedSlots[] = {901}; // you simply cannot put this into your pants
               };
       };
};

Muzzle accessories

  • suppressors are configured as a weapon inheriting some item abilities from classItemCore
  • the class itself consists only from scope, displayName, picture and model, there is a separate subclassItemInfowith all the required parameters
    • there is subclassMagazineCoefinside class ItemInfo with parameterinitSpeed- this is just a multiplier of initSpeed of weapon's magazine
    • subclassAmmoCoefof class ItemInfo has more parameters for the ammo shoot through the suppressor:
      • hitis the coefficient of hit of original ammo
      • visibleFire,audibleFire,visibleFireTimeandaudibleFireTimeare coefficients for detection upon shooting the weapon
      • highercostcoefficient should make AI think more about shooting the suppressed weapon
      • typicalSpeedandairFrictioncoefficients change the ballistic characteristics of the ammo
    • there are alternatemuzzleEndandalternativeFiredirectly inside class ItemInfo to have different muzzle effects origin and muzzle flashes
    • you may set upmodes[]and specific fire modes for the suppressed weapon directly in class ItemInfo
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
               {      
                       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

                       modes[] = {"Single"};

                       class Single: Mode_SemiAuto
                       {
                               begin1[]={"A3\sounds_f\weapons\silenced\silent-25.wav", db0, 1,600};
                               begin2[]={"A3\sounds_f\weapons\silenced\silent-26.wav", db0, 1,600};
                               soundBegin[]={begin1,0.5, begin2,0.5};

                               closure1[]={"A3\sounds_f\weapons\closure\closure_rifle_2.wav", db0, 1,300};
                               closure2[]={"A3\sounds_f\weapons\closure\closure_rifle_3.wav", db0, 1,300};
                               soundClosure[]={closure1,0.5, closure2,0.5};

                               weaponSoundEffect  = "DefaultRifle";
                       };
               };
       };
};

Optics

  • in addition to default parameters mentioned in muzzle accessories class, there isweaponInfoTypeto choose a correct resource for weapon info directly inside optic class
    • there is the same ItemInfo subclass but with different parameters
      • don't forget that ItemInfo inherits some parameters from InventoryOpticsItem_Base_F (eg. muzzlePos and muzzleEnd) in case you rename the memory points
    • parameteropticTypeis used for balancing the optics for specific fire modes (should be further described by balancing crew)
    • modelOpticsis the 2D model for selected optics
    • subclassOpticsModesworks the same way it used to work in A2/OA
class cfgWeapons
{
       class ItemCore;
       class InventoryOpticsItem_Base_F;      
       class myOpticsAccessory
       {
               scope = 2;
               displayName="My Optics Accessory";

               picture="\A3\weapons_F\Data\UI\myOpticsAccessory_CA.paa";
               model = "\A3\weapons_f\acc\myOpticsAccessory";       
               weaponInfoType = "RscOptics_myOptics";
              
               class ItemInfo: InventoryOpticsItem_Base_F
               {      
                       mass = 7;
                       modelOptics="\A3\Weapons_f\acc\reticle_MyOptics_F";
                       class OpticsModes
                       {
                               class MyOptics
                               {
                                       opticsID = 1;
                                       useModelOptics = true;
                                       opticsPPEffects[]={"OpticsCHAbera1","OpticsBlur1"};
                                       opticsZoomMin = 0.0555;
                                       opticsZoomMax = 0.1300;
                                       opticsZoomInit= 0.1300;
                                       discreteDistance[] = {100,300,400,500,600,700,800,900,1000};
                                       discreteDistanceInitIndex = 1; 
                                       distanceZoomMin = 100;
                                       distanceZoomMax = 1000;
                                       nFovLimit = 0.07;
                                       discretefov[] = {0.1300,0.0555};
                                       discreteInitIndex = 0;                                         
                                       modelOptics[] = {"\A3\Weapons_f\acc\reticle_MyOptics_F", "\A3\Weapons_f\acc\reticle_MyOptics_z_F"};
                                       memoryPointCamera = "opticView";
                                       visionMode[] = {"Normal","NVG"};
                                       opticsFlare = true;
                                       opticsDisablePeripherialVision = true;
                                       cameraDir = "";
                               };
                               class IronOnTopOfMyOptics: MyOptics
                               {
                                       opticsID = 2;
                                       useModelOptics = false;
                                       opticsFlare = false;
                                       opticsDisablePeripherialVision = false;
                                       opticsZoomMin=0.375;
                                       opticsZoomMax=1.1; 
                                       opticsZoomInit=0.75;
                                       memoryPointCamera = "eye";
                                       visionMode[] = {};
                                       discretefov[] = {};
                               };     
                       };
               };
       };
};

Side Accessory

  • the class of side accessory is made the same way as for muzzle accessory
    • subclass ItemInfo contains some specific parameters, but they work the same way as they did in A2/OA
class cfgWeapons
{
       class ItemCore;
       class InventoryFlashLightItem_Base_F;  
       class mySidesAccessory
       {
               scope = 2;
               displayName="My Sides Accessory";

               picture="\A3\weapons_F\Data\UI\mySidesAccessory_CA.paa";
               model = "\A3\weapons_f\acc\mySidesAccessory";
              
               class ItemInfo: InventoryFlashLightItem_Base_F
               {
                       mass = 9;
                       class Pointer
                       {
                               irLaserPos="laser pos";
                               irLaserEnd="laser dir";
                       };
                       class FlashLight{};            
               };
       };
};

Custom reload animations

  • parameterreloadActionis now for both a magazine and the weapon.
    • if it is not defined for any of them, default reload is played.
    • if the parameter is defined for the weapon but isn't defined for a magazine, reloadAction for weapon is played upon reloading said weapon
    • if the magazine has reloadAction defined, the action selected by this parameter is played every time (not depending on weapon). This ensures different reloads for different magazines of one weapon (eg. UGLs)
  • the action chosen by reloadAction is played according to config of animations for said soldier (action in CfgMovesMaleSdr leads to a state in CfgGesturesMale for default soldier), different target states could be defined for different action maps (eg. there could be a different reload gesture for crouch and prone with rifle)
class CfgMovesBasic
{
       class DefaultDie;
       class ManActions
       {
               reloadMyWeapon = "reloadMyWeapon";   
       };
};

class CfgGesturesMale
{
       class Default;
       class States
       {
               class reloadMyWeapon: Default
               {
                       file="\A3\anims_f\Data\Anim\Sdr\wop\erc\stp\rld\rfl\reloadMyWeapon.rtm";
                       looped=0;
                       speed=0.400000;
                       mask="handsWeapon";
                       headBobStrength=0.200000;
                       headBobMode=2;
                       rightHandIKBeg=1;
                       rightHandIKEnd=1;
                       leftHandIKCurve[]={0,1,0.050000,0,0.950000,0,1,1};
               };
       };
};

class cfgWeapons
{ 
       class myWeapon
       {
               reloadAction = "reloadMyWeapon";
       };
};

Underwater weapons

  • weapons withcanShootInWaterset to 1 are able to shoot under water
    • parametersoundBeginWater[]has the same use assoundBegin[]and defines what sounds and with what probability is going to be played while shooting under the water surface, both of them are defined per fire mode:
class Mode_SemiAuto;

class cfgWeapons
{ 
       class myWeapon
       {
               modes[] = {"Single"}; // this example weapon has just one fire mode
               canShootInWater = 1;  // allows to shoot under water
               class Single: Mode_SemiAuto
               {              
                       begin1[]={"A3\sounds_f\weapons\myWeapon\myWeapon_st_1b.wav", db5, 1,900};
                       begin2[]={"A3\sounds_f\weapons\myWeapon\myWeapon_st_2b.wav", db5, 1,900};
                       begin3[]={"A3\sounds_f\weapons\myWeapon\myWeapon_st_3b.wav", db5, 1,900};
                       soundBegin[]={begin1,0.33, begin2,0.33, begin3,0.34};  // all three sounds have roughly the same probablity
                       beginwater1[]={"A3\sounds_f\weapons\myWeapon\underwater_myWeapon_st_1b.wav", db0, 1,200};
                       beginwater2[]={"A3\sounds_f\weapons\myWeapon\underwater_myWeapon_st_2b.wav", db5, 1,200};
                       beginwater3[]={"A3\sounds_f\weapons\myWeapon\underwater_myWeapon_st_3b.wav", db5, 1,200};
                       soundBeginWater[]={beginwater1,0.33, beginwater2,0.33, beginwater3,0.34}; // all three sounds have roughly the same probablity
               };
       };
};
  • underwater ammo has some different characteristics
    • waterFrictionis underwater equivalent ofairFrictionand supercavitating ammunition has this close to zero. Standard ammo doesn't have this set and that means it is set to -0.4 by default (ie. stops nearly right after entering water)
    • timeToLivefor underwater ammo is rather low to let it be harmless after some 40 meters
    • the fancy bubble effect is done by havingeffectFlyset toAmmoUnderwater, you'll try to modify it to work even on ground and we all know it
class cfgAmmo
{
       class BulletBase;
       class myAmmo: BulletBase // For myWeapon
       {
               waterFriction = -0.00096; // nearly direct line underwater
               timeToLive = 0.12; // that's enough for 45 meters underwater
               effectFly = "AmmoUnderwater";
       };
};

Ammo changes on fly and on hit

  • there are two new simulations of ammo available mainly for artillery, but usable for many other means
  • simulationshotSubmunitionallows to deploy multiple ammo from the parent one upon meeting certain conditions
    • parametersubmunitionAmmodefines class of newly created ammo and this could be used multiple times
    • you could set the inherited ammo and it would spread in cone according tosubmunitionConeAngle(and it is in degrees)
    • submunitionConeType[]describes pattern of ammo in detail, first part is a distribution function ("random", "randomcenter", "poissondisc", "poissondisccenter", "custom"), second parameter is number of ammo except of custom one, where it is another array of pairs for specific locations
submunitionConeType[] = {"random", 10};
submunitionConeType[] = {"randomcenter", 10};
submunitionConeType[] = {"poissondisc", 10};
submunitionConeType[] = {"poissondisccenter", 10};
submunitionConeType[] = {"custom", {{0,0}, {-1,0}, {1,0}, {0,-1}, {0,1}} };
    • parametertriggerDistanceis used to deploy ammo in set 3D distance before expected target
    • parametertriggerTimeis used to deploy ammo in set time after being fired
    • parametertriggerSpeedCoefis a coefficient of speed of inherited ammo relative to speed of parent ammo
    • for Artillery computer use arrayaimAboveTarget[]andaimAboveDefaultas a index of the array to set different heights to change the ammo to something different (eg. flare)
class cfgAmmo
{
       class SubmunitionBase;
       class MyAmmo: SubmunitionBase
       {
               submunitionAmmo = "MySubmunitionAmmo";
               submunitionConeType[] = {"poissondisc", 10}; 
               submunitionConeAngle = 10;
               triggerDistance = 100;
       };
};
  • simulationshotDeployis used to change ammo upon impact (eg. change to a mine)
    • it uses the samesubmunitionAmmoparameter as described above
class cfgAmmo
{
       class ShotDeployBase;
       class Mo_ClassicMineRange: ShotDeployBase
       {
               submunitionAmmo = "APERSMine_Range_Ammo"; // some random mine deployable by a mortar
               airFriction = 0;  // artillery ammo works better without friction
               EffectFly = "ArtilleryTrails"; // some funky effect of smoke trails and stuff
       };
};

Explosion shielding

  • class hitpoints in configuration of all vehicles (including soldiers) has got a new parameter calledexplosionShielding
    • this parameter simply multiplies inidrectHit taken from explosives (that makes it explosion vulnerability in an effective way) - the higher it is the more damage would selected hitpoint get from the hit
class cfgVehicles
{
       class myVehicle
       {
               class HitPoints
               {
                       class HitLFWheel {armor=0.12; explosionShielding = 0.8;};
               };
       };
};

Reference

You may want to seeArma 2 Weapon to Arma 3for correct icons and other stuff.

This page is discussedon the BI forums

最終更新:2013年10月29日 17:41