Skip to main content

ROCK Emitters

Source code · Changelog

ROCK Emitters makes the things mounted on your weapon work in VR: laser sights put a dot where the muzzle points, weapon flashlights light the scene, and optic reticles stay on the point you will hit. It is an addon for ROCK.

Source only

ROCK Emitters has no download and is not released as a mod. Its repository is a reference for other mods: how to read a weapon's emitters from ROCK, take the support hand's trigger, and correct a sight's reticle for each eye. You can build it yourself to use it.

Requirements​

  • Fallout 4 VR 1.2.72.0 and F4SEVR. The plugin refuses any other game version.
  • ROCK 1.0.4 or newer with its requirements. Without ROCK, or with an older one, the addon stays off and the game keeps running.
  • Optional: Mods Config FO4 VR, the in-game menu with ROCK Emitters' settings page.
  • Optional: RPS UI Framework, only for the laser's debug ray.

Build it from the repository; its README has the prerequisites and the steps. The build puts F4SE/Plugins/ROCK_Emitters.dll, the flashlight texture and the Mods Config page into the mod folder you configure.

What it does​

ROCK holds your weapon as a physical object, so its muzzle points wherever your hands put it. Weapon mods author their lasers, lights and reticles for the flat game: a laser beam is a fixed mesh, and a reflex sight's dot is drawn for one eye at one distance. ROCK Emitters replaces those with effects that follow the real muzzle.

  • Laser sights. A weapon with a laser attachment casts a ray from its muzzle. Where the ray lands you see a dot, and a small light spills onto the surfaces around it. The dot is red, green or purple.
  • Weapon flashlights. A weapon with a flashlight attachment gets a real light at the weapon, aimed along the barrel.
  • One trigger for both. The trigger of your support hand cycles the weapon through Off, Laser and Flashlight, skipping what the weapon does not have. The attachment's own beam, dot and light are hidden, because ROCK Emitters draws them itself.
  • Corrected sight reticles. The reticle of a reflex, holographic or similar sight is redrawn for each eye so it marks the point the muzzle ray reaches, seen through the sight's own glass. With a weapon in each hand, each sight follows its own weapon.
  • Reticle visibility. Weak reticle artwork is brightened, and reticles that would be missing or only a few pixels wide are recovered.

Lasers and flashlights are found from the emitters ROCK reports for the weapon and from the names weapon mods give their parts, never from a list of supported mods. A weapon on which neither finds one keeps its original effects. With a weapon in each hand, both sights are corrected, while the laser, the flashlight and their trigger serve one weapon.

Using it​

  • Laser and flashlight: hold the weapon with both hands and press the trigger of your support hand. Each press moves to the next mode the weapon has: Off, Laser, Flashlight, then Off again. Changing weapons starts at Off.
  • Sights: nothing to do. Look through the sight and the reticle marks where the shot goes.

When another mod holds your support hand on a weapon part (a charging handle, a slide), the trigger belongs to that mod until the hand lets go.

Configuration​

In game, open Mods Config FO4 VR (hold both thumbsticks pressed in) and pick ROCK Emitters. Each change shows on your weapon as you make it, so you can tune the dot's size and brightness by eye. Save writes the settings file; Discard, or closing the menu without saving, puts back the values the file has.

Documents/My Games/Fallout4VR/Mods_Config/ROCK_Emitters/ROCK_Emitters.toml

The mod creates the file with every option at its default the first time it starts, and later adds options a new version brings. Each option has its help above it; your own # notes stay. Changes apply while the game runs. All options are in [Main]:

OptionDefaultPurpose
EnabledtrueTurns ROCK Emitters on. Every other option needs it
LaserEnabledtrueThe laser, with its dot, hit light and debug ray
WeaponEmitterControltrueOnly weapons with a laser or flashlight attachment get one, switched by the support hand's trigger. Off gives every weapon an always-on laser, for testing
FlashlightEnabledtrueThe weapon flashlight
FlashlightIntensity1.8Flashlight brightness (0.1 to 20)
CorrectedReticlestrueCorrects sight aim and parallax. Off keeps each sight's original reticle
ReticleVisibilityAssisttrueBrightens weak reticle artwork and recovers missing or tiny aim marks
ReticleBrightness2.0Brightness of corrected reticles while the visibility assist is on (0.25 to 16)
DotEnabledtrueThe laser's dot
HitLightEnabledtrueThe light around the laser's dot
LaserColor"Red"Red, Green or Purple
DotRadius0.55Dot radius in game units (0.05 to 4)
DotEmissionScale32.0Dot brightness at distance (1 to 128)
DotNearEmissionScale64.0Dot brightness nearby (1 to 128), never less than DotEmissionScale
HitLightIntensity6.0Brightness of the light around the dot (0.05 to 10)
HitLightRadius96.0Radius of that light in game units (1 to 512)

The file has a few more options for surface offsets and diagnostics, each with its help. A first start after a version that used ROCK_Emitters.ini carries every option you changed into the TOML file.

The log is Documents/My Games/Fallout4VR/F4SE/ROCK_Emitters.log. When reporting a problem, include the weapon, its attachments, the mod they come from and the log from that game session.

For mod authors​

ROCK Emitters publishes no interface. It is a consumer of ROCK's Weapon, WeaponParts, Input and Collision interfaces, and a worked example of reading a weapon's emitters with copyEmitters and taking the support trigger with an Input lease.

Credits​

Thanks to Arthur for F4VR-ImmersiveFlashlight: the weapon flashlight's light pattern is that mod's texture, and the weapon light's appearance follows it. Its license and notice are kept beside the texture in the repository.

Licensed under GPL-3.0-only.