Page MenuHomeFeedback Tracker

[2.14] drawLaser only draws on PiP if a PiP is being rendered on screen
New, NormalPublic

Description

When using drawLaser on a PerFrame or Draw3d mission event handler and also displaying a PiP render on screen (from a AV camera, for example), the laser will only be drawn in the PiP render and not the main render.

The expected behavior (from a user perspective, not a scripters per se) would be that the laser is rendered in both the PiP render and the main render.

From a scripters perspective, I suspect that the MEH is only firing once for the full frame, and the drawLaser is being grabbed by the PiP render and then discarded as completed before the main frame is rendered, so this is "expected" but inconvenient.

Suggested fixes:

  1. give the PerFrame and Draw3d MEH's an optional parameter to be fired only once per main frame, or else for each render in a frame (specifically counting PiP renders).
  2. adjust drawLaser to check for PiP renders in a frame, and ensure that it is copied to all PiPs in that frame.
  3. create a diag command to detect whether the current render is for PiP or not, so that a check for this condition can be added to the script. (perhaps to spawn a script which waits for the "current frame" to not be PiP before firing a drawLaser)

Rational for needing this fix: drawLaser is a powerful function, allowing for modders to create weapon lasers of many types and qualities (my own mod is built almost entirely off this command). This power is limited if the laser (a weapon aiming laser, for example) disappears any time a PiP effect is being rendered. With recent additions to the Workshop, this could be any time you go to ADS with a PiP optic, or it could be as common a situation as sitting inside a vehicle that has PiP mirrors.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce
  1. Load into a world with access to the console.
  2. place a darter UAV in the world, equip a UAV terminal, and connect to it.
  3. Position the darter so that the player can be seen by the turret camera
  4. run the example script provided on the Biki page for drawLaser
  5. change to third-person view so as to see the beam being drawn (the script spawns it at the eyes, so the beam can't be seen immediately)
  6. display the drone's AV camera on one of the UI's side panels

at this point the laser will disappear from the main render, and appear only in the PiP render.

Event Timeline

GhostJB created this task.Oct 23 2023, 5:54 AM
This comment was removed by BIS_fnc_KK.