Additional functionality compared to A2/OA
- Slotable weapon accessories
- Custom reload animations
- Adjustable sights
- Underwater weapons
- Ammo changes on fly and on hit
- Rotating muzzle-flash
- Explosion shielding
Model requirements {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
- bipod accessory should be on proxy \A3\data_f_mark\proxies\weapon_slots\UNDERBARREL
- all these proxies could be redefined in cfgWeapons >> Weapon >> WeaponSlotsInfo >> XXX >> linkProxy parameter where XXX is the slot name
-
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 named ForeSight with ForeSight_axis in memory lod
- Rear part should be named BackSight with BackSight_axis in memory lod
-
adjustable sights for grenade launchers
- there needs to be a selection that is going to rotate (in case of collimator sights), default naming is OP
- this selection needs to have an axis in memory lod, default naming is OP_axis
- there needs to be a focus point, the best place is the red dot of collimator, with memory point OP_look by default and several points for eye, usually OP_eyeX where 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 parameter unHideValue for hide type of animations - you are now able to make asymmetrical animations eg. for hiding of magazine:
{model.cfg}
- 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}
- foldable iron sights use hasOptics controller
{model.cfg}
- new animation controllers zeroing1 and zeroing2 take values from discreteDistance[] 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}
- rotating muzzle flashes are done using a new animation source ammoRandom which changes it is 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}
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 in class WeaponSlotsInfo which contains the slots and parameters for inventory
- Mass is 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
- parameter linkProxy defines a proxy in weapon model for said slot (see standard names on top)
- parameter displayName describes a mouse-over name of slot in Inventory
- array compatibleItems[] 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 classes CowsSlot and PointerSlot are used for standard optics and side accessory. That means these classes are outside cfgWeapons and changeable for all weapons at once.
Muzzle accessories
- suppressors are configured as a weapon inheriting some item abilities from class ItemCore
- the class itself consists only from scope, displayName, picture and model, there is a separate subclass ItemInfo with all the required parameters
- there is subclass MagazineCoef inside class ItemInfo with parameter initSpeed - this is just a multiplier of initSpeed of weapon’s magazine
- subclass AmmoCoef of class ItemInfo has more parameters for the ammo shoot through the suppressor:
- hit is the coefficient of hit of original ammo
- visibleFire, audibleFire, visibleFireTime and audibleFireTime are coefficients for detection upon shooting the weapon
- higher cost coefficient should make AI think more about shooting the suppressed weapon
- typicalSpeed and airFriction coefficients change the ballistic characteristics of the ammo
- there are alternate muzzleEnd and alternativeFire directly inside class ItemInfo to have different muzzle effects origin and muzzle flashes