RHS: Status Quo
  • Red Hammer Studios
  • Join the Team!
  • Frequently Asked Questions
  • Team
  • Arma Reforger
    • RHS: Status Quo
      • EULA
      • Roadmap
      • Feedback
        • How to help us fixing a bug
      • Installation
      • Server Setup
      • Changelog
        • 0.11
        • 0.10
        • 0.9
        • 0.8
        • 0.7
        • 0.6
        • 0.5
        • 0.4
        • 0.3
        • 0.2
      • General Systems
        • Spectrum Device
        • PMF-5.1
        • RHS IR, NV and "Thermals"
        • RHS Extended Inventory System
        • RHS Radial Menu
        • Close Air Support
        • Navigation and Positioning
        • EARHS
        • GPS Radio Beacon
        • Default Key Bindings
      • For Developers
        • Sliding Attachments
        • Detacheable Bipods
        • Custom pouch presets
        • Patches
      • BLUFOR
        • What is BLUFOR?
          • USMC
        • Uniforms
          • Backpacks
            • FILBE Hydration Pack
            • FILBE Backpack
            • 6.11 Tactical RUSH 12 2.0 Backpack
          • Clothing
            • Jackets/Shirts
              • Crye Combat Shirt
              • FROG Combat Shirt
              • Parka
              • Waffle Top
            • Pants
              • BDU Combat Pants
              • Crye Combat Pants
              • FROG Combat Pants
          • Eye Protection
          • Footware
            • BCT Boots
            • USMC Combat Boot
            • Rocky SV2 Boots
            • Luma Military Boots
            • Salomon X Ultra
            • Altama
            • Altama Boots
          • Gloves
            • M-Pact
          • Helmets
            • 3Mâ„¢ PELTORâ„¢ ComTacâ„¢ VI
            • ECH
            • CVC
            • ACH
            • MICH
          • Mask
          • Vest
            • APC Vest
            • PC Gen III
        • Gadgets
          • AN/PRC-152A
          • AN/PVS-14
          • Vector 21
        • Weapons
          • Glock 17
          • Glock 45
          • M17
          • M18
          • M27
          • M4A1
          • M4A1 Block II
          • M38 SDMR
          • M40A5
          • MK153 SMAW Mod 2
        • Weapon Attachments
          • AN/PEQ-15
          • AN/PEQ-16A
          • AN/PSQ-23
          • SU-233
          • M300c
          • LT706 Harris Bipods
          • M4A1 Carry Handle
          • RMR Optic
          • Trijicon TA31RCO Optic
          • Trijicon TA648MDO Optic
          • M8541 Scope
          • Leupold Mark 4 Tactical Scope
          • Leupold TS-30A2 Mark 4 Scope
        • Ammunition
          • 9x19mm M17 24-Round Magazine
          • 9x19mm M17 17-Round Magazine
          • 9x19mm Glock 17-Round Magazine
          • 5.56x45mm STANAG 30-Round M855A1 Magazine
          • 5.56x45mm STANAG 30-Round M995 Magazine
          • M249 200-Round M855A1 Belt
          • 7.62x51mm M40 5-Round Magazine
          • 7.62x51mm M40 M61AP 5-Round Magazine
          • 7.62x51mm M40 M62 Tracer (T) 5-Round Magazine
          • 7.62x51mm M40 M80 5-Round Magazine
          • 40mm M713 Marker Grenade (Red)
          • 40mm M715 Marker Grenade (Yellow Smoke)
          • 40mm M716 Marker Grenade (Violet Smoke)
          • 40mm M585 Star Cluster Grenade
          • 40mm XM663 Star Cluster Grenade (Green)
          • 40mm XM664 Star Cluster Grenade (Red)
          • Mk153 NE (Novel Explosive) Round
          • Mk153 HEDP (High-Explosive Dual-Purpose) Round
          • Mk153 HEAA (High-Explosive Anti-Armor) Round
        • Vehicles
      • REDFOR
        • What is REDFOR?
        • Uniforms
          • Summer VKPO
          • Demi Season VKPO
          • Helmets
            • 6M2
            • TOR (S/M/L)
            • TOR-2 (M/L)
            • LShZ 1+
            • 6B7-1M
            • 6B47
        • Gadgets
          • R-187-P1E Azart
          • 1PN138
          • PDU-4
        • Weapons
          • Attachments
            • Optics
              • PO4x24P
              • INFRATECH TWS-1
              • 1PN93
              • 1P21
              • 1P63
              • 1P78
              • 1P86
              • 1P87
                • 1P87 + 1P90
                • 1P87 + 1PN138
              • PGO-7V3
            • Lasers
              • LTSU-1
              • Zenitco Perst "Klassika" V4.0
          • SP-81
          • APS
          • AK-74M
          • AKS-74UN
          • RPK-74M
          • AK-105
          • AN-94
        • Ammunition
        • Vehicles
          • K-17 Boomerang
          • T-14
          • 2S1
      • INDFOR
        • What is INDFOR?
        • Uniforms
        • Gadgets
        • Weapons
          • Glock 17
          • Glock 45
          • Reference BLUFOR M4A1
          • Reference BLUFOR M4A1 Block I
          • Reference BLUFOR M4A1 Block II
          • AR15 GA UD115
          • AR15 GA UD145
          • AK-101
          • AK-102
          • VZ58P
          • VZ58V
          • MG249
          • M60
        • Ammunition
        • Vehicles
    • RHS: TerraCore
  • Arma 3
    • RHS: Escalation
