> For the complete documentation index, see [llms.txt](https://davedev.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davedev.gitbook.io/wiki/immersive-flashlight/info.md).

# Resource Information

### <i class="fa-shield-exclamation">:shield-exclamation:</i> Compatibility

* **Framework/Core Modes:** Qbox (`qbx_core`), QBCore (`qb-core`), ox\_core, ESX (`es_extended`), Standalone, and Custom.
* **Inventory Modes:** ox\_inventory, QBCore/QB-compatible inventory, QS-Inventory, ESX inventory, Standalone, and Custom.
* **Notifications:** ox\_lib, QBCore notifications, chat fallback, custom client event, or a custom handler function.
* **Audio:** [`xsound`](https://github.com/Xogy/xsound)**,** [`interact-sound`](https://github.com/plunkettscott/interact-sound) or the included `DaveDev_SFX` resource. (All contain the same features) — If you are using multiple, you can select a preferred audio source in the configuration file.

{% hint style="info" %}
Most servers should leave the simple setup values on `auto`. Standard Qbox installations normally use `qbx_core` with `ox_inventory`, so the recommended combination is `setup.core = 'qbox'` and `setup.inventory = 'ox_inventory'`.
{% endhint %}

***

### <i class="fa-plus">:plus:</i> Features

**Player Experience:**

* Synchronized flashlight prop rotation, beam direction, beam state, and tuning for nearby players.
* Custom hold/equip animations and an optional corona glow at the flashlight tip.
* Configurable equip, holster, beam toggle, aiming, and beam-width controls.
* Automatic cleanup when the player dies, becomes restricted, enters an invalid state, loses a required item, or the resource stops.

**Server & Integration Experience:**

* Automatic or forced core/inventory adapter selection.
* Built-in adapters for Qbox/QBCore-compatible cores, ox\_core, ESX, ox\_inventory, QS-Inventory, standalone use, and custom integrations.
* Optional item ownership checks and consume-on-use behavior for supported adapters.
* Framework/state-bag/export-based handcuff and restriction checks.
* Public server/client exports and state-bag values for evidence, UI, and custom inventory integrations.
* Automatic audio routing between `xsound`, `interact-sound`, and the included `DaveDev_SFX` resource.

{% hint style="info" %}
GTA V provides 16 spotlight shadow IDs per client. The resource manages and reuses those IDs, but if more than 16 visible flashlights require shadows at once, some lights may share an ID and display shadow artifacts.
{% endhint %}

***

## <i class="fa-laptop-code">:laptop-code:</i> Development Limitations

During the development process, we've found a few limitations that prevented us from getting a perfectly flawless setup. Below are some transparency items and paired explanations that hopefully can answer any questions you may have regarding known or related issues with the resource.&#x20;

{% hint style="warning" %}
*These discoveries may change based on our findings or fixes that we've pushed to the resource. Check our update patch notes for potential fixes/workarounds to these issues!*
{% endhint %}

{% tabs %}
{% tab title="Resource Monitor" %}
**Resource Monitor:**

* Multiple Running Instances = `0.06ms`-`0.10ms` (depending on the number of people in the area utilizing the flashlight at the same time)
* Not running = `0.00ms`

**Server Performance:** We sparingly send data to the server, using client-side magic to provide fluid & seamless movement amongst nearby players. It truly is "magic", and a huge part of what makes this resource so immersive.

After **countless** hours of refactoring and micro-optimizing our resource, we found that those numbers were the absolute best it could be without removing features or scrapping the light portion of the flashlight — and that would be quite ironic. Trust us when we say, *if we could optimize it further, it would've been done*. For modularity purposes and allowing the usage of ANY in-game model, we kept our current design for now, which suits the majority of community purposes.

**If you're not sure what this means:** The performance impact itself is negligible and unnoticeable, but we still wish to remain as transparent as possible with current and future customers by disclosing our findings during the development of this resource to avoid unwanted surprises.

{% hint style="info" %}
***TLDR;** Due to the fidelity of this resource, and like many similar light-related resources, performance for these resources can be difficult. We have taken every possible step to ensure the highest level of optimization throughout the entire process. As lights must be called each frame — they can be somewhat intensive and is the main performance impact. However, this impact is negligible and shouldn't cause any issues whatsoever for a regular FiveM community/server.*
{% endhint %}
{% endtab %}

{% tab title="Finite Shadow Slots (16)" %}
**Shadow Slot Limitations:**

Unfortunately, in GTA 5, Spotlight shadow IDs are finite. There are 16 slots/IDs available at one time, and if an entity shares a shadow ID, shadows from one spotlight will appear in the other. \
\
Visually, this is very noticeable, often creating strange patterns. To try to mitigate this limitation, we've built a system that smartly assigns IDs and handles them based on client-priority. Each one reserves their own ID and frees up IDs for reuse as necessary.<br>

{% hint style="warning" %}
This will ONLY affect you if **16 people** are using the flashlight at the exact same time in your server. The flashlight will still operate but the light itself may look strange or appear to have unexplainable shadows.\
\
We're working on a potential solution that may create the spotlights differently if an ID isn't available or handle light attachment in an entirely different way.
{% endhint %}
{% endtab %}

{% tab title="Player/World Height Limitations" %}
**Player/World Height Limitations:**

* We've discovered a strange limitation/bug with GTA 5 (something we unfortunately cannot control) when attaching a prop to a prop that is attached to a player — (Prop < Prop < Player) — When this occurs, strange offsets based on Z-Level (height in the game world) will apply. We've added an intelligent system that minimizes this issue as much as possible.
* This should NOT disrupt any gameplay whatsoever — this is purely a small visual flaw that we wanted to personally document to be as transparent as possible.

{% hint style="warning" %}
This is barely noticeable, but you may see that when you're standing on a mountain, or walking up/down steps, the corona is slightly higher/lower than usual. This is unfortunately uncontrollable due to the issue described above. Many attempts were made to lessen this effect, but none were as good as the current system in terms of performance & visual effect, so this iteration was kept for \[v1.0] release.
{% endhint %}
{% endtab %}

{% tab title="Rockstar Editor Issue(s)" %}
**Rockstar Editor Limiation(s):**

Unfortunately, due to the way the flashlight works, a significant part of the resource cannot be shown in Rockstar Editor. Luckily, a majority of the effect is still visible and convincing in environments with adequate lighting.&#x20;

{% hint style="info" %}
*We're actively exploring methods to make this possible and even more convincing — so this isn't a lost cause; we just need some time to get it right!*
{% endhint %}

**What works:**

When viewed through Rockstar Editor, the following things can be seen:

* Flashlight Prop
* Hold/equip Animation
* Flashlight Tip Corona
* Synchronized Position/Rotation&#x20;

**Discovered Limitation(s):**

The **actual flashlight beam/light** does not appear during Rockstar Editor playback (This is the light you adjust and move around on the ground/in-front of the character).

This is caused by a GTA V/Rockstar Editor limitation: the light beam is rendered using `DrawSpotLightWithShadow`, which must be executed every frame during live gameplay. Rockstar Editor does not reproduce that per-frame scripted light draw call, so only the physical/visual supporting elements are visible.

{% hint style="warning" %}
For showcase footage where the beam must be visible, standard live gameplay recording is recommended instead of Rockstar Editor.&#x20;

Any other use, such as the flashlight prop, corona, rotation, etc., is still very convincing, and the effect translates well within Rockstar Editor.
{% endhint %}
{% endtab %}
{% endtabs %}

***

## <i class="fa-comment-question">:comment-question:</i> Frequently Asked Questions

> ### **"Can I use my own inventory, or framework for this resource?"**

Yes! We allow custom framework/inventory support. More information, and extra tips, can be found in [Development Resources](/wiki/immersive-flashlight/info/development-resources.md).

> ### **"How do I install this resource?"**

Steps to install this resource, and even how to download it from the CFX Portal can be found in [Getting Started](/wiki/immersive-flashlight/info/getting-started.md)!

> ### **"How do I get support for my products?"**

Support is handled through our [**Discord**](https://discord.gg/wgPZTwFgaz)**.** While we’d love to be a big team, we’re unfortunately not, so please allow up to 48 hours for a response. *Response time varies depending on the volume of tickets we receive.*

If you notice anything in the wiki that could be clearer, or more helpful, please let us know in your ticket! We'd love to make the process easier for everyone and your assistance would be greatly appreciated.
