Resource Description
How device screens, device use, and exposure work.
#Links
#Shared Library
Devices runs entirely on the client. It handles what there is one of per player: the device in use, its camera, the exposure that keeps the device readable, and every screen. The resource that uses it decides what the device does, and checks every press on its own server.
When a resource stops, its screens and the device in use go with it. When Devices stops, it gives back the camera, the controls, the exposure, and the screens.
#Screens
A screen is a web page of the resource that adds it, drawn on a prop. It is drawn on a flat area in front of the prop, or on one of the prop model's own textures.
Each player builds the screen only while they are near it, 15 metres by default. It is removed again 5 metres past that distance and fades out as the player walks away. A player who arrives late sees the state the resource last set.
A screen on a prop inside an interior is drawn while the player's camera is in that interior. From outside, it shows only where the camera can see its face, such as through an open door or window.
#Using a Device
The player walks up to the device and turns toward it. An optional animation plays on the character, so other players see the device in use. The camera eases square onto the device, and the mouse works on the prop.
Buttons are areas on the prop. Hovering one highlights it, and the left mouse button or the button's own key, when it has one, presses it. Every press lights the button and plays its sound at once, unless the resource turned the sound off.
A screen can take the mouse like a touch screen, with clicks and the scroll wheel going to the page. Some devices, such as a laptop hack, also send typed keys to the screen. The camera can move to another view of the same device while it is in use.
A key panel in the bottom-right corner shows the device's controls. Backspace, Esc, or the right mouse button leaves the device; on a device that takes typing, Backspace goes to the page instead. All other game controls are disabled and the HUD is hidden while a device is in use, but push to talk stays enabled.
#Leaving a Device
Besides the player leaving, a session ends when the player dies, when the device's prop no longer exists, or when the walk to the device fails. If the player is ragdolled, falls, or loses health or armour, the camera cuts back at once and the exit animation is skipped.
The resource that uses the device can end the session, or decide the player can no longer continue. A session also ends when Devices, or the resource that started it, stops. Only one device can be in use at a time.
#Exposure
The game sets its exposure from the whole picture, so a bright window or lamp beside a device can leave the device dark in its close-up. A resource can ask Devices to hold the device's face at one brightness while the camera is on it.
Devices reads the face a few times a second and adjusts the exposure gradually, so the picture never jumps. It uses the extra timecycle modifier slot and lets go of it when the close-up ends. If another resource is using that slot, Devices leaves it alone. Nothing runs while no device is in use.