Powered by GitBook
On this page
  • Weapon Setup
  • Attachment Setup
  1. Arma Reforger
  2. RHS: Status Quo
  3. For Developers

Sliding Attachments

Last updated 7 months ago

The information provided here will allow you to set up the rail sliding system on your weapon and attachment. This system allows the weapon slot position to be manipulatable via actions, moving the attachment (for example optic) backwards or forwards. In some cases you can also specify that the eye location shoild remain the same, making the optic apper smaller or larger on screen as it is moved.

Weapon Setup

First lets start with the weapon rail setup. First you need to add a RHS_WeaponRplComponent to the weapon prefab. Do this to the top prefab in the inheritance tree. No parameters for this component need to be set as it is solely responsible for replicating the position of the attachment between clients in multiplayer games.

Then locate (or create) the AttachmentSlotComponent that you want to enable sliding on.

Right click on the InventoryStorageSlot and pick RHS_SlidingInventoryStorageSlot.

This should keep the initial setup of the slot as it was and add a few extra options.

To set this up properly we need to take a closer look at the rail and the current default attachment point. Select the Offset propery of the attachment slot to visualise the attachment point position.

No you need to calculate how much movement forward and backward relative to this point is possible. You can do this by counting the number of notches ahead and behind the spot. NOTE: do not worry yet about the size of the optic base itself. That will be set in the optic iteself.

In this case there are 11 notches in front of the point and 7 behind. These correspond to possible range of motion between -7 and +11 cm and standard spacing (and this increments of movement) is 1cm. In meters this is -0.07 and 0.11 respectively.

Set the Maximum Positive Slide Offset to 0.11 and Maximum Negative Slide Offset to -0.07.

The Current Slide Offset defines the default position offset and can be left at 0 in most cases.

If you already have a weapon that derives from this prefab and changes something in the AttachmentSlotComponent, you have to make sure you switch the class in that prefab as well.

This concludes the weapon setup. Now every attachment which implements the system as described in the following section should be able to slide the attachment back and forth. This behaviour is visible to other players online and the position should persist at respawn if you save it in the arsenal.

Attachment Setup

To make the attachment compatible, you need to add an action of type RHS_SlideAttachmentAction to its ActionManagerComponent additional actions. See the settings below.

Keep all properties as shown except for two important ones:

  • Affect Eye Distance For Optic - (currently only works for optics implementing the RHS_CollimatorSightsComponent) when checked keeps the eye at same absolute point relative to the weapon, i.e. the eye does not slide with the weapon.

  • Base Half Length - this should be set to half the length of the base of the attachment. So if your optic has an attachment base of 4 cm this should be set to 0.02. This makes sure that the optic does not hang in front or back of the rail.

If you have a sight that implements SCR_CollimatorSightsComponent dont forget to switch this class to RHS_CollimatorSightsComponent.

Optic in forward position
Optic in back position