This plugin automatically takes a screenshot from a unique, customized camera angle every time you get a ticket in ATS and ETS2 for running a red light.
This plugin was created as a hands-on example for a video tutorial series on how to use the SPF Framework. It demonstrates a wide range of the framework's capabilities.
Watch the full tutorial on YouTube
This project serves as a practical example for:
- Manifest System: Defining plugin metadata, configuration policies, required hooks, and default settings for logging and localization.
- UI Metadata: Creating automatic UI sliders with custom ranges, titles, and descriptions.
- Lifecycle Management: Correctly using
OnLoad,OnActivated,OnUpdate, andOnUnloadfor plugin initialization and cleanup. - Logging & Formatting API: Writing formatted, contextual log messages for easier debugging.
- Configuration API: Reading settings at startup (
OnLoad) and reacting to live changes from the UI (OnSettingChanged). - Event-Driven Logic: Using the
OnGameplayEventscallback to react to a specific game event (aplayer.finedevent for ared_signal). - Camera API:
- Switching between camera types (
SwitchTo). - Reading and setting camera position and orientation.
- Calculating coordinates and vectors for precise camera placement.
- Setting the camera's Field of View (FOV).
- Checking the current camera type to create a smooth, stutter-free live preview.
- Switching between camera types (
- UI API:
- Registering custom windows and draw callbacks.
- Drawing simple shapes (
AddRectFilled) to create a full-screen visual effect (camera flash). - Controlling window visibility programmatically.
- Telemetry API: Reading the truck's world position and game timestamps to create unique screenshot filenames.
- Game Console API: Executing game console commands from the plugin to trigger a screenshot.
You must have the SPF Framework installed for this plugin to work.
-
If you haven't already, download and install the SPF Framework according to its instructions.
-
Download the latest release of this plugin.
-
You will have a folder named
SPF_RedLightCamera. Copy this entire folder into your game's\bin\win_x64\plugins\spfPlugins\directory. -
The final folder structure should look like this:
...your_game_root\bin\win_x64\plugins\spfPlugins\ └───SPF_RedLightCamera │ SPF_RedLightCamera.dll │ └───localization en.json
- Start the game.
- Press the
DELETEkey to open the main SPF Framework window. - In the plugin list, find
SPF_RedLightCameraand enable it. - If you wish to adjust the camera, go to the "Plugin Settings" tab, select
SPF_RedLightCamera, and use the sliders to configure the position (distance, height, FOV). The changes are applied instantly in a live preview.
❗️ This plugin only works if traffic offense fines are enabled in the game. If you have fines turned off in your game settings, the game will not generate a "fine" event, and the plugin will not take a screenshot.
Screenshots are saved to the game's default screenshot folder, which is typically located at:
Documents\<Your Game Name>\screenshot