Actium Posted December 13, 2024 Posted December 13, 2024 (edited) TL;DR: NoErrPopup.lua disables the mission scripting error message popups on servers to prevent a potentially irrecoverable server-only freeze. By default, it will send error messages to global chat. DCS World defaults to open error message popups if an error occurs in the mission scripting environment. These popups freeze the simulation until each popup is closed manually. The dedicated server DCS_server.exe is also affected. A mission scripting error triggers a popup on the server, which stalls the server. From a client perspective, this freezes all units except for the local client. As no client-side error messages are displayed, the frozen/stalled server condition cannot be detected by clients. The WebGUI will also be unresponsive. Without direct or remote (RDP/VNC) access to the server, which is not available for most if not all managed servers, this issue is irrecoverable without support intervention or a server restart. The error popups can be disabled via env.setErrorMessageBoxEnabled(false) in the mission editor. However, this must be done in each mission with an appropriate MISSION START trigger. As this approach hampers debugging, it would necessitate separate mission files for production and debugging. NoErrPopup.lua runs env.setErrorMessageBoxEnabled(false) inside the mission scripting environment after a mission has been loaded via a server-side hook script, obviating the need to explicitly disable the popups in each mission. By default, mission scripting error messages will be sent to global chat to facilitate debugging and/or to notify clients that a server-side scripting error has occurred, as it may or may not affect the playability of the current mission. When disabling this feature, mission scripting errors will only be logged to Logs/dcs.log (default DCS behavior). If enabled, error error chat messages will be visible to clients and inside the WebGUI as follows: Install NoErrPopup.lua by downloading it into the DCS Scripts/Hooks folder, e.g.: %USERPROFILE%\Saved Games\DCS.dcs_serverrelease\Scripts\Hooks Optionally, the script can be configured via your autoexec.cfg. Without configuration, the script will use default values. If desired, add the following to %USERPROFILE%\Saved Games\DCS.*\Config\autoexec.cfg and modify the values to suit your needs: -- configure Scripts/Hooks/NoErrPopup.lua: -- do not send error messages to global chat (boolean: true|false) noerrpopup_mute = false Edited February 28 by Actium 1
Actium Posted February 28 Author Posted February 28 Recently stumbled over the DCS.getConfigValue() function while digging inside DCS' Lua guts. The undocumented function will read values from the "config" Lua environment/state (net.dostring("config", ...)), e.g., values set in autoexec.cfg. As this enables much simpler configuration than setting environment variables, I've modified NoErrPopup.lua to use it. Thus, the optional configuration is now handled via autoexec.cfg. Updated the first post accordingly. Also removed the attachement and linked to the script on my Github account, to facilitate minor updates.
Recommended Posts