# Detacheable Bipods

{% hint style="info" %}
This system is still work in progress and may evolve in the future.
{% endhint %}

In version 0.10 of RHS: Status Quo a new system was added to enable attachment of modular (mainly picattiny) bipods. As this feature is not available in the vanilla game, a lot of scripting and setup work has gone in to make this possible. What was not possible, however, is to make this useable as an out-of-the-box feature for all weapons and some modifications to exisitng weapons is required to make it compatible.

The first section of this document describes the proper way to set up a weapon to be compatible with receiving the bipod attachment and properly respecting the dynamic point of deplyment depending on whether the bipod is stowed or not. The second section (to be added later at some point) deals with creating new bipods that support this functionality as well.

## Weapon Setup

Several steps need to be followed to properly enable the weapon to be compatible.

### 1. Bone

The main xob of the weapon, essentially waht is used as the basis for the weapon prefab should have bone called `bipod_pos` at the approximate location where the deployment point should be as if the bipod was NOT attached to the weapon. This will be the point the weapon well rest on obsticles by default.

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-9e6217bedcbb7b00c3f3936fb4f40f5026278083%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

This can be added as a memory point in Blender like so:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-22763c0cbffd7fac36ca2ec45737e21b72852c16%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
This bone is critical and the system will not work without it.
{% endhint %}

### 2. Prefab

In the weapon prefab (or parent thereof) you need to make some changes. First we will add a new `AttachmentSlotComponent` as a child to the `WeaponComponent` to prepare a slot where the bipod can attach to:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-2743765fce34e98245d92cbfde4de78173d6831a%2Fimage%20(237).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-5d45d74f15a52e6cc4afc7ab5a9c401d181f473c%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Set the attachment slot properties as such:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-1a2e6ffec8445866def06adb900d1b12c493c7a3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Make sure the Attachment Type is set to `AttachmentRIS1913Bipod` so that the bipod can find the right slot and it is set to **Show in Inspection**. Manipulate the **Offset** and **Inspection Widget Offset** positions to be roughly at where the bipod should attach and ideally on the same horizontal position as you have placed tou `bipod_pos` bone.

{% hint style="danger" %}
Leave the Pivot ID property empty or at the very least do NOT set it to `bipod_pos`.
{% endhint %}

Finally edit the `SCR_WeaponAttachmentsStorageComponent` section of `AimingModifierAttributes` **Deployment Points** section to look exacly like below:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-36a22c87f95b4b624d0d2c50cf434c64c92e2a11%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The most important part being that there is 1 stabilization point that is tied to the `bipod_pos` bone. When a bipod is attached, the system will recognise it and animate this bone, moving the stabilization point up and down. When bipod is not there it will be ignored. Normal bipod deployment actions and key bindings should work with it and it should propagate through multiplayer.

The final and most complex step is modifying the animation graphs of the weapon to inject the trigger variable that will animate the point. For this you will have to edit or create the signals and the ProcAnimParams for the weapon. If your weapon already has a `ProcAnimComponent` with a `.pap` file assigned we will need to edit it, otherwise you will need to create a new one.

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-25001aed9bd1365882fe6a010a2f347daab00260%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

When editing your pap file, press **Signal** in top left corner and locate `bipod_signal.siga` in RHS mod files.

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-4f5668f6c8f2541bfe4f407108fc788766fb18bd%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Your signal node will be created in the graph with a **DEPLOY\_HEIGHT** signal present. Add a Bone, TranslateMake and TranslateSet nodes onto the graph using the buttons in the top toolbar, and hook them up to the signal and together as such:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-217fbc0141d36f49e38d50fa52d8631196e6389a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Only the **Bone** node needs editing, and there make sure to set the Bone name property to `bipod_pos` as shown. All other nodes can be left with default settings. Save your pap file and close the Procedural Anim editor.

{% hint style="info" %}
Important: if you alreasy use a siga file for your weapon, paste the nodes from the bipod\_signal.siga into your siga and hook up the nodes in the pap using the existing signal node:

<img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-8a20cd5071e5864b232b3f2e1198a05145a70d1b%2Fimage.png?alt=media" alt="" data-size="original">
{% endhint %}

Now if you attach the bipod you will be able to see the bone animating when bipod is extended:

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-ecb0ae87586275efd1df17645df4b6f463c5aa87%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-6077227daa1eaa548859d8a3796ef4865bae7c5e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-e937443f0639ae522c4ecfc3a288bdca07197c49%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-eec6ecba8226edb59f03d1daa38490ac2556e46d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://370758970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVykVVurkMJOzqmISKydU%2Fuploads%2Fgit-blob-58263687f8aa3002eeaa54a90bf90b19e482bf9f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Creating New Bipods

TBA
