Documentation

Common Issues

Checks for start order, the import, screens, and device sessions.

#Devices or Another Resource Does Not Start

Start zyke_lib with its framework provider configured, then zyke_devices, then every resource that uses it. A missing zyke_devices export means the other resource started first or Devices is not running; fix the order and restart that resource. Keep the folder named zyke_devices, since resources load @zyke_devices/import.lua and call exports.zyke_devices.

#Devices Is Nil

Add "@zyke_devices/import.lua" to client_scripts before your own files. The import only runs on the client, so Devices is always nil on the server.

#Device Use Ends at Once

"busy" means another device is already in use. "gone" means the prop does not exist, so pass the entity handle, and "unreachable" means the walk to stand failed; check that the spot is clear and on the floor, or leave stand out. "interrupted" means canContinue returned false.

#Player Is Thrown Out of a Device

A session ends with "hurt" when the player loses health or armour, is ragdolled, or falls, and with "dead" when they die. It ends with "stopped" when the resource that started it, or zyke_devices, restarts, and the camera and controls are given back.

#Screen Does Not Show

List the page in the files of the resource that adds the screen; page is relative to that resource. The prop must exist, and for a map prop model must match and coords be within 1 metre of it. Give the screen a size, since without size or replace nothing is drawn, and stand within drawDistance, 15 metres by default.

#Screen Shows From Behind or Not Through Walls

The front of a screen looks along +Y until rotation turns it, so check rotation; see Exports & Events. A screen inside an interior shows from outside only where the camera can see it, such as through an open door.

#Screen Page Fails or Shows No State

If the DUI cannot be built, the F8 console prints [zyke_devices] <resource>'s screen <id> could not be built: with the reason. Use setState for what the page must show, since send is dropped while the page is not up. In the page, add the message listener before posting ready; see Screen Pages.

#A Texture Changed on Every Copy of a Prop

replace draws the page on a texture of the prop's model, so every copy shows it. Use it only for props that stand once.

#Buttons or Touch Screen Do Not Respond

Input starts once the camera has settled, after camera.easeIn. Every corner of the button area must be on screen, so move camera.offset back or widen fov, and check face, the rotation the button areas are mapped on. Buttons take the click before the screen where they overlap, and a touch screen must be passed as screen, have a size, and have its page up.

#Backspace Does Not Leave the Device

With keyboard = true, Backspace goes to the page. Leave with Esc or the right mouse button.

#Device Is Still Too Dark or Too Bright

Set exposure in Devices.use and raise or lower its target. Devices leaves the exposure alone while another resource uses the extra timecycle modifier slot, and gives up on a face that does not change with it, such as a page that lights itself. If the reader cannot be built, the F8 console prints [zyke_devices] The exposure reader could not be built: with the reason.

#Screens Disappear After Restarting Devices

The import adds a resource's screens again with their last state. A resource using the exports without the import must add them again on onClientResourceStart.