shot

shot

namespace

Scripted screenshot capture

Functions

shot.capture(params)

Capture a screenshot

params table Table with path, width, height, supersample, location, rotation and fov

returns boolean

shot.widget(params)

Capture one widget: the pixels it holds on screen, or an offscreen render of a fresh instance

params table Table with name, path, w, h, scale, fresh and bg

returns boolean

shot.widgets()

Log every widget instance with the geometry it was last arranged at

shot.screen(name)

Open a hud screen and answer with the widget class it opened, empty when it did not open

name string Screen name: Inventory, Recipes, Map, Pause, Research, QuestBook, Spawn, SavesManager, Tips

returns string

shot.boot(mode)

Restart the unit boot sequence from its first frame

mode string full or resume

returns boolean

shot.cvar(name, value)

Set a console variable

name string Console variable name
value any Boolean, number or string value

returns boolean

shot.fps(fps)

Pin the engine to a fixed time step, zero turns it off

fps number Frames per second of the fixed time step

shot.on_render_frame(handler)

Call a handler once per rendered frame

handler function Function called with the frame index

shot.finish()

Stop the running script and report success

shot.fail(message)

Stop the running script and report failure

message string Reason written to the log

shot.props_underwater()

Prop instances standing below the water plane, counted by prop

returns boolean

shot.player_camera()

Transform of the local player camera

returns Transform

shot.time_of_day(hours)

Freeze the sky at a solar hour

hours number Solar hour, 0..24

returns boolean