• Tracker

    Spaces
    Browse
    Statistics
  • /
  • /Stable Feedback
  • /DZG-2402
Back
4

MakeScreenshot() writes no file unless the game is started with -autotest

BugAccessibilityClient
4

State

Open
Issue key
DZG-2402
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
6wingseraph
Created
Nov 1, 2026
Views
13
Platform
PC Steam
What happened?

MakeScreenshot(string name), declared in scripts/1_Core/proto/proto.c, does nothing in a normal game session. The call is accepted, but no file is written and nothing is logged. It works only when the game is started with the -autotest command-line parameter.

This blocks script features that need a picture of the game view, such as an in-game camera or a photo attached to an in-game message. Adding -autotest on the player side is not a client-friendly workaround. Without -connect or -join, vanilla DayZGame.OnInitialize() then calls AutoTestLaunch() instead of opening the main menu, and the game quits if -mission is not set. The parameter also adds the AUTOTEST script define to every module and turns on extended RPT logging, like -dologs.

When it works, the result differs from the documentation:

  • The file is always an uncompressed 24-bit BMP (BI_RGB, bottom-up) at render resolution, whatever extension the name has. At 3840×2160 that is 24,883,254 bytes per shot. The documentation says DDS.

  • A name without $ is saved as $profile:ScreenShots/DD.MM.YYYY HH.MM.SS.mmm-<name>.bmp. The documentation says $profile:ScreenShotes/DATE TIME-NAME.dds.

  • A $ path is used as is, and missing folders are not created. The write then fails with Screenshot failed while for write <path> and Screenshot save into file failed, copying into clipboard, and the image replaces whatever the player had on the Windows clipboard.

  • Only the last request in a frame is kept. Two calls in the same frame give one file.

  • The function returns nothing and raises no event, so a script has to poll FileExist() to learn when the file is ready.

  • ImageWidget.LoadImageFile() cannot read BMP, so the shot cannot be shown in the UI without converting it first.

Reproduction steps

Script used, run once from per-frame client code (for example CustomMission.OnUpdate() in the init.c of an offline mission, after the player has spawned):

MakeDirectory("$profile:shots");
MakeScreenshot("$profile:shots/test.bmp");
  1. Start DayZDiag_x64.exe with an offline mission (-mission=...) and without -autotest. Run the snippet, then check FileExist("$profile:shots/test.bmp") on the following frames. Result: no file and no log line.

  2. Add -autotest to the same command line and repeat. Result: the file appears on the next frame, and the RPT shows Screenshot successfully saved into $profile:shots/test.bmp.

Exact build version (optional)
1.30.164200
Where did it happen?
Local / Offline
Is it modded?
Yes
Expected result

MakeScreenshot() writes the file in a normal client session, with no special launch parameters, in the documented format and location.

Also would be great to change bmp to better file format, since bmp is huge.
Maybe add mode for edds creation, so mods can use that.
PNG mode also suite well.
Since ImageWidget.LoadImageFile() cant read bmp, this is a problem.

Also would be great to have target size, so a script that needs a small picture does not have to save a full-resolution frame.


But for start it will be great to remove line, that checks -autotest, since no functionality differs with that.

Section
Mod list

testmod

Load order / launch params
—
Reactions

Activity

    about 2 hours ago
  • 6wingseraph
    created issueabout 2 hours ago

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

State

Open
Issue key
DZG-2402
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
6wingseraph
Created
Nov 1, 2026
Views
13