|
|
|
|
|
|
Re: (New) Common Attachment Framework (new title; was The NAS Receiver)[message #341926 is a reply to message #341924]
|
Sun, 02 August 2015 01:44
|
|
Wil473 |
|
Messages:2815
Registered:September 2004 Location: Canada |
|
|
I thought, stock v1.13 had moved most of its attachments out of Attachments.XML to use this feature. If you want to see a very heavy implementation of this feature take a look at one of my projects (AFS/DL-1.13/UC-1.13) or Smeagol's AIMNAS. In my projects most guns have their attachments defined via (N)CAF almost exclusively and I've reworked my bitmap scheme at least twice over the years in a bid to minimize the small number of attachments still using Attachments.XML.
In general, <AttachmentPoint> is used to define which <AvailableAttachmentPoints> an item will attach to. Both are bitmasks.
From my mods, the original pistol Suppressor (item 207) has <AttachmentPoint> = 32768 or binary 1000 0000 0000 0000
The original pistol suppressor fits <AvailableAttachmentPoints>:
32768 / 0000 1000 0000 0000 0000 "Muzzle - Pistols" - this is used when you want a gun to only fit item 207 and its premium counterpart
49152 / 0000 1100 0000 0000 0000 "S - Pistols" - this is used when you want a gun to fit both the above two items as well as a Flash Suppressor (bitmask 16384 /0100 0000 0000)
180224 / 0010 1100 0000 0000 0000 "S - Pistol/KCB" - this is used when you want to fit the above two items, Flash Suppressor, and a KCB Bayonet (bitmask 1301072 0010 0000 0000 0000)
Now the names I have above in "" are a convenience for the benefit of the XML Editor where <AvailableAttachmentPoints> are given a name for ease of use. This is in ...\TableData\Lookup\AttachmentPoint.xml
EDIT: one important note, bitmasks add up not just among the ten possible <AvailableAttachmentPoints> per item, but also in-game when items are attached to other items. Again from my mods, many AK style weapons gain access to Western "RIS" attachments via the attachment of the AK Handguard attachment and a non-scope, RSA/SDV (side) scope rail attachment. These attachments contain in their <AvailableAttachmentPoints> the bitmasks for RIS attachments.
Now (N)CAF simply replaces Attachments.XML, don't confuse it New Attachment System (NAS) that defines where and how many of an attachment may be fitted on a gun...
EDIT2: by the way, Windows 10 has a programmer calculator (bitmask to integer and vice-versa), how I missed this from the Windows 8 calculator...
[Updated on: Sun, 02 August 2015 01:58]
More weapon features and upgrade options, via (mis)use of v1.13 for vanilla Arulco, Dedrianna Lives! and Urban Chaos campaigns.Report message to a moderator
|
|
|
|