• Tracker

    Spaces
    Browse
    Statistics
  • /
  • /Stable Feedback
  • /DZG-3145
Back
1

Script API: let MakeScreenshot() work without -autotest (use case: in-game instant camera with real photos)

Feature Request
1

State

Assigned
Issue key
DZG-3145
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
zodiacal
Created
Dec 4, 2026
Views
27
Platform
PC Steam
What happened?

We built an instant camera for DayZ (working prototype). A player looks through the camera and presses the shutter, and a photo item with the real picture comes out of the camera. Other players can pick the photo up and look at it. Everything works today except one step: MakeScreenshot() only writes a file when the game was started with the launch option -autotest. Without it nothing is written and nothing is logged.

DZG-2402 asks to drop the same check. This ticket adds a complete use case, a repro mod, measurements and suggested limits. Please link the two.

What the mod does (images 1 to 3; images 4 and 5 show the repro):
1. The player raises the camera and looks through the viewfinder (an optics view).
2. On the shutter, the client hides its UI for one frame and calls MakeScreenshot("$profile:...bmp"). The engine writes the frame one frame later.
3. Script crops the frame to a square, shrinks it to 512x512 and 256x256, and encodes DXT1 .paa files (175 KB and 44 KB). The work is spread over frames, so the game does not stutter.
4. The client uploads both files to the server over RPC. The server checks size and format, then stores them.
5. The server creates a photo item in an attachment slot of the camera. The photo is a normal item: it can be taken out, carried and dropped.
6. Any other client that sees the photo downloads the 44 KB picture once and puts it on the item with SetObjectTexture(). Looking at the photo up close loads the 512 version.

Measured on 1.30.164423 (local server, client started with -autotest=1, 1280x720 window):
- The frame is saved one frame after the call (12 to 25 ms): the full window, including UI.
- The whole capture (read, crop, shrink, encode) takes 1.3 to 1.7 s, spread over frames.
- The photo is stored on the server about 5 s after the shutter.
- Another client downloads the 256 picture in about 1.2 s and the 512 picture in about 5 s.
- The files cached on the client are byte-identical to the server's.

We can't ask every player to add a developer launch option: most players never touch launch options, and the option has other effects (the game quits when started with -autotest but without -connect or -mission).

Reproduction steps

Attached ScreenshotRepro_1.30.164423.zip: a client-only mod, one test script (source included).

1. Unzip ScreenshotRepro_1.30.164423.zip.
2. Start DayZ_x64.exe -mod=<path>\@ScreenshotRepro -nolauncher (main menu only, BattlEye not needed).
3. Wait in the main menu. About 5 s after it appears the mod calls MakeScreenshot("$profile:ScreenshotRepro.bmp"); 3 s later a message box shows the result: "NO file was written." There is no ScreenshotRepro.bmp in the profile folder (%LOCALAPPDATA%\DayZ by default) and nothing in the logs.
4. Quit and start again with -autotest=1 added: DayZ_x64.exe -mod=<path>\@ScreenshotRepro -nolauncher -autotest=1
5. Same wait: the message box says "The file WAS written", and ScreenshotRepro.bmp (the full window, UI included) is in the profile folder.

Note: vanilla DayZGame.AutoTestLaunch() quits at start when -autotest is set without -mission. The repro mod sends that case to the main menu instead, only so step 4 can run there.

Exact build version (optional)
1.30.164423
Where did it happen?
Community
Is it modded?
Yes
Expected result

MakeScreenshot() writes the file in the retail game without -autotest. Any one of these would unblock us:

1. Let MakeScreenshot() work in the retail game. Limits that would keep it safe:
- it writes only under $profile: (as it already does for names that start with $), never anywhere else;
- a rate limit, for example one capture per second;
- optional extras: a target size (for example a 512x512 centre crop, scaled by the engine), .paa output (DXT1, the format textures already use) and a "3D only, no UI" flag. A full-window BMP is 2.7 MB at 1280x720 and 25 MB at 4K, and script needs about a second to shrink and encode it. A 512x512 .paa is 175 KB and works as a texture at once. The no-UI flag also keeps chat and HUD out of every capture.
2. Or a player setting in Options, for example "Allow mods to take in-game screenshots": one click instead of a launch option.
3. Or a script API that renders a camera view into an image file or texture (for example a RenderTargetWidget that can be saved). Note: RenderTargetWidget with SetWidgetWorld() currently crashes the client; we reported that separately.

Option 1 alone is enough for us: everything else already works. A crash fix for RenderTargetWidget alone would not be enough, because it shows a view on screen but gives script no pixels to save or send. Option 3 needs both the crash fix and a way to save the image.

A screenshot only contains what the player already sees in the game window (not the desktop or other programs), so it gives the client no new information. Mods that share pictures should check uploads on the server: we check size and format, and log who took each photo.

Related: https://report.bistudio.com/issues/DZG-2402

Section
Mod list

- Mod list: `ScreenshotRepro` (attached; client only)

Load order / launch params

- Launch parameters: `-mod=@ScreenshotRepro -nolauncher` (and `-autotest=1` for the comparison)

Public attachments6 files · visible to everyone

ScreenshotRepro_1_30_164423.zip

3.9 KB

01_photos_taken_in_game.jpg

147 KB

02_photo_viewed_in_game.jpg

213 KB

03_photo_print_on_the_ground.jpg

133 KB

04_repro_without_autotest.webp

161 KB

05_repro_with_autotest.webp

157 KB

Reactions

Activity

    about 15 hours ago
  • zodiacal
    created issueabout 15 hours ago
  • l909
    changed state to
    ASSIGNED
    about 15 hours ago

You are not signed in. Please sign in to see more details and to reply.

State

Assigned
Issue key
DZG-3145
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
zodiacal
Created
Dec 4, 2026
Views
27